# [SOLVED] Booting with external drive steals /dev address

## js0n

SOLVED

Thanks jburns

Whenever I boot my computer with my external drives ON, for some reason the kernel chooses to initialize the USB external before the SATA hard drive, causing my internal drive to be addressed as /dev/sdc instead of /dev/sdb which causes my machine not to boot without me having to tell grub the proper device path. Since I'd like to be able to boot regardless of whether it is on or not, I am seeking the help of this community for a solution.

ThanksLast edited by js0n on Fri Dec 07, 2007 1:17 pm; edited 1 time in total

----------

## jcat

How have you configured your kernel, manually or Genkernel?

Can we see your /boot/grub/grub.conf

Cheers,

jcat

----------

## jburns

If you use genkernel to build your kernel.

Build the kernel using the genkernel option "--disklabel"

execute the command 

```
ls -l /dev/disk/by-uuid/
```

 This will give you the UUID numbers for your partitions.

# ls -l /dev/disk/by-uuid/

total 0

lrwxrwxrwx 1 root root 10 Dec  5 17:17 1a07d1ed-8865-4f58-be67-151dfa8a3fe9 -> ../../sda1

lrwxrwxrwx 1 root root 10 Dec  5 17:17 9e1e70b9-ef80-43df-b20e-68d610b1bc21 -> ../../sda3

lrwxrwxrwx 1 root root 10 Dec  5 17:17 b9f45c14-cae5-42b7-89da-40fa5955fb67 -> ../../sda2

Using these numbers modify your /etc/fstab file.  For example

UUID=1a07d1ed-8865-4f58-be67-151dfa8a3fe9       /boot   ext2    defaults                1 2

UUID=b9f45c14-cae5-42b7-89da-40fa5955fb67        none            swap            sw              0 0

UUID=9e1e70b9-ef80-43df-b20e-68d610b1bc21       /       ext3    defaults

Using the UUID number modify /boot/grub/grub.conf kernel line real_root paramter to

real_root=UUID=9e1e70b9-ef80-43df-b20e-68d610b1bc21

You have to use the UUID numbers for your system not the numbers in the examples.

With these modifications it no longer mathers what the /dev/ names are.  If the names change between /dev/hd... and /dev/sd... the only other change that is required is to delete the file /etc/udev/rules.d/70-persistent-cd.rules and reboot to recreate it.

For more info see http://gentoo-wiki.com/HOWTO_Initramfs

----------

## Baarn

*pulls out black magic scroll - resurrects thread*

hey,

i had exact the same problem, i put some new and old harddrives in my computer and every drive-label was messed up. so i plugged in a gentoo-usb-stick to fix fstab and grub ... but after i pulled it out still everything was messed up.

i found this thread, and now, with UUID atleast my fstab works...

but my grub doesn't like the UUID identification, in the stage where grub tries to access the root drive its UUID is 00000000-0000-0000-0000-000000000000 (as for all the other drives).

my dirty workaround was to rename the drive to sdc3 in grub, but with usb in it changes to sdf3  :Wink: 

i don't use genkernel, so how or what do i have to build into my kernel to get this UUID-thing to work with grub aswell?

----------

