Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: How to fix the hard drive to /dev/sdax ?

  1. #1
    Join Date
    Feb 2009
    Location
    Mont-Saint-Guibert, Belgium
    Posts
    35

    Default How to fix the hard drive to /dev/sdax ?

    Hello,

    I've got a weird bug sinds I've updated to 11.4. On boot, the main hard drive isn't recognized as /dev/sda but it changes from time to time (probably according to other removable medias plugged in or not). It has been sdb, sde... but not sda anymore.

    The trouble is that it boots and then it tries to find /dev/sda2 (the root partition). As it doesn't find it asks me sether he should take "SAMSUNG...whathever...-part2". Answering Yes solves the problem. But then, if I change in Grub the /dev/sde2, it still keeps changing of name. How could I have my hard drive back to /dev/sda2 ?

    Thanks in advance for your help.

    My /etc/fstab:

    Code:
    /dev/disk/by-id/ata-SAMSUNG_SP2004C_S07GJ1UYB03169-part1 swap                 swap       defaults              0 0
    /dev/disk/by-id/ata-SAMSUNG_SP2004C_S07GJ1UYB03169-part2 /                    ext4       acl,user_xattr        1 1
    proc                 /proc                proc       defaults              0 0
    sysfs                /sys                 sysfs      noauto                0 0
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0
    usbfs                /proc/bus/usb        usbfs      noauto                0 0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
    /dev/disk/by-id/ata-SAMSUNG_SP2004C_S07GJ1UYB03169-part3 /home                ext4       defaults              1 2

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,818

    Default Re: How to fix the hard drive to /dev/sdax ?

    You should use the by-id (or by-label, etc.) names. They are there just for this case.
    Thus not only in your fstab, but also in your GRUB menu.lst. openSUSE does this by fefault, thus I do not know why it is different in your system.
    Henk van Velden

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to fix the hard drive to /dev/sdax ?

    On 2011-03-14 22:36, jeancayron wrote:
    >
    > Hello,
    >
    > I've got a weird bug sinds I've updated to 11.4. On boot, the main hard
    > drive isn't recognized as /dev/sda but it changes from time to time
    > (probably according to other removable medias plugged in or not). It has
    > been sdb, sde... but not sda anymore.


    Aha.

    You can not influence those changes, except by controlling what you plug
    in. What we do is not use those names that change.

    Do you, per chance, have both SATA and PATA disks? The mixture causes problems.

    > The trouble is that it boots and then it tries to find /dev/sda2 (the
    > root partition). As it doesn't find it asks me sether he should take
    > "SAMSUNG...whathever...-part2". Answering Yes solves the problem. But
    > then, if I change in Grub the /dev/sde2, it still keeps changing of
    > name. How could I have my hard drive back to /dev/sda2 ?


    Grubs actually knows nothing about sd* names, it uses bios numbers inside,
    and a file to map them.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  4. #4

    Default Re: How to fix the hard drive to /dev/sdax ?

    I would also check my BIOS Advanced to verify that your boot device is defaults to the correct HD.
    As Hvv writes make sure your /boot/grub/menu.lst matches /etc/fstab and both are correct.

    Code:
    ls -al /dev/disk/by-id
    Box 1: OpenSuse 11.1/Win7 | Linux 2.6.27 Gnome | AMD 64 X2 6000+ | nVidia 8600GT | 2GB RAM
    Box 2: OpenSuse 11.2 | Linux 2.6.31 Gnome | AMD 64 3000+ | ATI X800 Pro | 1GB RAM
    Box 3: Win7 Premium Home | Intel P4 3.0Gz | ATI AIW 2006 | 2GB RAM

  5. #5

    Default Re: How to fix the hard drive to /dev/sdax ?

    Quote Originally Posted by jeancayron View Post
    Hello,
    I've got a weird bug sinds I've updated to 11.4. On boot, the main hard drive isn't recognized as /dev/sda but it changes from time to time (probably according to other removable medias plugged in or not). It has been sdb, sde... but not sda anymore.
    It does change from time to time. But it should not bother you if you do not use device names (in /etc/fstab, /boot/grub/menu.lst and anywhere).
    Here's the last interesting discussion we had on that topic: OpenSuse 11.4 Hard drive order?

    Notice that you might have some influence of the names by loading the modules in a different order an rebuilding the ramdisk, as suggested at the end of this thread. I couldn't test it though.

  6. #6
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: How to fix the hard drive to /dev/sdax ?

    Very nice command there tararpharazon

    Code:
    ls -al /dev/disk/by-id
    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,818

    Default Re: How to fix the hard drive to /dev/sdax ?

    While we are at it, let us go back to the basics: SDB:Basics of partitions, filesystems, mount points - openSUSE.
    Henk van Velden

  8. #8

    Default Re: How to fix the hard drive to /dev/sdax ?

    I wish they would explain why openSUSE defaults to the /dev/disk/by-id method while most others mount by UUID (not to be confused with /dev/disk/by-uuid). Those links are generated by udev at boot time, while UUIDs are written in partition superblocks and cached in /dev/.blkid.cache (under openSUSE). Also a comparison of /etc/blkid.conf between openSUSE and Ubuntu is kind of interesting ... and might help explain a couple things.

    openSUSE has:

    Code:
    # never try to sequentially scan all devices in /dev
    EVALUATE=udev
    while Ubuntu has:

    Code:
    # Perform simple UUID and LABEL lookups using udev information first, 
    # fall back to scanning if not found
    EVALUATE=udev,scan
    Ubuntu also has:

    Code:
    # Send a change uevent if we discover that a symlink is wrong
    SEND_UEVENT=yes
    Whether you mount by-id or by-uuid will behave differently depending on what you are doing. uuids won't mount if they are duplicated (like if you copy a partition with dd and mount both the copy and the original) but will stay consistent if you add/remove partitions. by-id will be a mess if partitions change but don't pose a problem when you duplicate disks. by-id and by-uuid are both symlinks and can go missing or wrong indeed - if you play back and forth with partitions.

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to fix the hard drive to /dev/sdax ?

    On 2011-03-15 12:06, please try again wrote:
    > I wish they would explain why openSUSE defaults to the /dev/disk/by-id
    > method while most others mount by UUID (not to be confused with
    > /dev/disk/by-uuid).


    I fail to see how you can mount without using the symlinks. I don't see the
    difference you mention.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,818

    Default Re: How to fix the hard drive to /dev/sdax ?

    I think he means the -U (and -L) options of the mount command (see man mount) and their equivalent in /etc/fstab using UUID= (or LABEL=) as described in man fstab.
    Henk van Velden

Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •