PDA

View Full Version : Knoppix boot from different partitions



chah
01-06-2011, 04:38 AM
If you have copied Knoppix 6.2.1 files to a partition on your HDD and you try to boot from a 6.2.1 USB key, it will somehow switch over to loading and mounting everything from the HDD copy.

Is there any way to disable this, to force Knoppix to boot from a particular partition, or from a particular KNOPPIX/ directory, when there are multiple versions lying around?

Can we have a KNOPPIX6.2.1 and KNOPPIX6.4.3 directories each containing the relevant Knoppix files in different partitions and choose which one to boot from a Grub menu.lst? I'm trying this right now and at the moment, 6.4.3 strangely seems to boot the 6.2.1 partition (I put on 6.2.1 first). It also takes very much longer when it does this, sticking for a while at a "Probing EDD..." prompt.

Werner P. Schulz
01-06-2011, 09:26 AM
If you have copied Knoppix 6.2.1 files to a partition on your HDD and you try to boot from a 6.2.1 USB key, it will somehow switch over to loading and mounting everything from the HDD copy.... are you sure your BIOS can boot from USB-Stick? Otherwise BIOS will switch to second bootable device and boot from HD.


Can we have a KNOPPIX6.2.1 and KNOPPIX6.4.3 directories each containing the relevant Knoppix files in different partitions and choose which one to boot from a Grub menu.lst?If different OS are on different partitions you can select which OS to start. Can you post '/boot/grub/menu.lst' and the output from "df -h"

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

chah
01-06-2011, 10:50 AM
I'm fairly sure it is booting the isolinux on the USB drive (when the big penguin appears, that is the from the USB drive), and at some point after, it searches for appropriate files on the HDD and switches to them if it finds them. I remember I had problem booting 6.2.1 from the USB drive while I had the files for 6.0.1 on my HDD until I went in and disabled 6.0.1 by renaming KNOPPIX to KNOPPIX_disabled. (the version numbers may not be accurate, but the gist is correct). Then it boot properly from the USB key, and I wasn't playing around with the BIOS. Prior to that it was dropping me to limited shell from which I could see using df -h, that it had started mounting stuff from Knoppix 6.0.1.

In general, I thought this was a nice feature, because I could copy KNOPPIX/ from the iso image to a partition on my HDD, boot from the USB key, and pull the USB key out a few seconds later and the booting would continue and complete from the HDD partition. But in this case with multiple versions of Knoppix lying on different partitions, it is making it difficult.

The setup I am trying to bring about is Knoppix 6.2.1 on /dev/sda5, Knoppix 6.4.3 on /dev/sda6, Ubuntu 10.4 on /dev/sda7, all bootable from Grub. Here is menu.lst:


default 0
timeout 10

title Knoppix_6.2.1
root (hd0,4)
kernel /boot/syslinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 initrd=minirt.gz nomce quiet loglevel=0 tz=localtime no3d noprompt screen=1920x1080
initrd /boot/syslinux/minirt.gz
boot

title Knoppix_6.2.1_noimage
root (hd0,4)
kernel /boot/syslinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 initrd=minirt.gz nomce quiet loglevel=0 tz=localtime no3d noprompt noimage screen=1920x1080
initrd /boot/syslinux/minirt.gz
boot

title Knoppix_6.4.3
root (hd0,5)
kernel /boot/isolinux/linux ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off video=vga16fb:off initrd=minirt.gz nomce loglevel=1 tz=localtime no3d noprompt
initrd /boot/isolinux/minirt.gz
boot
The ubuntu partition is not set up yet, as I am not getting 2 versions of Knoppix dual booting properly. At the moment I just want to keep 6.2.1 around for legacy reasons, I hope that I should be able to switch to 6.4.3. I need Ubuntu for the 64 bit OS from time to time, but prefer the Knoppix environment.

This is the output from df -Th


$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda6 ext3 37G 3.6G 32G 11% /mnt-system
tmpfs tmpfs 2.0G 49M 2.0G 3% /ramdisk
/dev/cloop iso9660 8.1G 8.1G 0 100% /KNOPPIX
unionfs aufs 2.0G 49M 2.0G 3% /UNIONFS
unionfs aufs 2.0G 49M 2.0G 3% /home
tmpfs tmpfs 10M 64K 10M 1% /UNIONFS/var/run
tmpfs tmpfs 10M 0 10M 0% /UNIONFS/var/lock
tmpfs tmpfs 100M 64K 100M 1% /UNIONFS/var/log
tmpfs tmpfs 2.0G 228K 2.0G 1% /tmp
udev tmpfs 20M 420K 20M 3% /dev
tmpfs tmpfs 2.0G 4.0K 2.0G 1% /dev/shm
/dev/sda6 ext3 37G 3.6G 32G 11% /media/sda6
/dev/sda5 ext3 37G 4.7G 31G 14% /media/sda5
/dev/sda7 ext3 37G 177M 35G 1% /media/sda7
/dev/sda8 ext3 37G 177M 35G 1% /media/sda8
When booting the 6.4.3 partition, it does something for a very long time while it is "Probing EDD..." after which it eventually boots 6.2.1. If I "disable" 6.2.1 by renaming KNOPPIX to KNOPPIX_disabled in that partition, then it boots to 6.4.3.

kl522
01-06-2011, 11:57 AM
Is there any way to disable this, to force Knoppix to boot from a particular partition, or from a particular KNOPPIX/ directory, when there are multiple versions lying around?


You can try to use the knoppix cheatcode knoppix_dir=KNOPPIX.

Basically you copy the knoppix files to different directories, and then you specify the knoppix_dir=KNOPPIX inside your menu.lst entries.

Werner P. Schulz
01-06-2011, 12:50 PM
If you have copied Knoppix 6.2.1 files to a partition on your HDD and you try to boot from a 6.2.1 USB key, it will somehow switch over to loading and mounting everything from the HDD copy.
If you build an USB-Stick using origninal Knoppix-CD with menu order 'Preferences/ Install KNOPPIX to flash disk' then Knoppix will only boot from USB-Stick. Be sure BIOS can boot from USB-Stick; if in doupt disable all options to boot from HD or CD.


In general, I thought this was a nice feature, because I could copy KNOPPIX/ from the iso image to a partition on my HDD, boot from the USB key, and pull the USB key out a few seconds later and the booting would continue and complete from the HDD partition.Why that? You can not change device order while boot process is running! Either boot from USB-Stick or boot from USB-Drive.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

kl522
01-06-2011, 02:37 PM
If you build an USB-Stick using origninal Knoppix-CD with menu order 'Preferences/ Install KNOPPIX to flash disk' then Knoppix will only boot from USB-Stick. Be sure BIOS can boot from USB-Stick; if in doupt disable all options to boot from HD or CD.

Booting and running the system are two independent things for Knoppix, ie after knoppix is booted from a kernel and the kernel loaded the initrd/initramfs, it will begin searching for available Knoppix System from whatever available HD and USB devices present on the system. This is a (somewhat confusing) feature which can lead to someone possibly booting from USB, but yet using a Knoppix System loaded on the HD.

Sometimes the system present on the HD is an older version compared to the kernel on the USB, that will lead to a module loading problem with cloop.ko and aufs.ko.

Cheers.

Werner P. Schulz
01-06-2011, 06:05 PM
Booting and running the system are two independent things for Knoppix, ie after knoppix is booted from a kernel and the kernel loaded the initrd/initramfs, it will begin searching for available Knoppix System from whatever available HD and USB devices present on the system.I am in doubt this will be the behaviour of an USB-Stick which you build without any hacks and start without any cheatcodes.

chah
01-07-2011, 02:12 AM
You can try to use the knoppix cheatcode knoppix_dir=KNOPPIX.

Basically you copy the knoppix files to different directories, and then you specify the knoppix_dir=KNOPPIX inside your menu.lst entries.

Is there anyway to specify which partition is boot from? But I can also choose a unique name for each directory on each partition which will allow a specific boot for each version of Knoppix. Thanks for the tip.


I am in doubt this will be the behaviour of an USB-Stick which you build without any hacks and start without any cheatcodes.

It does happen though. Give it a try, copy the KNOPPIX/ directory from the USB stick onto the root of a partition on your hard drive (maybe you need the boot/ directory too), boot from the USB without any cheat codes and when the system is running, take a look at df -h to see which partition is mounted on /mnt-system/. During the booting process, it will also tell you which partition it is using, just under the penguins indicating the number of cores your computer has. If it is using the one on the HDD, you can immediately pull the USB out and booting will continue to completion from the HDD.

This happens without flutzing around with the BIOS or the MBR, just so long as you can boot from the USB.

kl522
01-07-2011, 03:19 AM
Try "fromhd=/dev....." cheatcode.

Actually what I am not so sure is whether we are using a feature of knoppix or we are exploiting a bug in knoppix. If it is a bug, the behaviour might not be the same in later versions.

chah
01-07-2011, 03:40 AM
I used to think that when you boot from your own USB, you are assured of a working, uncorruptible KNOPPIX system. I found this is not necessarily true. If you have a copy of KNOPPIX on the HDD, it will switch over to that system, often unbeknownst to the user.

There are several places that Knoppix takes updates/modifications from while booting that will cause it to be different from the clean system that Klaus gives us. The first is obviously if you create a persistent knoppix.img in KNOPPIX/, modifications will be mounted from there. Secondly if you have a knoppix.sh in KNOPPIX/ subdirectory, it will be executed as root just before you get a working system, you can put whatever additional modifications you want to happen in that file (untar additional files, start daemons).

Thirdly, and in my opinion, most dangerously, if there is a copy of KNOPPIX/ on your HDD, Knoppix will switch over to that early on during the booting process. It will say it right below the penguins as mentioned, but if you don't read it, and you don't check with df -h, you may not know you are working on a possibly modified system.

Werner P. Schulz
01-07-2011, 12:20 PM
It does happen though. Give it a try, copy the KNOPPIX/ directory from the USB stick onto the root of a partition on your hard drive (maybe you need the boot/ directory too), boot from the USB without any cheat codes and when the system is running, take a look at df -h to see which partition is mounted on /mnt-system/. .

First of all, i don't like to experiment with older versions of Knoppix; the actuell version is KNOPPIX_V6.4.3CD-2010-12-20-EN.iso

I have build an USB-Stick without any hacks.

I copied /Knoppix and /boot/syslinux to an HD with Ubuntu-installation.

At first I mounted Knoppix USB-Stick as /dev/sda and Ubuntu HD as /dev/sdb and get while booting from USB-Stick the message: "Knoppix 6 found at: /dev/sda1"


Then I mounted Knoppix USB-Stick as /dev/sdb and Ubuntu HD as /dev/sda and get while booting from USB-Stick the message: "Knoppix 6 found at: /dev/sdb1"

chah
01-07-2011, 01:00 PM
Can you clarify, what you mean by "I mounted Knoppix USB-Stick as /dev/sda and Ubuntu HD as /dev/sdb and get while booting...."? When booting 6.4.3, I just put the thumbdrive in the USB port, turn the computer on then press return at the big penguin screen without mounting anything, I don't have any choice over which device becomes /dev/sda and which /dev/sdb. Are you somehow able to choose which is sda and which is sdb during booting?

When you copy KNOPPIX/ and boot/ to the Ubuntu partition, did you put it in the root directory of the partition?

Werner P. Schulz
01-07-2011, 02:19 PM
... you can install a HD as master or slave in your computer. And independent of this you can change BIOS setting to boot from HD or USB-drive. BIOS must be able to accept an USB-Stick as an USB-drive.


When you copy KNOPPIX/ and boot/ to the Ubuntu partition, did you put it in the root directory of the partition? Yes, of course.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

chah
01-08-2011, 01:31 AM
Could you post the output from df -Th after booting from the USB stick?

Werner P. Schulz
01-08-2011, 09:56 AM
... first case:

# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 vfat 965M 963M 1.2M 100% /mnt-system
tmpfs tmpfs 2.0G 0 2.0G 0% /ramdisk
/dev/cloop iso9660 1.9G 1.9G 0 100% /KNOPPIX
/dev/loop0 ext2 257M 3.6M 254M 2% /KNOPPIX-DATA
unionfs aufs 257M 3.6M 254M 2% /UNIONFS
unionfs aufs 257M 3.6M 254M 2% /home
tmpfs tmpfs 10M 68K 10M 1% /UNIONFS/var/run
tmpfs tmpfs 10M 0 10M 0% /UNIONFS/var/lock
tmpfs tmpfs 100M 48K 100M 1% /UNIONFS/var/log
tmpfs tmpfs 2.0G 8.0K 2.0G 1% /tmp
udev tmpfs 20M 356K 20M 2% /dev
tmpfs tmpfs 2.0G 4.0K 2.0G 1% /dev/shm
/dev/sdb1 ext4 7.4G 5.9G 1.1G 85% /media/sdb1second case:

# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb1 vfat 965M 963M 1.2M 100% /mnt-system
tmpfs tmpfs 2.0G 0 2.0G 0% /ramdisk
/dev/cloop iso9660 1.9G 1.9G 0 100% /KNOPPIX
/dev/loop0 ext2 257M 4.8M 252M 2% /KNOPPIX-DATA
unionfs aufs 257M 4.8M 252M 2% /UNIONFS
unionfs aufs 257M 4.8M 252M 2% /home
tmpfs tmpfs 10M 68K 10M 1% /UNIONFS/var/run
tmpfs tmpfs 10M 0 10M 0% /UNIONFS/var/lock
tmpfs tmpfs 100M 48K 100M 1% /UNIONFS/var/log
tmpfs tmpfs 2.0G 8.0K 2.0G 1% /tmp
udev tmpfs 20M 356K 20M 2% /dev
tmpfs tmpfs 2.0G 4.0K 2.0G 1% /dev/shm
/dev/sda1 ext4 7.4G 5.9G 1.1G 85% /media/sda1If I have a look at init-script I can not find any line which could explain the curious behavior of Knoppix USB-Stick you told us.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

kl522
01-08-2011, 11:36 AM
I suspect both of you might be correct, ie Klaus might have changed the scripts in later releases thereby causing two distinct behaviour for knoppix 6.2.1 and knoppix 6.4.3. I am too lazy to verify it by looking at the scripts.

Cheers.

Werner P. Schulz
01-08-2011, 12:42 PM
I suspect both of you might be correct, ie Klaus might have changed the scripts in later releases thereby causing two distinct behaviour for knoppix 6.2.1 and knoppix 6.4.3. I am too lazy to verify it by looking at the scripts.

Cheers.
... if I look at interesting block in the init-script, there is no difference between the two Knoppix versions.

# findknoppix devices...
findknoppix(){
local dev
for dev in "$@"; do
[ -b "$dev" ] || continue
message -n -e "\r${CRE}${BLUE}${SEARCHINGFOR} $DISTRO in: ${MAGENTA}$dev${NORMAL} "
trymount "$dev" /mnt-system >/dev/null 2>&1 || continue
if [ -r /mnt-system/"$knoppix_dir"/KNOPPIX ]; then
message -e "\r${CRE}${GREEN}$DISTRO ${FOUNDAT}: ${MAGENTA}$dev${NORMAL} "
return 0
fi
umount /mnt-system
done
return 1
}Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
"Build personal Recovery-CD with Knoppix (Knoppix remaster)"

kl522
01-08-2011, 02:32 PM
Can't really comment on it, human eyes are no good to spot changes. You should probably do a 'diff' on it. Furthermore, the function findknoppix() depends on function parameters got passed it, so maybe the changes is outside findknoppix(). In any case my comments are casual and not to be taken seriously. What's important is that imperically, you guys are noticing distinctly different behaviours, for two entirely different versions; whereas since I have never quite used knoppix 6.4.3, so I am more inclined to side the OP.

kl522
01-08-2011, 02:42 PM
Another thing is that knoppix 6.2.1 can't really deal with ext4 file system in the initramfs, so if you have ext4 file system on the harddisk, that is not going to be detected. That might be also the case for knoppix 6.4.3 too.

Werner P. Schulz
01-09-2011, 10:09 AM
... now I've done tests with a ext3-formatted HD and I noticed that really "ext4" was the reason of my error.

With USB-stick mounted as /dev/sda, Knoppix use /KNOPPIX from the stick. If HD mounted as /dev/sda and you boot from USB-stick, then Knoppix use /KNOPPX from ext3-formatted HD.

benny59
01-09-2011, 10:45 PM
Hi you all,
I have been fighting a few days with a variant of the current problem, so I share it with you.

My aim is to boot from ISO the latest Knoppix version. This ISO hold on a usb 320 GB external disk with several partitions.

The only way I managed to boot Knoppix 6.4.3 from this disk (/dev/sdb) was to create a suitable size partition (/dev/sdb8 and then cat KNOPPIX_V6.4.3DVD-2010-21-20-EN.iso > /dev/sdb8

booting with gujin as bootloader it works fine.

However I don't want to waste a partition for KNOPPIX and I'd like to boot it straight from the ISO image.

my USB HDD has FAT (/dev/sdb2) NTFS (/dev/sdb3) ext2 (/dev/sdb6) partitions and I can place the ISO on anyone.

I made some attempts using GRUB2 (I can also boot from grub4dos) but unsuccessfully (basically the iso image is not found and the boot process drops to prompt)

this is grub.cfg entry


menuentry 'KNOPPIX' {
set root='(hd0,7)'
#loopback loop /KNOPPIX_V6.4.3DVD-2010-12-20-EN.iso
linux (hd0,6)/boot/isolinux/linux desktop=gnome bootfrom=/dev/sda7/boot/isolinux/*.iso config=scan home=scan ramdisk_size=100000 init=/etc/init lang=it vt.default_utf8=0 apm=power-off BOOT_IMAGE=KNOPPIX
video=vga16fboff nomce loglevel=1 tz=localtime
initrd (hd0,6)/boot/isolinux/minirt.gz
}
you can see I extracted linux and minirt.gz from the ISO and placed on /boot/isolinux in order to fire it

Anyone can help me ?

Thanks in advance
benny

kl522
01-10-2011, 04:37 AM
Technically interesting but it's academic. I don't see any reason why you should install it that way - except just to challenge your ownself. What's the difference if you install the usual way by copying the KNOPPIX directory ?

benny59
01-10-2011, 03:36 PM
Thanks for your answer. The reason is not acadamic, but simply I don't manage to make it working.

maybe it is because of the complex environment (Gujin on MBR and additional chained bootloaders) or my pc bios which does not show the USB disk mapping.

I do manage to boot KNOPPIX if it is on the local disk by adding this entry to 40_custom


menuentry "KNOPPIX LXDE" {
set root=(hd0,2)
linux /KNOPPIX/linux boot=/dev/sda2/KNOPPIX/KNOPPIX ramdisk_size=100000 lang=it vt.default_utf8=0 nohome apm=power-off vga=normal norandr xmodule=vga nomce loglevel=1 tz=Europe/Rome
initrd /KNOPPIX/minirt.gz
}


but on the USB disk it does not work.

benny59
01-10-2011, 06:20 PM
<span style="background-color: #99FF99;">Thanks kl522,

that's not academic as I cannot boot KNOPPIX on my USB driver with the described tecnique. I wish I could.
Actually I can succeed copying KNOPPIX, linux and minirt.gz on a NTFS partition of my INTERNAL DISK the three files are fired with this 40_custom grub2 entry:


menuentry "KNOPPIX LXDE" {
set root=(hd0,2)
linux /KNOPPIX/linux boot=/dev/sda2/KNOPPIX/KNOPPIX ramdisk_size=100000 lang=it vt.default_utf8=0 nohome apm=power-off vga=normal norandr xmodule=vga nomce loglevel=1 tz=Europe/Rome
initrd /KNOPPIX/minirt.gz
}

no success on USB drive instead.</span>

benny59
01-10-2011, 09:22 PM
kl522, I followed your criticism and I moved the same working configuration from the internal HDD to the USB drive to the NTFS partition (the former was ext2) and I can boot KNOPPIX finally.

If I add the cheatcode desktop=kde I get the following error: "Call to lnusertemp failed (temporary directories full ?) Check your installation"

can you suggest a working set of cheatcodes for kde ? gnome and lxde work fine.

thanks again
benny

kl522
01-11-2011, 06:55 AM
Sorry can't really answer your desktop problem as I don't use kde. I only use lxde, that also I am half cooked as far as the knowledge of desktop is concerned.

However I do want to highlight that as far as I know KNOPPIX has a serious shutdown problem, especially NTFS, based on my knowledge of knoppix 6.2.1/6.3. I believe it's the same for knoppix 6.4.3. I did do some post here but unfortunately nobody seems to be thinking the same as me. But there again, this is just my personal view, others may feel differently.

benny59
01-11-2011, 07:59 AM
I like LXDE and GNOME less KDE, but I cannot live with an issue without knowing the root cause and maybe the solution. In this case I feel positive to boot native KDE to try k* applications like kmail and discover them. I also like such a distribution which is comprehensive of several desktop environments you can choose and so full of applications.
I'd like also to use the same persistency I use for ubuntu based distributions: I have a partition called home-rw which is mounted as \home. Do you think it is possible also for KNOPPIX something like home=/dev/sdb8/KNOPPIX ? (I read some warnings on it and I am afraid to destroy the content)
shutdonwn is OK for me

regards
benny