Results 1 to 7 of 7

Thread: HDD order changing if USB hard drive in use.

  1. #1
    Join Date
    Jun 2011
    Location
    Wollongong, Australia
    Beans
    148
    Distro
    Ubuntu 11.04 Natty Narwhal

    HDD order changing if USB hard drive in use.

    Apologies if this has been posted before but every search I try returns hits on "failing to boot from a USB device".

    I recently dist-upgraded to 11.04 from 10.10. Never had any trouble with this in Maverick so trying to figure why it has started happening in Natty.

    During normal operation, my main hard disk is sda, /backup is sdb. If I reboot with an external drive plugged in and turned on, the external becomes sda, sda becomes sdb and sdb becomes sdc.

    When this happens it usually tells me it cant find /home and to hit m to drop to the maintenance shell. When it first happened my reaction was WTF? but then checked out fstab and mtab to see what was going on and saw that the reordering had occurred.

    Anyone else had something like this? Removing the external and restarting fixes the problem, but IMO it shouldn't be occurring in the first place (same goes for Natty's bluetooth regression - I mean, I had these problems back in 8.10, but they had been fixed - until 11.04...)

    I'll try to reproduce to get a more definite picture, (at work at the moment so will kill it again when I get home) as i'm sure / mounts but /home doesn't and they're on the same device.
    Never judge somebody before walking a mile in their shoes.
    That way, if they get angry, you'll be a mile away and have their shoes.

    If they have a different shoe size - judge away...

  2. #2
    Join Date
    Apr 2007
    Beans
    2,578
    Distro
    Ubuntu

    Re: HDD order changing if USB hard drive in use.

    The possibility of change of device name in modern hardware is the reason that today, UUIDs are used to reference partitions. Replace the device names in your /etc/fstab by UUID references.

  3. #3
    Join Date
    Nov 2005
    Location
    Uppsala, Sweden
    Beans
    2,181
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: HDD order changing if USB hard drive in use.

    Quote Originally Posted by pjd99 View Post
    Apologies if this has been posted before but every search I try returns hits on "failing to boot from a USB device".

    I recently dist-upgraded to 11.04 from 10.10. Never had any trouble with this in Maverick so trying to figure why it has started happening in Natty.

    During normal operation, my main hard disk is sda, /backup is sdb. If I reboot with an external drive plugged in and turned on, the external becomes sda, sda becomes sdb and sdb becomes sdc.

    When this happens it usually tells me it cant find /home and to hit m to drop to the maintenance shell. When it first happened my reaction was WTF? but then checked out fstab and mtab to see what was going on and saw that the reordering had occurred.

    Anyone else had something like this? Removing the external and restarting fixes the problem, but IMO it shouldn't be occurring in the first place (same goes for Natty's bluetooth regression - I mean, I had these problems back in 8.10, but they had been fixed - until 11.04...)

    I'll try to reproduce to get a more definite picture, (at work at the moment so will kill it again when I get home) as i'm sure / mounts but /home doesn't and they're on the same device.
    Ubuntu has used UUID's instead of device nodes (/dev/sdXY) for years for this exact reason. Unless the device nodes are specifically hard-coded into the boot sequence, they often change between boots, particularly (in my experience) if you have several disk controllers on your motherboard, or if you sometimes boot with external disks connected.
    See my old post from 2007 or another from 2008 for how to solve it...
    Last edited by jocko; June 24th, 2011 at 07:59 AM.

  4. #4
    Join Date
    Jun 2011
    Location
    Wollongong, Australia
    Beans
    148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HDD order changing if USB hard drive in use.

    Quote Originally Posted by vanadium View Post
    The possibility of change of device name in modern hardware is the reason that today, UUIDs are used to reference partitions. Replace the device names in your /etc/fstab by UUID references.
    This. I just checked fstab and for some reason / and /home weren't referenced by UUID but all other partitions were... I assume it's because when I installed 10.10, I only reformatted / and /home, while the others were resized to make way for a windows 7 partition.

    Cheers for the quick replies (though if i actually spent 10 minutes looking at my system config i'd have sorted it out). Haven't played with the internals of Linux for a few years and remember being thoroughly confused the first time I saw a UUID after the switch...

  5. #5
    Join Date
    Apr 2007
    Beans
    2,578
    Distro
    Ubuntu

    Re: HDD order changing if USB hard drive in use.

    It is actually easy to update. Learn about the UUID of your partitions from the command:

    Code:
    sudo blkid
    You can just copy the relevant 'UUID="<number>" part from the terminal, and paste it over the device name in your /etc/fstab file.

    For example, an output such as
    Code:
    $ sudo blkid
    [sudo] password for vanadium: 
    /dev/sda1: UUID="521cd407-2a4d-4ea8-a8e6-703d2370f2d0" TYPE="ext4"
    would lead you to update the corresponding line in /etc/fstab from
    Code:
    /dev/sda1 /               ext4    errors=remount-ro 0       1
    changes to

    Code:
    UUID=521cd407-2a4d-4ea8-a8e6-703d2370f2d0 /               ext4    errors=remount-ro 0       1

  6. #6
    Join Date
    Jun 2011
    Location
    Wollongong, Australia
    Beans
    148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HDD order changing if USB hard drive in use.

    Quote Originally Posted by vanadium View Post
    It is actually easy to update. Learn about the UUID of your partitions from the command:

    Code:
    sudo blkid
    You can just copy the relevant 'UUID="<number>" part from the terminal, and paste it over the device name in your /etc/fstab file.

    For example, an output such as
    Code:
    $ sudo blkid
    [sudo] password for vanadium: 
    /dev/sda1: UUID="521cd407-2a4d-4ea8-a8e6-703d2370f2d0" TYPE="ext4"
    would lead you to update the corresponding line in /etc/fstab from
    Code:
    /dev/sda1 /               ext4    errors=remount-ro 0       1
    changes to

    Code:
    UUID=521cd407-2a4d-4ea8-a8e6-703d2370f2d0 /               ext4    errors=remount-ro 0       1
    Thanks.

    I remember hating UUID's at first, I had a server where i'd switch out a hard drive on one channel that I wanted mounted in the same location, and it really annoyed me.

  7. #7
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,267
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HDD order changing if USB hard drive in use.

    A way to get around UUID's is to use labels.

    I label every partition (USB sticks and external USB drives included) with a unique label. An extract from my fstab looks like this:

    Code:
    LABEL=paddylinux  /      ext4  errors=remount-ro  0  1
    LABEL=paddyhome   /home  ext4  defaults           0  2
    LABEL=linuxswap   none   swap  sw                 0  0
    It's easier to understand, and will work if my HDD breaks and I restore a clone.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

Tags for this Thread

Bookmarks

Posting Permissions

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