LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Booting GNU/Linux from USB (https://www.linuxquestions.org/questions/linux-general-1/booting-gnu-linux-from-usb-731230/)

Phoxis 06-07-2009 06:13 AM

Booting GNU/Linux from USB
 
I have made a USB drive bootable with syslinux and kept some linux distros like dsl, geexbox, puppylinux, and such. I have made a similar multiboot device with CD and it succeeded. When i boot the USB and select an OS, the kernel executes but cannot find the OS files. Like dsl cannot find the cloop file , geexbox cannot load the 2nd stage. I have tried changing the boot parameters to boot from usb (as needed for the corresponding oses).
My question is how can i make an OS bootable from a USB drive (manually with syslinux). What kind of boot parameters i have to use to tell the kernel that the files are in the USB drive. I mean do i need to set the UUID for the USB drive?
Please also let me know, if setting the UUID for the disk will work elsewhere. And if setting UUID will work then how can i get the UUID of the USB drive i am using. i tried ls /dev/disk/by-uuid but i cannot understand which one is the USB drive as a lot of them is shown.

linus72 06-07-2009 06:42 AM

Check it out, post the output of "mount" while the usb is mounted.
Post the output of "dmesg | tail" also and as Root enter "fdisk -l"
and post that too.

Other things to consider: how did you install syslinux, from Windows or Linux?
And for now, let's concentrate on DSL and get it booting, then deal with any others.

And, on what kind of computer are you trying to boot from, it's specs?

david1941 06-07-2009 10:18 AM

"blkid" gives the UUIDs.

Dave

Phoxis 06-08-2009 10:25 AM

i have installed syslinux from fedora 10 i386. My USB is booting fine. I am able to boot most of the distros from USB. DSL and geexbox seems to have some problems. I have checked the linuxrc scripts and found some command line parameters and i think they might work. I will try them soon. I found out that there is a nocd parameter for DSL. If you suggest some proper command line params then it would be good, else i would have to go through a lot of shell scripts.
I understood the UUIDs. But is using a UUID for booting will be portable? There will be a need of changing of UUID if i change the USB (make another one).
Thanks for the reply

linus72 06-08-2009 11:04 AM

So, everything is OK or what?

Phoxis 06-09-2009 08:52 AM

As i told i am having problem booting DSL and GeexBox from USB drive. They boot okay from CD/DVD.
I gor into the init script of GeexBox and i saw that it searches for GEEXBOX (uppercase) directory in the device. But whenever i copy the GEEXBOX dir in the fat32 USB drive it becomes lowercase automatically. renaming doesnot helps (says there is already the directory with the uppercase name). After geexbox drops me into the limited shell, i see that the name is lowercase there.
I think i this might be a problem of geexbox booting. I didnot find any boot parms for geexbox to show the directory. And i think it is not possible without changing the script, because it is defined in the script and no commandline is allowed to override it.

The fromhd boot parameter of dsl didnot work for the usb boot.

I need to boot GeexBox and dsl from usb disk. That is my problem at this moment.

linus72 06-09-2009 09:14 AM

I have had that exact same problem on my usb when playing with DSL in Ubuntu; it would rename DSL to dsl and then I'd have issues.
No idea what causes it?
However; I usually moved (cut/paste) the dsl folder off usb, to my Desktop, Chowned the usb with
"sudo su"
"chown -R bz /media/usb0" where bz is my username and /media/usb0 is where it's mounted.
Then renamed dsl to DSL and moved it back to usb, then all was good.

You may want to try partitioning usb; first partition as ext2, bootable.
2nd partition FAT32 for exchanging files between linux and windows.
Then install grub to usb-it will boot faster and will even boot on pc's that won't boot off usb if you use plop bootmanager cd or floppy. ( http://www.plop.at/en/bootmanager.html )

To install grub to usb is really easy!
1st DIS-CONNECT your hd from motherboard; set bios to boot from usb, if it can.
Use any ubuntu livecd and boot livecd
insert usb once ubuntu desktop loads.
assuming usb already parttioned, etc
make boot/grub folders on usb and copy grub files from cd to usb
"mkdir -p /mnt/usb/boot/grub" (where /mnt/usb" is mountpoint- could be /media/disk or /media/usb0
"cp -a /usr/lib/grub/i386-pc/* /mnt/usb/boot/grub/"
Then use nano to create menu.lst unless you already have one.
"nano /mnt/usb/boot/grub/menu.lst"

Then install grub to usb as if to hd
"sudo su"
"grub"
"root (hd0,0)"
"setup (hd0)"
"quit"
All should be good.
You can use my menu.lst from my site, simply edit out the tinycore entries and put dsl/geexbox entries there.
also edit out menu colors and splashimages unless you download and put into /boot/grub/
( http://multidistro.com/downloads/tc_...c_flavors.html )

NOTE, using grub a dsl syslinux.cfg entry will change-
syslinux.cfg dsl entry

label dsl
kernel /boot/linux24
append initrd=/boot/minirt24.gz quiet restore=hda1 mydsl=hda1 etc etc etc

change to this for grub; put append line at kernel line

title dsl
kernel /boot/linux24 quiet restore=hda1 mydsl=hda1 etc etc etc
initrd /boot/minirt24.gz

Dig?
That may solve your problem-booting geexbox off ext2 it will not re-name it.

Phoxis 06-13-2009 09:20 AM

passing the UUID of the USB drive works for GeexBox. After i went through the linuxrc script, it was clear that it cannot detect drives automatically.

But still DSL doesnot boot from USB, it cannot find the cloop. I have tried loading the USB drivers manually. Does this depend upon the system hardware. I dont think so, at least in my case.

linus72 06-13-2009 09:30 AM

wait here, i'm gonna help, gotta do something...

linus72 06-13-2009 09:32 AM

You still using fat32/syslinux usb?
or grub/ext3?

anyway post either menu.lst or syslinux.cfg?

Phoxis 06-14-2009 06:27 AM

I have a fat32 USB drive and i have used both syslinux and grub to make it bootable. Both of them are working fine.


For syslinux i used
Code:

LABEL dsl
        MENU LABEL Damn Small Linux
        KERNEL /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl/ nomce noapic quiet BOOT_IMAGE=knoppix
        APPEND initrd=/boot/dsl/minirt24.gz


For GRUB i used
Code:

title DSL
        kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 knoppix_dir=dsl/ nomce noapic quiet BOOT_IMAGE=knoppix
        initrd /boot/dsl/minirt24.gz

i have tried the fromhd boot parm. Doesnot work. One thing i should tell, when i boot from the USB drive through virtual machine with the USB drive set as an IDE drive of the virtual machine DSL boots.

linus72 06-14-2009 06:39 AM

I also have issues with DSL "finding itself" sometimes.:)
Two options I use Dog-

1) Put the kernel/initrd in the root of USB, meaning / instead of /boot/dsl/linux24
I've noticed that the kernel/initrd likes to be there...

2) also "knoppix_dir=dsl/", never used the / before.

3) also, you have knoppix_dir=dsl boot_image=knoppix; I always use
knoppix_dir=DSL KNOPPIX_DIR=dsl BOOT_IMAGE=KNOPPIX which works good.

Also, Is your usb partitioned?
if so, how?

Phoxis 06-16-2009 06:14 AM

It is really strange now.
I made the USB bootable with GRUB (fat32), and then booted DSL with it along with the knoppix_dir=dsl (the cheatcodes say to always include the trailing "/", though i have omitted this time), and fromhd boot param, but this time i booted from another computer and after which dsl booted properly, only the mouse was not working.
And the strange thing is the syslinux+fat32 usb which was booting in my computer it says boot error 15 in the other computer.

linus72 06-16-2009 06:47 AM

you using grub for DOS?
did you try putting kernel/initrd in top of usb?
that usually works for me...

maybe try my linuxLiveusb as it's already setup and all you gotta do is put it on usb and reboot, long as syslinux is installed to usb.
LinuxLive-USB 500MB
Has-
DSL-4.4.10
DSL-N-01RC4
Feather-0.7.5
Slitaz-latest "cooking" version
Puppy-4.2
NetbootCD-2.2 Which can Net-install
Ubuntu-6.06-9.04
Debian-stable/testing/unstable
Fedora-7-10 + testing
openSUSE-10.3/11/11.1/+ factory
Mandriva-2008/2009/cooker/current
CentOS-4/5 latest
Slackware-12.1/12.2/current
( http://multidistro.com/downloads/und.../under1gb.html )

more stuff, if you make usb ext3, install grub to usb, it's almost guaranteed to work...

Phoxis 06-18-2009 04:25 AM

Thanks for the link. You are doing a good job. Actually i am working on an article and want to be as flawless as possible. I am avoiding GRUB4DOS. I am sticking with GRUB and SYSLINUX. I think i have solved the issues. Thank you very much linux72 for your support. After i complete the writeup i will post the link here.


All times are GMT -5. The time now is 05:45 AM.