PDA

View Full Version : Getting Knoppix to boot off a USB Hard Disk



Crenn
03-21-2005, 02:14 PM
I'm currently trying to boot Knoppix off a MP3 Player Hard Disk(hooked upto a computer, people have been asking how the hell I think I'm going to boot Knoppix on a MP3 Player) so that I don't have to use the CD and it is more portable and stronger than a CD, any ideas?

btw, The computers I'm aiming to use this for are school computers, their netowrk is down every 2-3 days and I'm falling behind in work, Knoppix should fix this problem for me....

UnderScore
03-21-2005, 04:37 PM
We will need to know the details of the computer, your USB device and what you have done so far.

Does the PC support USB booting? Only new PCs and/or PCs with up to date BIOSs can boot a USB device. Is the BIOS boot order set to boot off a USB device? What capacity is the USB device? 512MB, 1GB, 2GB? If the device is under 700MB then you will need to remaster knoppix to fit on it. I do not want to discourage you but there is much work for you to do & you have much reading & experimenting to figure it all out.

You may have better luck with linux distros that are designed/smaller/better to boot off USB devices. See Puppy Linux, Feather Linux, Damn Small Linux at http://www.distrowatch.com
I hope this helps.
James

Crenn
03-21-2005, 10:14 PM
I'm not actually fully sure if the computers do support USB booting but I know my 2 year old computer supports it andthat's going to be my test machine. The USB part of the MP3 Player is 20GB, more than enough to runa full version of linux except I wuld like to run Knoppix so that I can use it on multiple computers without having troubles of drivers, drives, etc. I knew that when I started all of this. Sofar I've just copied the files from the CD onto the hard disk, but I need something to initate the Knoppix.

To let you know, it's a 1.8 inch 20GB toshiba hard disk in the MP3 player.

Crenn
03-21-2005, 10:24 PM
I found a site which shows me how to get all of this running, I'll take a look at this later on today as I've got school very soon.

EDIT: Just putting the link here so that I can find it later at school. http://rz-obrian.rz.uni-karlsruhe.de/knoppix-usb/

btw, Love the layout of the forum.

Crenn
03-22-2005, 12:41 AM
Ark, This is going to be harder than I thought, can any one give me advice and do I need to run this in Linux or Knoppix to edit this certain file.

Any help would be apperciated.(btw, I'm not the greatest speller)

Crenn
03-22-2005, 10:51 PM
I'm going to need help please doing this because it's harder than I thought, is there anyone or a tutorial that can help me? I'm still a beginner with Linux but I'm willing to learn as I want to be able to start programming in Linux and then work upto Programming in Windows.

rldleblanc
03-25-2005, 10:03 PM
Crenn, I've been working on this for a week now and finally got it to work on a USB hard drive enclosure. I hope to have this work on my iPod when I get all the bugs worked out. I recommend that you make a full back-up of your mp3 device before doing what I have done. I'm not sure if the iPod or other mp3 players require a boot loader for its own OS, I guess I will find out when I get Knoppix remastered and moved to my iPod (work in progress). Here are the rough steps I took:

1. Find out what device the USB drive is in a standard Knoppix run and create a partition for the Knoppix install. (I am using FAT16 right now and it is 840 MB, just enough for the CD image and a few boot files, could be smaller). Any filesystem that GRUB can read is ok to use (not tested though).
2. Reboot the computer with the USB hard drive attached and the Knoppix CD (you may be able to just copy from the ISO file from Windows or Linux but not tested). Give the following command on the isolinux prompt

knoppix usb2 tohd=/dev/sda1
if your destination partition is not /sda1 then substitue with the actual one. I have not found the bug that prevents the 2.6 kernel from finding the USB drive yet so I've stuck with the 2.4 kernel (next project after the remaster)
3. Wait for the copy to happen then Knoppix will boot off the USB drive and use it as the base.
4. When Knoppix boots open a terminal and issue the following commands

su
mount -o remount,rw /cdrom
cd /cdrom
mkdir boot
grub-install /dev/sda
vi boot/grub/menu.lst
-- in vi add the following lines --
default 0
timeout 0

title knoppix
kernel /linux24 usb2 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet BOOT_IMAGE=knoppix
initrd /minirt24.gz
--save and exit vi--
--if linux24 and minirt24.gz are not in /cdrom then--
cp /mnt/cdrom/linux24 /mnt/cdrom/minirt24.gz .

Reboot the system, take out the CD and it should work. Your milage may vary and will. I tried using syslinux, but DELL computers had problems reading the kernel and initrd image off the disk correctly. I hope this helps you. So far, I've booted my USB drive off four diffrent computers wilthout any problems (other then XFree resolutions not quite right) Be sure your USB boot device is before your internal hard drive.

Good Luck,
Robert

Crenn
03-28-2005, 12:30 AM
Thanks for the information. I need to make it so it is only 1 partition on the drive or the MP3 Player would crash, or so I think. I'll have to work that out at a later time as the computer that boots knoppix currently has no power due to the fact that I need a new extension cord.

rldleblanc
03-30-2005, 04:48 AM
I found out yesterday that the Dell that I have and a few others that I can find on the Internet are not able to boot off an iPod. The BIOS just hangs during the start-up processes. My hopes that using the iPod for a portable hard drive based Knoppix install is not going to work. I may have to invest in one of those pocket drives for the task.

For all the posts in one day, I would have expected to hear some results from the information I posted about what worked for me,

Robert

Crenn
03-31-2005, 02:32 PM
Since my MP3 Player is not a MP3 Player, I shouldn't have a problem. Just to let you know, it's a JNC SSF-M3. It's very nice.

I've yet to burn a new copy of Knoppix, I don't even remember what Knoppix verrsion I have and the computer with the lastest ISO images currently has no power.....

watar
04-01-2005, 09:43 AM
Have tried to follow your guide rldleblanc but I run into a problem that I can't seem to solve (Newbie warning).



noppix@ttyp1[knoppix]$ su
root@ttyp1[knoppix]# mount -o remount,rw /cdrom
root@ttyp1[knoppix]# cd /cdrom
root@ttyp1[cdrom]# mkdir boot
root@ttyp1[cdrom]# grub-install /dev/sda
mkdir: cannot create directory `/boot/grub': Read-only file system
root@ttyp1[cdrom]#


My setup:
Computer is USB bootable
18Gb USB drive with
sda1 ext2 1Gb Knoppix tohd install
sda2 ext2 4Gb Persistant Home
sda3 swap 512Mb
sda4 ntfs 13Gb for WinXP transfers between home and work

Any solutions or ideas would be greatly appreciated (include big pictures since I'm a Knoppix/linux newb ;) )

/watar

rldleblanc
04-01-2005, 04:43 PM
root@ttyp1[cdrom]# grub-install /dev/sda
mkdir: cannot create directory `/boot/grub': Read-only file system
root@ttyp1[cdrom]#


Hmmm, it is not trying to put grub at /dev/sda1/boot/grub. I will need to review the grub part. I had written down thoses steps after I had done a lot of other things to get it to work. I should be able to look into it a little later today. I think it may be:

grub-install --root-directory=/mnt/sda1 /dev/sda
Let me know if that works for you.

Robert

watar
04-01-2005, 11:55 PM
knoppix@ttyp1[knoppix]$ su
root@ttyp1[knoppix]# mount -o remount,rw /cdrom
root@ttyp1[knoppix]# cd /cdrom
root@ttyp1[cdrom]# mkdir boot
root@ttyp1[cdrom]# grub-install --root-directory=/mnt/sda1 /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
/dev/root: Not found or not a block device.
root@ttyp1[cdrom]#

rldleblanc
04-02-2005, 12:39 AM
knoppix@ttyp1[knoppix]$ su
root@ttyp1[knoppix]# mount -o remount,rw /cdrom
root@ttyp1[knoppix]# cd /cdrom
root@ttyp1[cdrom]# mkdir boot
root@ttyp1[cdrom]# grub-install --root-directory=/mnt/sda1 /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
/dev/root: Not found or not a block device.
root@ttyp1[cdrom]#


OK, give this a try, it should work because I just tried it out!

grub-install --root-directory=/cdrom --recheck /dev/sda
That should force the recheck of the drives and get rid of the /dev/root message from not having the filesystem mounted. After the recheck you can redo the grub-install command without the recheck flag (but you shouldn't need to).

Let me know if that works for you.

Robert

Crenn
04-02-2005, 02:41 PM
Ah..... Can you give me step by step instructions on how to do this? I'm a major windows user but I want to learn the linux interface, and this is braille to me.

watar
04-02-2005, 03:31 PM
Ok, latest update



knoppix@ttyp1[knoppix]$ su
root@ttyp1[knoppix]# mount -o remount,rw /cdrom
root@ttyp1[knoppix]# grub-install --root-directory=/cdrom --recheck /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Due to a bug in xfs_freeze, the following command might produce a segmentation
fault when /cdrom/boot/grub is not in an XFS filesystem. This error is harmlessand
can be ignored.
xfs_freeze: specified file ["/cdrom/boot/grub"] is not on an XFS filesystem
Installation finished. No error reported.
This is the contents of the device map /cdrom/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdb
(hd2) /dev/sda
(hd3) /dev/sdb
root@ttyp1[knoppix]#

The probing took almost an hour before it was done but finally it seemed to work as it should.
Next step


vi boot/grub/menu.lst
-- in vi add the following lines --
default 0
timeout 0

title knoppix
kernel /linux24 usb2 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet BOOT_IMAGE=knoppix
initrd /minirt24.gz
--save and exit vi--

Copied linux24 and minirt24.gz to /cdrom
Saved, reboot... GRUB boots ok...
"Sorry can't find KNOPPIX image something something"
Boot from LiveCD, try to find out why it doesn't work.
After many tries/reboots/hysterical breakdowns... my menu.lst looks like this and seems to work as it should


default 0
timeout 0

title knoppix
kernel /linux24 usb2 fromhd=/dev/sda1 ramdisk_size=100000 init=/etc/init lang=se apm=power-off vga=791 nomce quiet home=/dev/sda2 screen=1280x1024
initrd /minirt24.gz


Now for step 2, configuring GRUB to let me choose between Knoppix or native OS on the computer (WinXP) and some other remastering...

Thanks for your help and patience :D
/W

rldleblanc
04-02-2005, 05:21 PM
[/code]
Copied linux24 and minirt24.gz to /cdrom
Saved, reboot... GRUB boots ok...
"Sorry can't find KNOPPIX image something something"
Boot from LiveCD, try to find out why it doesn't work.
After many tries/reboots/hysterical breakdowns... my menu.lst looks like this and seems to work as it should


default 0
timeout 0

title knoppix
kernel /linux24 usb2 fromhd=/dev/sda1 ramdisk_size=100000 init=/etc/init lang=se apm=power-off vga=791 nomce quiet home=/dev/sda2 screen=1280x1024
initrd /minirt24.gz


I'd be careful with the fromhd option if you want your install to be very portable. Some computers like HP seem to always make the drive /dev/sdb. I think since you are using ext2 you can remove the KNOPPIX_IMAGE option and it looks for upper and lower case versions of the KNOPPIX image. As far as the home directory. I haven't looked into that yet, but you would have the same problem. I'm thinking of modifying the script that if it finds a particular file in the root of the filesystem it makes the entire filesystem to be your home directory. If all the computers that you use your USB drive treat it the same, I think youv'e got it nailed. As far as having Grub chain load Winodws, I woudn't worry about that, just disconnect your drive before reboot and when Windows starts booting, plug in your drive. I think your would need a configuration for every Windows computer/partition that you want to boot.

I hope it all helped!

Robert

Crenn
04-03-2005, 12:33 AM
Can you guys help me do this type of stuff? I'm on 2 weeks of holiday so I have enough time now to complete/learn how to do this.

rldleblanc
04-03-2005, 04:28 AM
Can you guys help me do this type of stuff? I'm on 2 weeks of holiday so I have enough time now to complete/learn how to do this.

What exactly are you having problems with? The steps I outlined worked pretty good for watar, minus the grub issue he was having. I need more to go on to help you out.

Robert

Crenn
04-03-2005, 07:06 AM
Let's put it this way. I can't use linux. I can only click and play the games but that's about it. I'm so basic at linux that my sister who knowsbugger all about computer can do more things in linux than me....

rldleblanc
04-03-2005, 08:16 AM
Ok, lets start from the beginning. With you computer set to boot from USB devices before anything else, does your computer go through the BIOS and boot normally. My iPod prevents my computer from finishing the BIOS and so will not boot at all. After we have found out if the mp3 player will allow the Bios to boot, how exactly did you copy the CD over to your player? Do you have a place larger enough that can store an exact copy of your player on a place writeable by linux (ext2, ext3, etc?) I would suggest making an exact copy backup of your player incase something causes the device not to be able to boot itself. I will tell you how to do it if you have the space avaiable. If your player is 30 GB then we need 30GB of space to make the backup. Lets get that far and take it from there.

Robert

watar
04-03-2005, 08:56 AM
I'd be careful with the fromhd option if you want your install to be very portable. Some computers like HP seem to always make the drive /dev/sdb. I think since you are using ext2 you can remove the KNOPPIX_IMAGE option and it looks for upper and lower case versions of the KNOPPIX image. As far as the home directory. I haven't looked into that yet, but you would have the same problem. I'm thinking of modifying the script that if it finds a particular file in the root of the filesystem it makes the entire filesystem to be your home directory. If all the computers that you use your USB drive treat it the same, I think youv'e got it nailed. As far as having Grub chain load Winodws, I woudn't worry about that, just disconnect your drive before reboot and when Windows starts booting, plug in your drive. I think your would need a configuration for every Windows computer/partition that you want to boot.

I hope it all helped!

Robert

Could you give me an example of your menu.lst ? I'm not sure I understand the KNOPPIX_IMAGE part above.

My menu.lst works on the two different computers I use on a daily basis (Shuttle XPC, Dell desktop...) but it would be fun to make it even more compatible with others.

/W

Crenn
04-03-2005, 09:52 AM
Ok, lets start from the beginning. With you computer set to boot from USB devices before anything else, does your computer go through the BIOS and boot normally. My iPod prevents my computer from finishing the BIOS and so will not boot at all. After we have found out if the mp3 player will allow the Bios to boot, how exactly did you copy the CD over to your player? Do you have a place larger enough that can store an exact copy of your player on a place writeable by linux (ext2, ext3, etc?) I would suggest making an exact copy backup of your player incase something causes the device not to be able to boot itself. I will tell you how to do it if you have the space avaiable. If your player is 30 GB then we need 30GB of space to make the backup. Lets get that far and take it from there.

Robert

I can boot from my USB2.0 Hard disk and make it say rude messages. That's not a problem. I downloaded a copy of the ISO image of Knoppix 3.7(I think that's the version) and used DaemonTools(Windows CD Emulator) to emulate the disk. I copied the files from the ISO onto the Hard Disk. I don't want to partition my MP3 Player as I think this will affect the MP3 Player itself. I have currently no space on my hard disks on my desktop but I have enough for about 4GB(capicity taken of the total 18.6GB, even though it's a 20GB model) so I can do that, except I sync the hard drive with my laptop as I also use it to carry school work. I'll be trying to understand as much as possible but can you try to be extensive?

rldleblanc
04-03-2005, 05:25 PM
I am trying to work with you here. I have said nothing about partitioning the mp3 device, I don't know where you keep getting that from. If you don't want to make a back-up of your device, that is your chioce.I will give you this disclaimer

I DO NOT KNOW WHAT WILL HAPPEN AND CAN RENDER YOUR DEVICE USELESS FOR WHAT IT WAS INTENDED.

With the back-up copy (bit for bit duplicate) we have a better chance of recovering the device if something went wrong.

Give me the exact location where the root of the Knoppix CD is on your device. That way I can give you the cheatcodes to run the image off your device. Even though you are a noobie, you may have to change some of the settings to get it to work right. I can not expect all the issues you may have. What does Knoppix say your device is (/dev/sda1)? What "nasty messages" are you getting on boot. Please be specific so that it dosen't take forever to get information.

Robert

Crenn
04-04-2005, 08:37 PM
As long as there is only 1 partition that is set to FAT32(I prefer NTFS but the damn thing won't accept it) then the MP3 Player will function normally. I got that partition "idea" from :


Crenn, I've been working on this for a week now and finally got it to work on a USB hard drive enclosure. I hope to have this work on my iPod when I get all the bugs worked out. I recommend that you make a full back-up of your mp3 device before doing what I have done. I'm not sure if the iPod or other mp3 players require a boot loader for its own OS, I guess I will find out when I get Knoppix remastered and moved to my iPod (work in progress). Here are the rough steps I took:

1. Find out what device the USB drive is in a standard Knoppix run and create a partition for the Knoppix install. (I am using FAT16 right now and it is 840 MB, just enough for the CD image and a few boot files, could be smaller). Any filesystem that GRUB can read is ok to use (not tested though).
2. Reboot the computer with the USB hard drive attached and the Knoppix CD (you may be able to just copy from the ISO file from Windows or Linux but not tested). Give the following command on the isolinux prompt

knoppix usb2 tohd=/dev/sda1
if your destination partition is not /sda1 then substitue with the actual one. I have not found the bug that prevents the 2.6 kernel from finding the USB drive yet so I've stuck with the 2.4 kernel (next project after the remaster)
3. Wait for the copy to happen then Knoppix will boot off the USB drive and use it as the base.
4. When Knoppix boots open a terminal and issue the following commands

su
mount -o remount,rw /cdrom
cd /cdrom
mkdir boot
grub-install /dev/sda
vi boot/grub/menu.lst
-- in vi add the following lines --
default 0
timeout 0

title knoppix
kernel /linux24 usb2 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce quiet BOOT_IMAGE=knoppix
initrd /minirt24.gz
--save and exit vi--
--if linux24 and minirt24.gz are not in /cdrom then--
cp /mnt/cdrom/linux24 /mnt/cdrom/minirt24.gz .

Reboot the system, take out the CD and it should work. Your milage may vary and will. I tried using syslinux, but DELL computers had problems reading the kernel and initrd image off the disk correctly. I hope this helps you. So far, I've booted my USB drive off four diffrent computers wilthout any problems (other then XFree resolutions not quite right) Be sure your USB boot device is before your internal hard drive.

Good Luck,
Robert

I'll start up knoppix up later on in the day as I'm currently working on something else. Since the device syncs with this computer, all data is already backed up. I don't know the location, but since I have 2 computers I'll try them on both to see what I get.

rldleblanc
04-04-2005, 11:02 PM
As long as there is only 1 partition that is set to FAT32(I prefer NTFS but the damn thing won't accept it) then the MP3 Player will function normally. I got that partition "idea" from :

I'll start up knoppix up later on in the day as I'm currently working on something else. Since the device syncs with this computer, all data is already backed up. I don't know the location, but since I have 2 computers I'll try them on both to see what I get.

With keeping the everything on the same partition, you will need to skip some of that parts in the instructions that I gave. For instance you would not want to use the tohd cheat code, you would want to copy the entire CD using Windows and depending on where you put it you will need diffrent cheatcodes. You will have to boot into Knoppix to get the kernels and initrd images and put them on the device before you can boot from it. It is highly recommend that you don't use NTFS since Linux support is still not 100% (it requires a disk check after every Linux write to it). Stick with FAT. I don't think you understand what I mean by the back-up. What you are refering to is the files on the device that you can see when you mount it on Windows. What I am talking about is every bit on the drive (FAT, Boot sector, and even unsed bits) is copied into a single image file using the dd command in Linux. The reason I keep impressing this point is because I don't know if your mp3 player requires the boot sector of the hard drive to load it's own OS. The iPod has a small ~30MB partition that can only be read by the iPod. So if the device is rebooted, it reads from that partition to bring the system online. I don't what it uses to know to start reading there. The only reason your computer knows where to start reading is because a boot loader in the boot sector tells it. If we install Grub into the boot loader of the device and the device depended on it's boot loader to function, guess what, you have a portable hard drive that can no longer play music. If we make an exact copy using the dd command if Grub kills the boot sector, we can connect the device and basically undo the drive so that the prioporty boot loader will be put back in place along with any other files it needed. This is why I consider it very risky to not have that kind of back-up. I hope this clears it up for you.

I need to know the location of the data that you copied from the Knoppix CD to the device (F:\Knoppix cd\, \mnt\sda1\knoppix/ cd\, etc) That way I know the base of the CD data on the device. When open up the CD in Windows and the folder that looks the same on the device is what I need to know. If you copied the CD to the root of the device it would be \mnt\sda1\ or F:\ whatever OS and drive specification you are using.

Robert