LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bootable USB Thumb Drive fails with "ERROR: Failed to mount real root device" (https://www.linuxquestions.org/questions/linux-general-1/bootable-usb-thumb-drive-fails-with-error-failed-to-mount-real-root-device-893017/)

bsquared 07-21-2011 03:04 PM

Bootable USB Thumb Drive fails with "ERROR: Failed to mount real root device"
 
Hello,

I am trying to get Arch on a USB thumb drive and have gotten pretty close.

I have managed to get it booting to USB by LABEL, I get dumped out into the rdinit environment with the message:
Code:

ERROR: Failed to mount real root device
Bailing out, you're on your own. Good luck.

/bin/sh: can't access tty; job control turned off
mount: mounting /dev/disk/by-label/USB-SYSTEM on new_root failed: no such device

But If I list /.../by-label the device is there.
Code:

[RAMFS /]# ls  /dev/disk/by-label/
BOOT  HOME  SWAP  SYSTEM USB-BOOT USB-SWAP  USB-SYSTEM

Also while in initrd environment:
Code:

[RAMFS /]# blkid
/dev/sda1: LABEL="BOOT" UUID="d71a5da8-fbdd-4ab9-ba5a-fa2adcda137b" TYPE="ext2"
/dev/sda2: LABEL="SWAP" UUID="3a437fef-b143-4626-a74c-2332d3a83470" TYPE="swap"
/dev/sda3: LABEL="SYSTEM" UUID="702e29ad-3f8a-4590-9c97-36a4f0b0262b" TYPE="ext4"
/dev/sda4: LABEL="HOME" UUID="2ef17520-7602-4855-acee-331535fdb0c7" TYPE="ext4"
/dev/sdb1: LABEL="USB-BOOT" UUID="3a563c48-850d-410a-afb9-bcd01ed567a5" TYPE="ext2"
/dev/sdb2: LABEL="USB-SWAP" UUID="980f4f7e-24a2-4347-8595-c61d8f72accf" TYPE="swap"
/dev/sdb3: LABEL="USB-SYSTEM" UUID="b6d09c53-aed8-494e-b017-df4c3c66b64b" TYPE="ext2"

lists all partitions, that is USB and hard drive, but attempting to manually mount sdbn (USB partitions) failed.
Code:

[RAMFS /]# mount /dev/sdb3 /new_root
mount: mounting /dev/sdb3 on /new_root failed: no such device

I'm not sure what to do to continue. Suggestions are appreciated.

Regards,
Brian

andrewthomas 07-21-2011 03:18 PM

I have arch installed on a USB-stick and all I did was to install to a single partition and edit the HOOKS in /etc/mkinitcpio.conf to:
Code:

HOOKS="base udev usb autodetect pata scsi sata filesystems usbinput"

/etc/fstab:

Code:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>        <type>    <options>          <dump> <pass>
devpts                /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs    nodev,nosuid        0      0
UUID=7aff43f1-c5ae-4867-b71c-556ff8eb60b4 / ext4 defaults,noatime 0 1

I also installed grub2 to the MBR and ended up with these menuentries:

Code:

menuentry 'Arch Linux, with Linux 3.0.0-rc3' --class archlinux --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 7aff43f1-c5ae-4867-b71c-556ff8eb60b4
        echo        'Loading Linux 3.0.0-rc3 ...'
        linux        /boot/vmlinuz-3.0.0-rc3 root=/dev/disk/by-uuid/7aff43f1-c5ae-4867-b71c-556ff8eb60b4 ro  quiet
        echo        'Loading initial ramdisk ...'
        initrd        /boot/kernel-3.0.0-rc3.img
}
menuentry 'Arch Linux, with Linux vmlinuz26' --class archlinux --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 7aff43f1-c5ae-4867-b71c-556ff8eb60b4
        echo        'Loading Linux vmlinuz26 ...'
        linux        /boot/vmlinuz26 root=/dev/disk/by-uuid/7aff43f1-c5ae-4867-b71c-556ff8eb60b4 ro  quiet
        echo        'Loading initial ramdisk ...'
        initrd        /boot/kernel26.img
}
menuentry 'Arch Linux, with Linux vmlinuz26 Fallback' --class archlinux --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 7aff43f1-c5ae-4867-b71c-556ff8eb60b4
        echo        'Loading Linux vmlinuz26 ...'
        linux        /boot/vmlinuz26 root=/dev/disk/by-uuid/7aff43f1-c5ae-4867-b71c-556ff8eb60b4 ro  quiet
        echo        'Loading initial ramdisk ...'
        initrd        /boot/kernel26-fallback.img
}


bsquared 07-25-2011 02:34 PM

@andrewthomas - thanks for response, Did you install directly to the usb media?

I installed to HD and got my environment setup the way I like and rsync'd to thumb drive. The idea being I can keep my 'SYSTEM' partition synced between thumb drive, laptop and desktop. And use the thumb drive as a rescue disk.

As far as the initrd (mkinitcpio), the setup is mostly like your example, and it works in as much as it boots (grub), finds the ramdisk and the ram disk appears to find the USB device when loading modules. This is where it falls apart.

andrewthomas 07-25-2011 02:39 PM

you could try to give it some more time.

Add rootdelay=25 to your kernel line in grub

Quote:

Originally Posted by bsquared (Post 4424842)
Did you install directly to the usb media?

No, I also copied the files from an installed partition.

bsquared 07-26-2011 10:08 AM

Quote:

Originally Posted by andrewthomas (Post 4424847)
you could try to give it some more time.
Add rootdelay=25 to your kernel line in grub

Presently I have the following parameters on the kernel line.
panic=30 waitusb=2 rootdelay=10 rootwait

I'll try your suggestion and report the results.

bsquared 07-26-2011 10:30 AM

No luck with the rootdelay change. It clearly indicates that the usb device is detected, but reports "no such device" when attempting to mount partition /dev/sda3.

entz 07-26-2011 10:35 AM

Quote:

Originally Posted by bsquared (Post 4425590)
Presently I have the following parameters on the kernel line.
panic=30 waitusb=2 rootdelay=10 rootwait

I'll try your suggestion and report the results.

well rootdelay definitely worked for my usb boot ;)
strangely however you didn't get a kernel panic (which usually what happens when the kernel can't mount the root fs)
it's probably because in your case you've a ramdisk ...

bsquared 08-08-2011 11:16 AM

I rebuilt the kernel26.img file with mkinitcpio and noticed that the resulting is smaller than the original. Could this be the problem?


All times are GMT -5. The time now is 03:19 PM.