PDA

View Full Version : Own Rescue-CD with Knoppix - without "chroot"



Werner P. Schulz
09-13-2011, 10:12 PM
Now I'm ready with the new version of my scripts. You no longer have to work in chroot jail.

Make a HD Installation of Knoppix, modify it as you like and test it as long as you need. If you want to create your own Knoppix-CD version, the contents of your HD Installation will be copied to the '../remaster' directory by the scripts and a new ISO is builded.

Attention! If you already used the older version of my scripts, all your modifications you did within the chroot jail will be wiped out.

I suggest to start with the step "Prepare enviroment within the Knoppix HD Installation" once more. In this case you get a new, untouched '--/remaster' directory.


Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.0 remaster)

utu
09-14-2011, 06:42 PM
Greetings Werner

It looks like you really have something here.

If I understand your directions correctly, I think there is some ambiguity that would be
well to clear up. For example, when you say 'Make a HD Installation..' I'm pretty sure
you mean 'Make a Virtual HD Installation...'.

Also, when you do this, there are some scary warnings that show up, which I think may be
disregarded, since the operations will be occuring in VirtualBox (or equivalent) and not
on any real hard drive. If so, I think you should forewarn the novice, like myself, and offer
some encouragement to perservere.

Stop me if this is disruptive or not helpful.

Werner P. Schulz
09-14-2011, 09:15 PM
Hello!
You can use a HD Installation of Knoppix within VirtualBox or on a real hard drive; there is nothing dangerous.

Only the step "Prepare enviroment .." writes something in the Knoppix Installation. The steps "Rsync.." and "Build new.." are one-way jobs; all is done in the directory '/opt/knx/' and doesn't alter the HD Installation.

My warning refer to '/opt/knx/remaster'. If you used my old script 'kn-chroot' and have done some modifications within '/opt/knx/remaster', then they gone away after "rsync" :-)

utu
09-15-2011, 01:01 AM
Greetings, Werner

Having built a Virtual HD Knoppix 6.7 and made a few additions & subtractions,
I downloaded your kn-knoppix scripts and proceeded to remaster.

Things came to a halt at the 'Build new iso' phase with the following terminal output:

ed: -e expression #1, char 0: no previous regular expression
sed: can't read /opt/knx/knoppix/boot/isolinux/graphics.conf: No such file or directory
sed: can't read /opt/knx/knoppix/boot/isolinux/graphics.conf: No such file or directory
sed: can't read /opt/knx/knoppix/boot/isolinux/graphics.conf: No such file or directory
sed: can't read /opt/knx/knoppix/boot/isolinux/graphics.conf: No such file or directory
/usr/sbin/kn-final: line 40: cd: /opt/knx/minirt_rd: No such file or directory
/usr/sbin/kn-final: line 41: /opt/knx/knoppix/boot/isolinux/minirt.gz: No such file or directory

There was no iso.
The size of remaster contents was 1.9 Gb.
The size of / was also 1.9 Gb.

1.9 Gb is about what I would expect for the un-compressed system.
The Virtual system did seem to be acting well.

The first phase 'preparing' gave no terminal response I'm aware of.
The 'resync' phase took around 14 minutes, which seemed about what I'd expect;
...I would have preferred a little progress indication along the way.

I seem to be able to return to the Virtual system at will with no ill effects.

So, have you any thoughts on what I should look-for to get the iso made?

Thanks.

Werner P. Schulz
09-15-2011, 05:32 PM
Hello!
Thank you for testing the script. You've run in a problem I didn't described in detail.

The first phase 'preparing' gave no terminal response I'm aware of.If there are no problems, you'll get the messages "Decompress filesystem. This will take a long time!" and "Finished. Used time:..."

If the script cannot find the Knoppix CD, you get the message "If Knoppix CD can't be mounted please mount it within pcmanfm-filemanager". I see, I have to supplement in the message "If Knoppix CD is mounted sucessful, begin with the step 'Prepare enviroment ..' once more."

Sometimes VirtualBox isn't able to mount a CD; in this case you have to unselect the CD within the menu of VirtualBox itself and then to select the CD. Now you can see the CD within pcmanfm and mount it.


...I would have preferred a little progress indication along the way.I don't use a progress indication. It only waste CPU power, but you never get useful datas, how long the process will need. Watch the flickering LED, watch the little window of the ressource-monitor and be patient.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.0 remaster)

utu
09-15-2011, 08:06 PM
Thanks, Werner.

I will try once again.

BTW, I made my adds & removes with Synaptic; was that ok?
I realize you have add & purge lists that I might have used.

Also, the kn-material would not come in via Synaptic, so
I used apt-get install; was that ok?
Some distros warn against mixing apt-gets and Synaptic, I know.

I also anticipate a problem getting an iso out of VirtualBox;
I havent set up any shared-file arrangement yet.

Werner P. Schulz
09-15-2011, 09:17 PM
You can use Synaptic. But sometimes you get trouble using Synaptic versus aptitude/apt-get. If you deinstall some packages with Synaptic, aptitude wants to reinstall them. I only use aptitude, with the CLI or with the commandline.

Also, the kn-material would not come in via Synaptic, so
I used apt-get install; was that ok? To install my package, why don't you use "dpkg -i"?

Read in the VirtualBox Manual how to create shared folders (http://www.virtualbox.org/manual/ch04.html#sharedfolders).

The other way to get an ISO out VirtualBox is using an USB-Stick. If someone has VirtualBox within a Linux Host, he can use a ssh-connection between Host an Guest.

utu
09-15-2011, 10:52 PM
Greetings, again, Werner.

I think your part of this experiment has probably gone all right.

There was, as you thought, a problem knowing whether or not the cd
was mounted on the virtual system. Once that was taken care of things
proceeded for about 14:13 in 'prepare', 1:28 in 'rsync' and 16:35 in
the 'finale', producing a 780 Mb iso and some checksums.

Flashes on the VB hdd and cd icons do give some re-assurance during
the 14- and 16-minute intervals of behind the scenes activity that
something useful may indeed be underway. Terminal entertainment
is not really necessary for the patient operator.

The only disconcerting thing I can mention is that after each phase
I seemed to need to re-locate the re-mastering menu to launch the next
phase. I can live with that, but it's strange.

My problem now is figuring how to get the iso out of VirtualBox, or how
to exercise it within VirtualBox. There is some problem with my PCLinuxOS
VB setup in regard to Shared Folders and VBGuest Additions which I have
to straighten out. I'll get back to you when I do.

Just now read your latest post:

I probably used dpkg -i, now that you mention it, just not Synaptic.
I'll study your VB suggestions as well.

I think you have a success on your hands here, Werner. Congratulations.

utu
09-17-2011, 02:03 AM
Greetings, Werner

I have shifted gears here.
I have made an actual hd install ala 0wn and set up your process there.

My process times are now 6:18 for prepare; 0:16 for rsync;
5:14 for build new iso; and 0:01 for create boot-CD.

The 'new iso' is about the right size, but the 'boot iso' is not;
it says 11Mb. I am assuming the boot iso contains the 'new iso' and
will be somewhat larger as a result.

I have assumed we were NOT bound to stay within actual CD limits of around
700 Mb or so, and my current 'new iso' candidate itself is 798 Mb.
I had planned just to burn a DVD instead of a CD.

What are your thoughts on the matter?

Werner P. Schulz
09-17-2011, 09:37 AM
Hello!

The only disconcerting thing I can mention is that after each phase
I seemed to need to re-locate the re-mastering menu to launch the next
phase. I can live with that, but it's strange.The step "Prepare.." you have to do only once. The step "Rsync.." and "Build.." I will not connect to a single one step. Perhaps you have in your HD Installation a directory '../pictures' and you don't want it in the new ISO. Now you can either insert in the script "kn-rsync" a new "--exclude=.." for your own and after it run "Rsync.." or you first run "Rsync.." and then remove the directory '../pictures' within '/opt/knx/remaster' It is your decision how to do the job.

My process times are now 6:18 for prepare; 0:16 for rsync;
5:14 for build new iso; and 0:01 for create boot-CD.
The measured times are ok.

The 'new iso' is about the right size, but the 'boot iso' is not;
it says 11Mb. I am assuming the boot iso contains the 'new iso' and
will be somewhat larger as a result.
It is also ok. The Boot-CD only contains the Knoppix bootloader, nothing else; it is designed in case of you cannot boot a computer with a flash-disk installation like an USB-stick. The new ISO contains the bootloader and the compressed filesystem Image.

I have assumed we were NOT bound to stay within actual CD limits of around
700 Mb or so, and my current 'new iso' candidate itself is 798 Mb.
I had planned just to burn a DVD instead of a CD.
Of course, you can also remaster a Knoppix DVD. In this case I assume you need about 30GB free space on a partition for a) HD Installation b) '/opt/knx/remaster' and c) '/opt/knx/iso'. And you must change the value 'MIN_FREE=800000' to 'MIN_FREE=5000000' within the script "kn-final".

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.0 remaster)

utu
09-17-2011, 04:01 PM
Nice work, Werner.

I used DVD media to burn mz 798 Mb iso.
Successful with a minor difficultz, as zou can see.

Ich spreche Deutsch nicht.
Mein bookmarks are in English, but not mz menus.

Mein kezboard has yeds where I expect wzes.

All mz wifi nrs and passwords are intact.

A marvelous new capabilitz zou have created.

Danke. This is what I was looking for.
Zou should call up Klaus right awaz.

Werner P. Schulz
09-17-2011, 04:22 PM
Successful with a minor difficultz, as zou can see.I see :-)

Follow the step from my suggestions: "Make changes in the file '/opt/knx/knoppix/boot/isolinux/knoppix.menu' as you need for my Bootmenu, especially within all "lang=.." and "tz=.." items of the "Append"-lines."

utu
09-17-2011, 05:40 PM
Hey, Werner

Coming to you from a new LiveUSB product made from
my German-speaking remastered CD.

I taught the LiveUSB English in minutes.
Now my zeds and wyes are where I expect them to be.
I edited the APPEND line 'lang=de' to lang=us' after boot
in /mnt-system/boot/syslinux/knoppix.menu.

This might have been a little easier if your otherwise nice menu
offered, as well, a knoppix-cheatcode-entering option.
There are likely other reasons this might be a good additional
option, I think.

And, again congratulations on such an elegant addition to Knoppix.

Werner P. Schulz
09-17-2011, 06:05 PM
... there is already an option to enter cheatcodes: below the line "Boot from HD"

utu
09-17-2011, 06:34 PM
Not very usable if lang= has already changed the keyboard map.

A cursor-selection-list would probably be required to solve this
problem without going back and re-doing the CD as you suggest.
That's too much to ask.

I withdraw the cheatcode suggestion, it detracts from the general
plan you have established.

Werner P. Schulz
09-18-2011, 11:58 AM
I edited the APPEND line 'lang=de' to lang=us' after boot
in /mnt-system/boot/syslinux/knoppix.menu.Yes, in a flash-disk Installation with persistent memory you can edit this file, but in my proposal of remaster, you have to edit '/opt/knx/knoppix/boot/isolinux/knoppix.menu'.

To prevent to vaste time and CDs I sugest: "Copy the new ISO to the isoimages-directory of VirtualBox and test your new remastered ISO. If all went well burn ISO to CD."


Not very usable if lang= has already changed the keyboard map.
Why that? While startup Knoppix looks for any existing cheatcodes. If the cheatcode

boot: knoppix lang=usis found, Knoppix will use it; otherwise the item in the Append line is selected.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.0 remaster)

utu
09-18-2011, 03:43 PM
Greetings, again, Werner.

I have another aspect to call to your attention.

I am not positive, but I think it is the case, that if one uses
Synaptic to remove programs from the remaster, that the resultant iso
may actually increase in size, rather than decrease.

I have not tried your approach for removing programs, to see if this
is the case for your method as well.

If there is some difference between doing the program removal via
Synaptic or via your method, then there surely must be some adjustment to
using Synaptic that would serve just as well. Perhaps reloading or using
'clean' or some such already built-in feature of Synaptic.

Have your already run into this phenomenon?

utu
09-18-2011, 03:56 PM
ps. Where do I find the equal sign on a German keyboard?

Werner P. Schulz
09-18-2011, 05:46 PM
You get '=' with 'shift 0' on german keyboard.

If you remove packages with Synaptic or with aptitude, they are gone from their directory, for example '/usr/bin/gimp'. Synaptic and aptitude/apt uses '/var/cache/apt' and '/var/lib/apt'. Parts of this remains in the HD Installation, but will be omitted in the new ISO. Have a look in the script 'kn-rsync'.

Therefore it doesn't make a difference using Synaptic or aptitude in aspect of the size of the ISO.

utu
09-20-2011, 03:18 PM
Greetings, Werner.

Is there any problem using your remastering scripts for 6.7.1,
other than the logo on the opening screen?

utu
09-20-2011, 04:42 PM
I now see you've changed the logo to 6.7.1.
Were there any changes within the scripts other than the logo?

Werner P. Schulz
09-20-2011, 05:42 PM
The logo is in the picture '/opt/knx/knoppix/boot/isolinux/boot671.png'. You can modify it, for example with GIMP, or create another picture (640x480 pixel). Change the line "MENU BACKGROUND.." in the file '/opt/knx/knoppix/boot/isolinux/graphics.conf'

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.1 remaster)

Werner P. Schulz
09-20-2011, 05:57 PM
I now see you've changed the logo to 6.7.1.
Were there any changes within the scripts other than the logo?Yes, i changed some things and corrected logical errors. I inserted messages in the dialog-boxes in case of trouble.

The cloop-modul to extract the compressed filesystem image is the old (from V6.7.0). The new sources for kernel and cloop are not available; I think because of the hack of ftp.kernel.org.

utu
09-22-2011, 12:35 AM
Greetings, Werner

I have a question for you.

Since I now have a USB with LOTS of Gbs, might I just as well add your remastering tools
to a LiveUSB with adequate Gbs rather than use an actual HD install as the basis?

If that's not NOW an option, would it take too much re-programming to do remastering that way?

Werner P. Schulz
09-22-2011, 12:06 PM
You cannot use my remaster scripts for a flash-disk installation, only for a HD Installation.

In a HD Installation you must not fiddle with the compressed filesystem Image and the compressed persistent memory. You have a Debian-like filesystem and it is very easy to remaster it.

In a flash-disk Installation you have to recombine the compressed filesystem Image and the persistent memory. In the next step the old compressed filesystem Image and the persistent memory will be removed from the flash-disk and the new compressed filesystem Image is written to the flash-disk. The third step creates a new persistent memory.

I described this on my page (http://www.wp-schulz.de/knoppix/recombine.html), but I do not recommend "recombine". In case of error you may lose all your datas. And I did not have time to test the "recombine"-scripts in detail and to make them more user-friendly.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.1 remaster)

utu
09-22-2011, 04:13 PM
Greetings, Werner.

Here's my question in more detail.

Given the following:
A host computer having a working and valuable hdd install of a Non-Linux system;
... said system having CD, CD/DVD recording and several USB ports.

0. Start with a LiveCD and a bootable USB with many Gbs
1. Use GParted on the LiveCD to establish an 8-12 Gb partition on the USB
... and format that to reiserfs
2. Use GParted to establish a 1-2 Gb partition on that same USB
... and format that to swap
3. Use the LiveCD to do an 'HD-Install' on the reiser/swap USB partition

4. Adjust the bootable USB to allow its booting to the 'HD-Install' partition;
... and specifically avoid chaining to-, or changing- any existing MBR arrangement
... on the HDD of the host

5. Boot the new USB partition and add the Schulz remastering programs
6. Proceed as if this were an actual HD-Install

My question really is: is Item 4 do-able or nonsense?

Werner P. Schulz
09-22-2011, 07:17 PM
6. Proceed as if this were an actual HD-Install

My question really is: is Item 4 do-able or nonsense? In this case it is a real HD Installation, and not "as if this were". Therefore you can use the kn-scripts. But your BIOS must be able to boot from USB.

Werner P. Schulz
09-22-2011, 10:29 PM
Oh, I see, my answer didn't hit your question.

and specifically avoid chaining to-, or changing- any existing MBR arrangement
... on the HDD of the host If you do the HD Installation with the 0wn-script from KK, then this script writes the Grub-bootloader in the MBR of the flash-disk. Take care, which options of the script you select. And if your BIOS has the ability to boot from USB, you can tell BIOS to boot the USB. Therefore you don't need to change anything in the bootloader of your productive OS (Windows?).

utu
09-23-2011, 03:58 PM
Hello, again Werner.

Thanks for reviewing my situation; I think you see my problem now.

I don't mind if 0wn modifies the MBR of my USB, so long as it does
not also modify the MBR of my HDD. The prompts on the 0wn grub choices
menu are unclear (to me) in this regard. I need to figure out exactly
what's going on for each 0wn choice, and probably understand grub itself
much better than I do.

If I can get past this hurdle, your revised remastering process does
exactly what I want, and happily avoids being put in a VirtualBox or
a chroot jail. HDD-MBR Hell is still a concern. I think it's what I
get if I make the wrong 0wn grub setup menu choice

utu
09-28-2011, 12:23 AM
Multi purpose USB-stick
To create a multi purpose USB-stick (4 GB) proceed as follows:

Boot VirtualBox with Knoppix-HD-Installation
Insert USB-stick
Create with gparted a primary partition #1, 3 GB, fat32 formatted
Create with gparted a primary partition #2, 1 GB, fat32 formatted
Select 'Preferences/ Install KNOPPIX to flash disk'
Select '.. target device sdb ..', '.. directory containing KNOPPIX files "/opt/knx/knoppix"\
..' and '.. format device No ..'
In this case the installation will be done on /sdb1 and /sdb2 will be untouched.

Unplug and reinsert USB-stick; mount both partitions of stick
Copy '/KNOPPIX/' from /media/sdb1 to /media/sdb2; delete '/KNOPPIX/' on /media/sdb1.
If you boot with this multi purpose USB-stick, '/KNOPPIX/KNOPPIX' will be found on the partition #2\
and you can also create the persistent memory on partition #2.\
But if you boot with another OS (perhaps Windows) and insert this USB-stick,\
then you can only use partition #1 of the stick.\
Don't delete '/boot/' and 'ldlinux.sys' on partition #1 of this stick!


Greetings, Werner.

1. Will the persistence file end up on partition #1? or #2?

2. How might these ideas be adapted to a large USB
... having a large number of partitions, anyway more than two,
... except for the syslinux bootable partition,
... each conceivably with its own unique iso?

Werner P. Schulz
09-28-2011, 09:13 PM
In the example I described, the persistent memory is only on partition #2.

I don't know, if it is possible to boot more then one KNOPPIX/KNOPPIX on different partitions with syslinux. Syslinux offers an multiboot option with "mboot.32", but I never tried it.

utu
09-28-2011, 09:40 PM
Hello, again, Werner.

Partition #2 in your example is only 1 GB to start with.
KNOPPIX will use at least 700Mb of that.
This leaves precious little for persistence in partition #2, anyway.

I would have thought the proportions would be the other way around
1 Gb in #1 and 3 Gb in #2 if #2 also get the persistence file.

Am I missing something here?

ps.. I liked your screen shot of the missing LXDE menu.
It looks like Halloween came early in Dietzenbach.

Werner P. Schulz
09-29-2011, 12:03 AM
It is only an example. Each user can create the partitions as he like. And for rescue purpose I think it is better to have as much free space on a USB stick or an USB drive as possible to store stuff like "Documents" from a violated OS.
I liked your screen shot of the missing LXDE menu.
It looks like Halloween came early in Dietzenbach. Halloween is only one night; but this error torments me since many days :-(

M8R-xi2q7t
10-28-2011, 11:47 AM
After "Prepare remaster environment", I see:



Edit all items of 'lang= ' and 'tz= ' as you need within
the file '/opt/knx/knoppix/boot/isolinux/knoppix.menu'!


While trying to follow the advice, I noticed the following in knoppix.menu:



KBDMAP german.kbd


If my keyboard is more of the US-persuasion, is there a recommended course of action?

M8R-xi2q7t
10-28-2011, 01:19 PM
I went ahead and removed the KBDMAP line and so far haven't noticed any ill effects.

On a separate note, for some reason, /etc/init.d/knoppix-autoconfig didn't appear in its appropriate location under the remaster directory. When I booted the resulting ISO, I noticed a message about not finding knoppix-autoconfig and neither the keyboard nor the pointing device appeared to work (at least, not under X).

Subsequently, I manually copied knoppix-autoconfig to /opt/knx/remaster/etc/init.d/ and rebuilt the ISO, and the result appears to behave much better.

I thought I had just followed the instructions at the "Summary: Own Rescue-CD with Knoppix" page -- using VirtualBox, checking the KNOPPIX CD checksum, etc.). Is there any information I might provide to try to understand what might have gone awry?

Werner P. Schulz
10-28-2011, 01:28 PM
If you have a non-German version of Knoppix look at '/usr/share/kn-knoppix/save/isolinux.cfg' which item to use for "KBDMAP". Please tell me what you found there.

Greetings Werner

M8R-xi2q7t
10-28-2011, 02:19 PM
Thanks for your response and help.

I am using a non-German version of Knoppix (EN). Searching for KBDMAP within /usr/share/kn-knoppix/save/isolinux.cfg yielded one line:



# KBDMAP german.kbd


When attempting to edit an entry in the boot menu, I noticed that slash "/" was not where I expected it so I created a file named us.kbd via the keytab-lilo.pl script that comes with lilo. I replaced the german.kbd file with the resulting us.kbd and placed the following line in the .cfg file:



KBDMAP us.kbd


This seemed to produce more familiar behavior.