I have a SATA disk and an IDE disk on my desktop machine, and I've installed Windows 7 in the SATA disk while ArchLinux in the IDE, the grub is installed on the IDE disk.

In ArchLinux /etc/fstab I set the root mount device as /dev/sda2 instead of /dev/sdb2, as detected in ArchLinux setup program.

However, every time I boot from grub into ArchLinux, there will be chances that initrd cannot read from /dev/sda2 since it seems that /dev/sda is the Windows 7 disk instead of the ArchLinux one. But sometimes it works since /dev/sda becomes the ArchLinux one. In other words, whether the ArchLinux disk is /dev/sda or /dev/sdb differs after rebooting.

I'm wondering if it helps to use UUID to choose partition instead of device path. And is there any other solution to this problem?

migrated from serverfault.com Nov 16 '09 at 15:28

This question came from our site for system and network administrators.


Using UUID is always the better option. But that being said your problem comes from you uDev. Some older Sata controllers take a bit of time to spin up and by that time udev has already found the IDE drive and used it as the first drive. Although I do believe this is only from Cold-Boot.

When working with Coreboot I ran into this problem often and the only real solution I every found was the pause the system for a few seconds (My 1TB took anything up the 20secs) to allow the drives to spin up.

Hope it helps in someway!


As Crankyadmin's answer states, identifying a partition by UUID is preferable to using device paths.

Another alternative is to identify by partition label. I prefer this to UUID because it's much more human-readable, but you do need to make sure your partitions use unique labels, and some characters that are otherwise legal in partition labels may be problematic for this use (in particular, spaces may not work well).

You can add labels to your ext(2,3,4) partitions with tune2fs -L <new-label> <device>, or at format time by using the -L <new-label> option with mkfs.ext(2,3). Use labels just like UUIDs in both /etc/fstab and /boot/grub/menu.lst:

# fstab w/ UUID
UUID=3a9a1209-47de-4959-8ba6-9724e4c3eb37  /     ext3    defaults,errors=remount-ro 0 1

# fstab w/ label
LABEL=arch-root      /     ext3    defaults,errors=remount-ro 0 1

# GRUB config w/ UUID
kernel          /boot/vmlinuz-2.6.20-15-generic root=UUID=3a9a1209-47de-4959-8ba6-9724e4c3eb37 ro quiet splash

# GRUB config w/ label
kernel          /boot/vmlinuz-2.6.20-15-generic root=LABEL=arch-root ro quiet splash

I agree with the previous comments about using UUIDs instead of /dev/sdX in your configurations (such as in /etc/fstab). Although this is an old question, I thought I'd share this page I found when dealing with a similar problem today. It seems to be a good reference for how to use UUIDs (or labels, if you prefer those).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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