View previous topic :: View next topic |
Author |
Message |
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Sun Jul 27, 2008 7:57 am Post subject: Can't boot because the harddrive naming keeps changing |
|
|
Ok, this is really driving me insane. Sometimes when I boot, the root partition name gets changed. Once it's changed it gets stuck in a loop of changing device names making it impossible to boot. For example before I reboot the root partition was on /dev/sdc2 when I reboot the naming has changed to /dev/sdb2 making it impossible to boot. I adjust fstab and reboot. But the system again fails to boot because this time root is on /dev/sdc2 (ord sdg2, sde2 etc. etc.). I tried using uuid for my harddrive but this didn't working either _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
smerf l33t
Joined: 06 Nov 2004 Posts: 778 Location: Polska
|
Posted: Sun Jul 27, 2008 10:06 am Post subject: Re: Can't boot because the harddrive naming keeps changing |
|
|
Aniruddha wrote: | I tried using uuid for my harddrive but this didn't working either |
Why? UUID is also changing? What have you done? _________________ Microsoft is not the answer, Microsoft is the question, the answer is no. |
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Sun Jul 27, 2008 10:11 am Post subject: Re: Can't boot because the harddrive naming keeps changing |
|
|
smerf wrote: | Aniruddha wrote: | I tried using uuid for my harddrive but this didn't working either |
Why? UUID is also changing? What have you done? |
Nothing special, you can read it here:
https://forums.gentoo.org/viewtopic-t-701116-highlight-.html
The only thing I can think of its that I shouldn't use 'vol_id -u' to detect my drives. I am not the only one with this problem though:
danomac wrote: | gsoe wrote: | The UUID part seems solved, but I'm quite puzzled by your changing devicenames. I've tried rebooting mandriva (and Gentoo) a couple of times now with and without a plugged usb-stick. It doesn't affect devicenames. |
I'm not, I've seen the changing device names on my own PC. I've actually had multiple UUIDs even show up for a partition.
I wound up having to alias one controller so this wouldn't happen. It's really frustrating when your /home partition doesn't mount properly.
It's very easy to reproduce. Get a PCI/PCI-e SATA controller. Then plug in a usb drive or two and reboot. Everything gets remapped! Using UUIDs didn't fix it for me as my box (for some odd reason) would get multiple UUID entries for some devices, completely screwing up any mounting.
I would guess the reason for this is the boot ordering of the BIOS. Mine goes from onboard SATA->onboard IDE->USB->IEEE1394->PCI-e slots.
Inserting either a ieee1394 drive or a usb flash drive would get all sorts of random reordering. (My RocketRaid card would be sde, sgh, and sdi depending on what would be plugged in at the time.)
I used udev to alias my rocketraid controller to /dev/hptX so I didn't have to guess which on it is.
I didn't see anything in my BIOS to disable any of these controllers, although I didn't really look very hard. |
_________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
smerf l33t
Joined: 06 Nov 2004 Posts: 778 Location: Polska
|
Posted: Sun Jul 27, 2008 10:36 am Post subject: |
|
|
What is your hardware setup? _________________ Microsoft is not the answer, Microsoft is the question, the answer is no. |
|
Back to top |
|
|
mackerel Apprentice
Joined: 09 Aug 2005 Posts: 167 Location: SC
|
Posted: Sun Jul 27, 2008 11:43 am Post subject: |
|
|
You may be able to set the boot disk order in your bios, according to the mb. I have a removable drive and when it is in, I just have it set to last order so that it does not change my boot. If you run into this immediately and need to bypass and you use grub, just edit it at load. _________________ Mack |
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Wed Jul 30, 2008 4:44 pm Post subject: |
|
|
My bios is ok (I have disabled the option to boot from usb) In regard to my hw setup. I have three sata drives from Samsung. I partially solved this problem by using /dev/disk/by-id/ for my fstab entries. Unfortunately I have problems enabling this feature in grub therefor I have manually guess each boot on which drive my root partition resides (the past three boots it went from sdb2 to sdf2 to sdg2 ) _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
Habbit Apprentice
Joined: 01 Sep 2007 Posts: 237 Location: 3.7137 W, 40.3873 N
|
Posted: Wed Jul 30, 2008 6:49 pm Post subject: |
|
|
From the post in the GRUB-devel list: you tried to boot with this config
Code: | title=Gentoo Linux (2.6.24-gentoo-r8)
root (hd0,1)
kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r8 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=LABEL=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2 udev
initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r8 |
I think you are misunderstanding the "LABEL" part: some filesystems can have labels assigned to them like this:
ext2/3/4: tune2fs -L my_label
reiserfs: reiserfstune --label my_label
(etc)
Once you have set a label for the volume, you can refer to them with /dev/disk/by-label/my_label in Linux, and with LABEL=my_label in the kernel command line. You can do the same with UUIDs if your initrd scripts support them - just replace by-label or LABEL with by-uuid or UUID in the right places. You can get the UUID of a filesystem with "vol_id -u DEVICE". The advantage of this approach is that labels have to be specifically set, but UUIDs are automatically available for most filesystems.
As I said in the GRUB devel list, if this problem also happens in GRUB itself (i.e. you don't know whether the root partition is in hd0, hd1 or hd2), you can use the "find" (GRUB Legacy) or "search" (GRUB2) commands. _________________
Code: | ~ $ objdump -d ./habbit_mind
90 xchg %rax, %rax
EB FD jmp $-3 |
|
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Wed Jul 30, 2008 6:53 pm Post subject: |
|
|
Habbit wrote: | From the post in the GRUB-devel list: you tried to boot with this config
Code: | title=Gentoo Linux (2.6.24-gentoo-r8)
root (hd0,1)
kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r8 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=LABEL=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2 udev
initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r8 |
I think you are misunderstanding the "LABEL" part: some filesystems can have labels assigned to them like this:
ext2/3/4: tune2fs -L my_label
reiserfs: reiserfstune --label my_label
(etc)
Once you have set a label for the volume, you can refer to them with /dev/disk/by-label/my_label in Linux, and with LABEL=my_label in the kernel command line. You can do the same with UUIDs if your initrd scripts support them - just replace by-label or LABEL with by-uuid or UUID in the right places. You can get the UUID of a filesystem with "vol_id -u DEVICE". The advantage of this approach is that labels have to be specifically set, but UUIDs are automatically available for most filesystems.
As I said in the GRUB devel list, if this problem also happens in GRUB itself (i.e. you don't know whether the root partition is in hd0, hd1 or hd2), you can use the "find" (GRUB Legacy) or "search" (GRUB2) commands. |
I tried settings UUID's but strangely enough they kept changing as well. /dev/disk/by-id however works fine. Is there a grub option for /dev/disk/by-id? e.g.
Code: | real_root=ID=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2 udev |
_________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
Habbit Apprentice
Joined: 01 Sep 2007 Posts: 237 Location: 3.7137 W, 40.3873 N
|
Posted: Wed Jul 30, 2008 7:09 pm Post subject: |
|
|
Aniruddha wrote: | I tried settings UUID's but strangely enough they kept changing as well. |
That is extremely strange, since UUIDs are based on the characteristics of the filesystem, not of the disk they reside on. Are you _positively sure_ that the output of "vol_id -u DEVICE" with the same DEVICE (I mean, the same filesystem, even if the /dev/sdXY device path is different) changes between reboots?
Aniruddha wrote: | /dev/disk/by-id however works fine. Is there a grub option for /dev/disk/by-id? e.g.
Code: | real_root=ID=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2 udev |
|
I don't know any such option. By the way, even if it existed, you would write one of:
real_root=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2
or:
real_root=ID=scsi-SATA_SAMSUNG_HD103UJS13PJ1MQ318013-part2 _________________
Code: | ~ $ objdump -d ./habbit_mind
90 xchg %rax, %rax
EB FD jmp $-3 |
|
|
Back to top |
|
|
Cyker Veteran
Joined: 15 Jun 2006 Posts: 1746
|
Posted: Wed Jul 30, 2008 8:23 pm Post subject: |
|
|
This sort of thing is the EXACT reason why I still use the old BLOCK drivers for my IDE drives (so they get fixed at a nice predictable /dev/hdx), and why I greatly fear them being removed.
I really really hate that everything is /dev/sdx now - It is a stupid stupid way to map things and having to rely on udev kludges like UUID and by-label, both of which have caused me problems in the past due to things like the length of the reference names or because they were not even existing at that part of the boot process.
If the kernel e.g. mapped IDE stuff to hdx, SCSI stuff to sdx, sata stuff to stx and usb stuff to usbx instead of *everything* now to sdx, things would be a lot less problematic... |
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Wed Jul 30, 2008 9:10 pm Post subject: |
|
|
@Habbit
I find it also strange that UUID isn't working, although it happens more (see https://forums.gentoo.org/viewtopic-p-5164344.html?sid=65ac008880ace589289c3035a8b0862d#5164344 ). Afaik I have implemented UUID correctly, I've even written a little how-to:
Aniruddha wrote: | UUID can come in handy for those of us who want a fixed entry in fstab for their hard drives and/or removable media. And best off all, it's very easy! Here's how to do it:
1) Make sure you are using an initrd image to boot Gentoo (UUID requires this). if you haven't a initrd image you can create one easily with genkernel:
Code: | genkernel --install --bootloader=grub --menuconfig --disklabel all |
2) Find out your devices unique volume id (substitute /dev/sda with your drive):
3) Replace the /dev/sd* entries in your fstab with UUID= entries. Example fstab entry:
Code: | UUID=f28284cc-e994-4b3c-be52-cb45c427f88f none swap sw 0 0 |
4)Reboot |
https://forums.gentoo.org/viewtopic-t-701116-highlight-.html
@Cyker
I noticed more people have troubles with udev renaming, the problem starrts when you add or remove a hard-drive from your current configuration.
I filed a bugreport here:
https://bugs.gentoo.org/show_bug.cgi?id=233423 _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
danomac l33t
Joined: 06 Nov 2004 Posts: 881 Location: Vancouver, BC
|
Posted: Thu Jul 31, 2008 12:04 am Post subject: |
|
|
Cyker wrote: | This sort of thing is the EXACT reason why I still use the old BLOCK drivers for my IDE drives (so they get fixed at a nice predictable /dev/hdx), and why I greatly fear them being removed. |
I do not have any IDE devices in my PC. They are all SATA devices. This still doesn't explain the renaming. I do not have anything plugged into the one IDE port on my motherboard either.
My motherboard is actually in the process of an RMA due to defective DDR3 slots, but I don't think this has anything to do with udev. Once I get my PC assembled with new parts I will be reinstalling for good measure. I will do some troubleshooting and post in this thread and on the bug above. |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Thu Jul 31, 2008 12:43 am Post subject: |
|
|
Even though UUIDs should not change (unless you reformat a partition), the /dev/sd? devices can and will. The libata kernel driver does not guarantee that the order that the device nodes will be created will be consistent from one boot to the next. As long as you use UUID (or LABEL) in your /etc/fstab, the only place you may have issues with changing /dev/sd? nodes, is with removable devices. The standard answer to that is, "If you are correctly using HAL, you don't need to know the devices..." (which I don't agree with, by the way ) |
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Thu Jul 31, 2008 7:43 pm Post subject: |
|
|
I was checking /etc/conf.d.rc. Maybe this can help with the udev woes?
Code: | # UDEV OPTION:
# Set to "yes" if you want to save /dev to a tarball on shutdown
# and restore it on startup. This is useful if you have a lot of
# custom device nodes that udev does not handle/know about.
RC_DEVICE_TARBALL="no" |
@yabbadabbadont
I am really clueless why by-id does work and UUID doesn't. I suspect something is broken with UUID. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Thu Jul 31, 2008 8:21 pm Post subject: |
|
|
Aniruddha wrote: | @yabbadabbadont
I am really clueless why by-id does work and UUID doesn't. I suspect something is broken with UUID. |
Not that it helps you any, but it works fine for me... |
|
Back to top |
|
|
Habbit Apprentice
Joined: 01 Sep 2007 Posts: 237 Location: 3.7137 W, 40.3873 N
|
Posted: Sat Aug 02, 2008 12:40 pm Post subject: |
|
|
I guess this reply comes a bit too late, but are you sure the UUIDs are malfunctioning? You said your /dev/sdX drives were rotating on each reboot, so of course the output of "vol_id -u /dev/sda1" _will_ change across reboots. What you want to check is whether the output of "vol_id -u /dev/disk/by-id/scsi-1ATA_ST9200420ASG_5TUXGYD8-part1" (with your own device IDs, of course) changes across reboots. _________________
Code: | ~ $ objdump -d ./habbit_mind
90 xchg %rax, %rax
EB FD jmp $-3 |
|
|
Back to top |
|
|
Kasumi_Ninja Veteran
Joined: 18 Feb 2006 Posts: 1825 Location: The Netherlands
|
Posted: Sat Aug 02, 2008 12:55 pm Post subject: |
|
|
Habbit wrote: | I guess this reply comes a bit too late, but are you sure the UUIDs are malfunctioning? You said your /dev/sdX drives were rotating on each reboot, so of course the output of "vol_id -u /dev/sda1" _will_ change across reboots. What you want to check is whether the output of "vol_id -u /dev/disk/by-id/scsi-1ATA_ST9200420ASG_5TUXGYD8-part1" (with your own device IDs, of course) changes across reboots. |
Lol, ok I get your point. Instead of issuing a
Code: | vol_id -u /dev/sdc2 |
I should use
Code: | vol_id -u /dev/disk/by-id/scsi-1ATA_ST9200420ASG_5TUXGYD8-part1 |
I also noticed that /dev/disk/by-id/ didn't change even when my partition names did (I am on sdh2 now ) _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered |
|
Back to top |
|
|
|