I have installed linux on a usb flash drive. I have also installed grub on it to be able to boot it. However, I am having trouble setting menu.lst file correctly to boot it. This setup:

title  Arch Linux
root   (hd0,0)
kernel /boot/vmlinuz-linux root=/dev/sda1 ro
initrd /boot/initramfs-linux.img

loaded my current system, rather than the system on my usb flash drive. I have also tried this;

title  Arch Linux
root   (hd1,0)
kernel /boot/vmlinuz-linux root=/dev/sdb1 ro
initrd /boot/initramfs-linux.img

which loaded initramfs (edit: I am not sure if it was initrd from my harddrive, or from my usb flash drive), but couldn't find and load root partition. Here is my current disk layout

rootfs         15672636  6811912  8074396   46% /
/dev             638384        0   638384    0% /dev
run              639768      300   639468    1% /run
/dev/sda1      15672636  6811912  8074396   46% /
shm              639768      216   639552    1% /dev/shm
/dev/sda4      50863856 23957848 26906008   48% /home
/dev/sda2      10482364  7557180  2925184   73% /var
/dev/sdb1       7850524   828168  6628580   12% /media/0637815e-9864-4a45-a361-d6c36b3cd3d1

/dev/sdb1 is my usb drive's partition where my linux resides. If it is important, here is my /boot/grub/device.map file

(fd0)     /dev/fd0
(hd0)    /dev/sda
(hd1)    /dev/sdb

I want to set this up so that usb drive doesn't depend in any way to my current system. Any help is appreciated.


When you installed GRUB on your flash drive, you had to input several commands:

sudo grub
grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
grub> quit

The line

grub> device (hd0) /dev/sdb

where /dev/sdb is your flashdrive, should probably help. But you can't issue this command without issuing all the others. So just redo all your setup with the help of these commands.

  • I actually just used grub-install /dev/sdb when I chrooted into flash drive. My flash drive is (hd1,0) when I chroot into it, but I am not sure what to put into menu.lst file. – yasar Mar 31 '12 at 19:12
  • Well, try to do this by hand with sudo grub etc., cause the use case (USB flash drive) is not really typical for grub. And in menu.lst try to use (hd0,0). – Evengard Mar 31 '12 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.