# usb kernel

## kaviazzz

I am trying to install gentoo on a usb flash drive...

First of all i have to mention that i don't use on my system installation genkernel because on boot i was getting the following error

>> Activating mdev

>> Determine root device

the root block is unspecified or not detected 

Please specify a device to boot, or "shell" for a shell..... 

 boot() :: 

but now i figured out that this is because of sata 

but anyway i'm building the kernel on my own now

this time i need this usb flash to be more automated so i need the genkernel

i set up everything but im getting the same error as before so i tried genkernel --menuconfig all

and i added the following to the kernel

  │ │                                                <*> Serial ATA (prod) and Parallel ATA (experimental) drivers  --->                                                    │ │

--- Serial ATA (prod) and Parallel ATA (experimental) drivers                                                          │ │

  │ │                                                <*>   AHCI SATA support                                                                                                │ │

  │ │                                                <*>   ServerWorks Frodo / Apple K2 SATA support                                                                        │ │

  │ │                                                <*>   Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support                                                                   │ │

  │ │                                                <*>   Marvell SATA support (HIGHLY EXPERIMENTAL)                                                                       │ │

  │ │                                                <*>   NVIDIA SATA support                                                                                              │ │

  │ │                                                <*>   Pacific Digital ADMA support                                                                                     │ │

  │ │                                                <*>   Pacific Digital SATA QStor support                                                                               │ │

  │ │                                                <*>   Promise SATA TX2/TX4 support                                                                                     │ │

  │ │                                                <*>   Promise SATA SX4 support                                                                                         │ │

  │ │                                                <*>   Silicon Image SATA support                                                                                       │ │

  │ │                                                <*>   Silicon Image 3124/3132 SATA support                                                                             │ │

  │ │                                                <*>   SiS 964/965/966/180 SATA support                                                                                 │ │

  │ │                                                <*>   ULi Electronics SATA support                                                                                     │ │

  │ │                                                <*>   VIA SATA support                                                                                                                 │ │

  │ │                                                <*>   VITESSE VSC-7174 / INTEL 31244 SATA support                                                                      │ │

  │ │                                                <*>   Initio 162x SATA support (HIGHLY EXPERIMENTAL)                                                                   │ │

after compiling the new kernel this time typing on the filed /dev/sda1

is fiving me this error

Mounting root...... 

 mknod: ?newroot/dev/console: No such file or directory 

 mknod: ?newroot/dev/tty1: No such file or directory 

 Booting (initramfs)..switch_root: Bad console '/dev/console' 

 Kernel panic - not syncing:Attempted to kill init! 

I also found a related topic but not really helps

https://forums.gentoo.org/viewtopic-p-4505480.html#4505480

my usb flash drive is a corsair 8gb

Bus 001 Device 004: ID 090c:1000 Feiya Technology Corp. Memory Bar

i did not seperate the boot directory and my fstab and grub.conf are:

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

#/dev/BOOT              /boot           ext2            noauto,noatime  1 2

/dev/sda1               /               ext2            defaults        1 1

#/dev/SWAP              none            swap            sw              0 0

/dev/cdrom              /mnt/cdrom      audo            noauto,ro       0 0

#/dev/fd0               /mnt/floppy     auto            noauto          0 0

# Splash image to show behind grub.

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

 For booting GNU/Linux

title  Gentoo Pen

root (hd0,0)

kernel /boot/kernel-genkernel-x86-2.6.23-gentoo-r3  root=/dev/ram0 init=/linuxrc ramdisk=8192 realboot=/dev/sda1 udev doscsi

initrd /boot/initramfs-genkernel-x86-2.6.23-gentoo-r3

title  Gentoo Pen

root (hd0,0)

kernel /boot/kernel-genkernel-x86-2.6.23-gentoo-r3 boot=/dev/sda1 init=/linuxrc udev ro

initrd /boot/initramfs-genkernel-x86-2.6.23-gentoo-r3

anyone got any clue ???? thkz in advance

EDIT: added some hardware specs just in case

Gentoobox / # lspci

00:00.0 Memory controller: nVidia Corporation CK804 Memory Controller (rev a3)

00:01.0 ISA bridge: nVidia Corporation CK804 ISA Bridge (rev a3)

00:01.1 SMBus: nVidia Corporation CK804 SMBus (rev a2)

00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2)

00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3)

00:04.0 Multimedia audio controller: nVidia Corporation CK804 AC'97 Audio Controller (rev a2)

00:06.0 IDE interface: nVidia Corporation CK804 IDE (rev f2)

00:07.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev f3)

00:08.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev f3)

00:09.0 PCI bridge: nVidia Corporation CK804 PCI Bridge (rev a2)

00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)

00:0b.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0c.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0d.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:0e.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

01:00.0 VGA compatible controller: ATI Technologies Inc R430 [Radeon X800 (PCIE)]

01:00.1 Display controller: ATI Technologies Inc R430 [Radeon X800] (PCIE) (Secondary)

05:0a.0 RAID bus controller: Silicon Image, Inc. SiI 3114 [SATALink/SATARaid] Serial ATA Controller (rev 02)

05:0b.0 FireWire (IEEE 1394): Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)

05:0c.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)

----------

## NeddySeagoon

kaviazzz,

```
kernel /boot/kernel-genkernel-x86-2.6.23-gentoo-r3 root=/dev/ram0 init=/linuxrc ramdisk=8192 realboot=/dev/sda1 udev doscsi

initrd /boot/initramfs-genkernel-x86-2.6.23-gentoo-r3 
```

looks a little odd for booting from USB. You should really configure your own kernel because you need to know that USB support and USB storage support are available. As they are rarely needed for booting, they may well not be in the initrd.

Oh 

```
realboot=/dev/sda1
```

is that a typo is the post?

real_root is correct.

With you in control this way, the initrd is not needed ad your kernel line becomes 

```
kernel /boot/kernel-genkernel-x86-2.6.23-gentoo-r3 rootdelay=10 root=/dev/sda1 
```

The rootdelay=10 allows 10 seconds for the USB subsystem to get started before the kernel try to mount root. Normally, root is mounted before USB is started, which is a problem if your root is on a USB device. Values between 7 and 30 are reported to work, depending on your system.

For portability, look into using filesystem labels rather than device names. ext2 and ext3 support labels other filesystems may.

You make a label on your filesystem and use that in the root= statement and in /etc/fstab, then when things change /dev nodes, the kernel sorts out the mess.

Do not use ext3 or any journalled fiesystem on a USB FLASH stick.  The journal writes will kill the memory very quickly.

----------

## kaviazzz

Thank you for your post.. i ll change the kernel line now.. is there any guide i can read about making the filesystem labels?? what filesystem should i use for this.. when i started i tried to to it in vfat but then i figured out that on vfat u cannot create links...

EDIT: is that what i need to do ?

http://www.debian-administration.org/articles/522

----------

## kaviazzz

Booting (initramfs)..switch_root: Bad console '/dev/console' 

i still cant boot is there anything else i should post for help ??

----------

## NeddySeagoon

kaviazzz,

That link explains how to use labels for ext2 and ext3. I'm not sure what other filesystems support labels.

On a flash drive, use ext2 not ext3 you do not want a journal.

Build your kernel so you do not need an initrd, at least to start with.

You will need to add extra things to gentoos initrd to mae USB booting work, which is something you can fix when it boots without an initrd.

----------

