Hard disk that change device every boot - Hardware

This is a discussion on Hard disk that change device every boot - Hardware ; Hi, I have two hard disk on my computer. It happens a strange thing, the hard disk switch between two devices every boot: root@serverone:~# fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = ...

+ Reply to Thread
Results 1 to 17 of 17

Thread: Hard disk that change device every boot

  1. Hard disk that change device every boot

    Hi,
    I have two hard disk on my computer. It happens a strange thing, the
    hard disk switch between two devices every boot:

    root@serverone:~# fdisk -l

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0003bbe6

    Device Boot Start End Blocks Id System
    /dev/sda1 1 60801 488384001 83 Linux

    Disk /dev/sdb: 81.9 GB, 81964302336 bytes
    255 heads, 63 sectors/track, 9964 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xf90df90d

    Device Boot Start End Blocks Id System
    /dev/sdb1 * 1 9682 77770633+ 83 Linux
    /dev/sdb2 9683 9964 2265165 5 Extended
    /dev/sdb5 9683 9964 2265133+ 82 Linux swap /
    Solaris

    root@serverone:~# shutdown -r now


    After the reboot:

    login as:
    Linux serverone 2.6.24-19-server #1 SMP Sat Jul 12 00:40:01 UTC 2008 i686

    Last login: Sun Aug 3 11:49:27 2008 from 192.168.1.2
    serverone:~$ sudo fdisk -l

    Disk /dev/sda: 81.9 GB, 81964302336 bytes
    255 heads, 63 sectors/track, 9964 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xf90df90d

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 9682 77770633+ 83 Linux
    /dev/sda2 9683 9964 2265165 5 Extended
    /dev/sda5 9683 9964 2265133+ 82 Linux swap /
    Solaris

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0003bbe6

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 60801 488384001 83 Linux

    As you can see, sdb has now become the 500GB hard disk.
    The OS is Ubuntu 8.04.

    Any ideas?
    Thanks

  2. Re: Hard disk that change device every boot

    Michele wrote:
    > Hi,
    > I have two hard disk on my computer. It happens a strange thing, the
    > hard disk switch between two devices every boot:
    >
    > As you can see, sdb has now become the 500GB hard disk.
    > The OS is Ubuntu 8.04.


    Bad hardware?
    If you are having IDE hard drives, then it's most likely that you have two
    masters (jumpers on the hard drive), check that and set one to slave.

    Check also your grub settings, so that you son't have something there that
    with one kernel you switch the device names.

    --

    //Aho

  3. Re: Hard disk that change device every boot

    J.O. Aho wrote:

    > Check also your grub settings, so that you son't have something there that
    > with one kernel you switch the device names.


    Yeah. I heard of a something like this happening through grub. I don't know
    what the cause was. I think he switched to lilo to resolve this, but I
    can't remember much about the incident. (I use lilo here.)

    Regards,

    Mark.

    --
    Mark Hobley,
    393 Quinton Road West,
    Quinton, BIRMINGHAM.
    B32 1QE.

  4. Re: Hard disk that change device every boot

    Mark Hobley wrote:
    > J.O. Aho wrote:
    >
    >> Check also your grub settings, so that you son't have something there that
    >> with one kernel you switch the device names.

    >
    > Yeah. I heard of a something like this happening through grub. I don't know
    > what the cause was. I think he switched to lilo to resolve this, but I
    > can't remember much about the incident. (I use lilo here.)


    The only case I ever seen grub to do any swapping is when you have

    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd0,0)

    In the OP:s case you will need to have two entries in the grub, one where you
    swap and one without and that he boots different kernels each time.

    It's more likely that he has selected the wrong jumper setting for his IDE
    hard drives.



    --

    //Aho

  5. Re: Hard disk that change device every boot

    You can use LABELs on partitions for mounting them to the correct places
    even if they swap device name. See e2label, mkswap -L, findfs, and use
    LABEL=yourlabel in fstab instead of the device name.

  6. Re: Hard disk that change device every boot

    kunt ha scritto:
    > You can use LABELs on partitions for mounting them to the correct
    > places even if they swap device name. See e2label, mkswap -L, findfs,
    > and use LABEL=yourlabel in fstab instead of the device name.

    I used the UUID way in the fstab

  7. Re: Hard disk that change device every boot

    "J.O. Aho" writes:

    >Mark Hobley wrote:
    >> J.O. Aho wrote:
    >>
    >>> Check also your grub settings, so that you son't have something there that
    >>> with one kernel you switch the device names.

    >>
    >> Yeah. I heard of a something like this happening through grub. I don't know
    >> what the cause was. I think he switched to lilo to resolve this, but I
    >> can't remember much about the incident. (I use lilo here.)


    >The only case I ever seen grub to do any swapping is when you have


    > map (hd0) (hd1)
    > map (hd1) (hd0)
    > rootnoverify (hd0,0)


    >In the OP:s case you will need to have two entries in the grub, one where you
    >swap and one without and that he boots different kernels each time.


    >It's more likely that he has selected the wrong jumper setting for his IDE
    >hard drives.


    IDE hard drives are hdx. He has sdx. That makes it likely he has SATA
    drivers, not IDE.



    >--


    > //Aho


  8. Re: Hard disk that change device every boot

    On Sun, 03 Aug 2008 16:13:43 +0000, Unruh wrote:

    >>It's more likely that he has selected the wrong jumper setting for his
    >>IDE hard drives.

    >
    > IDE hard drives are hdx. He has sdx. That makes it likely he has SATA
    > drivers, not IDE.


    One can't tell from the info given. Ubuntu has used the newer kernel
    interfaces for a while now, so all disk drives show as /dev/sdX anyway.

  9. Re: Hard disk that change device every boot

    Unruh wrote:
    > "J.O. Aho" writes:


    >> It's more likely that he has selected the wrong jumper setting for his IDE
    >> hard drives.

    >
    > IDE hard drives are hdx. He has sdx. That makes it likely he has SATA
    > drivers, not IDE.


    There are two ways to get a sdXX for an IDE, use the old scsi emulation, this
    has been around since almost the beginning, mainly used for be able to burn
    CDs with an ATA CD-writer. The second way is to use the new PATA drivers,
    which are come to replace the old ATA drivers (hdXX).

    Many distros today uses the PATA drivers instead of the old ATA drivers, which
    makes IDE units to appear as sXXX.


    OT: Please fix your broken news client to strip out footers.


    --

    //Aho

  10. Re: Hard disk that change device every boot

    On Sun, 03 Aug 2008 16:56:23 +0200, kunt wrote:
    > You can use LABELs on partitions for mounting them to the correct places
    > even if they swap device name. See e2label, mkswap -L, findfs, and use
    > LABEL=yourlabel in fstab instead of the device name.


    Labels also help if you had to format and reinstall from backups.
    UUID changes during formatting. :-(

    For some automation of changing from UUID= to LABEL=

    -------8<-------------8<-----cut below this line --------8<-------------8<--
    #!/bin/bash
    #************************************************* **************************
    #*
    #* Script to change UUID=xxxx to LABEL=xyx, usually found in
    #* /etc/fstab and /boot/grub/menu.lst
    #*
    #* findfs is used to read the partition label created with
    #* e2label, mkswap -L, dosfslabel, tune2fs, ntfslabel, ...
    #*
    #* Current labels may be seen with blkid /dev/sd*
    #*
    #* Author: Dave Farrance Original found here
    #* http://groups.google.com/group/alt.o...686da010e24cfc
    #*
    #************************************************* **************************

    [[ $(whoami) != root ]] && echo "Must be root" && exit
    [[ $# -ne 1 ]] && echo "Error, incorrect arguments, Usage: $0 /some/filename_here" && exit
    _ifn="$1"
    _ofn="${_ifn}.new"
    [[ ! -r "$_ifn" ]] && echo "Can't read $_ifn" && exit
    cp /dev/null "$_ofn"
    while read line; do
    if [[ "$line" == *UUID=* ]]; then
    uuid1=${line#*UUID=}
    uuid=${uuid1%%[[:blank:]]*}
    dev=$(findfs UUID="$uuid")
    label=$(vol_id -l "$dev")
    [[ -n "$label" ]] && line=${line//UUID=$uuid/LABEL=$label}
    fi
    echo $line >> "$_ofn"
    done < "$_ifn"

    echo "Output is in $_ofn"
    #**************** end script **************************************


  11. Re: Hard disk that change device every boot

    Unruh ha scritto:
    >
    >
    > IDE hard drives are hdx. He has sdx. That makes it likely he has SATA
    > drivers, not IDE.
    >


    Yeah the 80GB one is EIDE, the 500GB is SATA

  12. Re: Hard disk that change device every boot

    On 2008-08-03, Mark Madsen hit the keyboard and wrote:
    > On Sun, 03 Aug 2008 16:13:43 +0000, Unruh wrote:
    >
    >>>It's more likely that he has selected the wrong jumper setting for his
    >>>IDE hard drives.

    >>
    >> IDE hard drives are hdx. He has sdx. That makes it likely he has SATA
    >> drivers, not IDE.

    >
    > One can't tell from the info given. Ubuntu has used the newer kernel
    > interfaces for a while now, so all disk drives show as /dev/sdX anyway.


    really?


    /dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
    /dev/hde5 on /hde-test type ext3 (rw,noexec,nosuid,nodev)
    /dev/hdf1 on /home type ext3 (rw)
    /dev/hdg1 on /Data type ext2 (rw)
    securityfs on /sys/kernel/security type securityfs (rw)
    /dev/sdc1 on /USB-devices type vfat (rw,noexec,nosuid,nodev)
    /dev/sdd1 on /extern type ext3 (rw,noexec,nosuid,nodev)

    OK I have to admit, this is with 4 HDD's connected to a
    raid-controller card, those which are connected at the
    HPT370 are all seen as /dev/hXY.



    Dragomir Kollaric
    --
    This signature is licensed under the GPL and may be
    freely distributed as long as a copy of the GPL is included... :-)


  13. Re: Hard disk that change device every boot

    On Sun, 03 Aug 2008 13:09:53 +0200, J.O. Aho rearranged some electrons to
    say:

    > Michele wrote:
    >> Hi,
    >> I have two hard disk on my computer. It happens a strange thing, the
    >> hard disk switch between two devices every boot:
    >>
    >> As you can see, sdb has now become the 500GB hard disk. The OS is
    >> Ubuntu 8.04.

    >
    > Bad hardware?
    > If you are having IDE hard drives, then it's most likely that you have
    > two masters (jumpers on the hard drive), check that and set one to
    > slave.
    >
    > Check also your grub settings, so that you son't have something there
    > that with one kernel you switch the device names.


    I believe that /dev/sdxx implies SATA drives, not IDE
    (which would be /dev/hdxx)

  14. Re: Hard disk that change device every boot

    On Mon, 04 Aug 2008 01:03:56 +0200, david rearranged some electrons to
    say:

    > On Sun, 03 Aug 2008 13:09:53 +0200, J.O. Aho rearranged some electrons
    > to say:
    >
    >> Michele wrote:
    >>> Hi,
    >>> I have two hard disk on my computer. It happens a strange thing, the
    >>> hard disk switch between two devices every boot:
    >>>
    >>> As you can see, sdb has now become the 500GB hard disk. The OS is
    >>> Ubuntu 8.04.

    >>
    >> Bad hardware?
    >> If you are having IDE hard drives, then it's most likely that you have
    >> two masters (jumpers on the hard drive), check that and set one to
    >> slave.
    >>
    >> Check also your grub settings, so that you son't have something there
    >> that with one kernel you switch the device names.

    >
    > I believe that /dev/sdxx implies SATA drives, not IDE (which would be
    > /dev/hdxx)


    never mind, Unbuntu's different.

  15. Re: Hard disk that change device every boot

    ["Followup-To:" nach comp.os.linux.hardware gesetzt.]
    On 2008-08-03, Bit Twister hit the keyboard and wrote:
    > On Sun, 3 Aug 2008 22:30:11 +0200 (CEST), Dragomir Kollaric wrote:
    >> On 2008-08-03, Mark Madsen hit the keyboard and wrote:
    >>> On Sun, 03 Aug 2008 16:13:43 +0000, Unruh wrote:
    >>>
    >>> One can't tell from the info given. Ubuntu has used the newer kernel
    >>> interfaces for a while now, so all disk drives show as /dev/sdX anyway.

    >>
    >> really?

    >
    > Yes.


    I know. :-)

    I have two ATA Drives hooked up to the IDE connector, they
    are seen as /dev/sda /dev/sdb. I could set up one of them
    with a /boot/ partition and then boot all the other OS's I
    have on the other drives.

    What I was getting at is, that if some ATA HDD's (like in my
    case) are connected at a raid-card then they will not always
    be changed to /dev/sdXY but still are seen as /dev/hdXY by
    Ubuntu.

    But I guess anybody using Raid-cards will be able to figure
    this out, took me a couple of hours to get it, when I
    transferred the HDD with a working Ubuntu to the newer PC.
    Editing the grub boot-options didn't help, "file not found"
    errors countless of them. Until I put in a Ubuntu Live CD
    seeing /dev/sda (I don't have SCSI HDD) in dmesg (of course
    hidden by the splash-screen) was the mystery solved..

    Dragomir Kollaric
    --
    This signature is licensed under the GPL and may be
    freely distributed as long as a copy of the GPL is included... :-)


  16. Re: Hard disk that change device every boot

    Dragomir Kollaric wrote:
    > ["Followup-To:" nach comp.os.linux.hardware gesetzt.]
    > On 2008-08-03, Bit Twister hit the keyboard and wrote:
    >> On Sun, 3 Aug 2008 22:30:11 +0200 (CEST), Dragomir Kollaric wrote:
    >>> On 2008-08-03, Mark Madsen hit the keyboard and wrote:
    >>>> On Sun, 03 Aug 2008 16:13:43 +0000, Unruh wrote:
    >>>>
    >>>> One can't tell from the info given. Ubuntu has used the newer kernel
    >>>> interfaces for a while now, so all disk drives show as /dev/sdX anyway.
    >>> really?

    >> Yes.

    >
    > I know. :-)
    >
    > I have two ATA Drives hooked up to the IDE connector, they
    > are seen as /dev/sda /dev/sdb. I could set up one of them
    > with a /boot/ partition and then boot all the other OS's I
    > have on the other drives.
    >
    > What I was getting at is, that if some ATA HDD's (like in my
    > case) are connected at a raid-card then they will not always
    > be changed to /dev/sdXY but still are seen as /dev/hdXY by
    > Ubuntu.


    That depends on the driver, not all IDE-chipsets has a PATA driver, in which
    case the old ATA driver is used instead.


    > But I guess anybody using Raid-cards will be able to figure
    > this out, took me a couple of hours to get it, when I
    > transferred the HDD with a working Ubuntu to the newer PC.


    If you are using an on-board RAID controller as many of todays motherboards
    are chipped with, it can be better to use softraid instead, as you don't gain
    anything with using the main boards raid (you will still be using the CPU for
    raid operations), while softraid gives you more control over things as you
    won't have linux versions of the needed tools for all the on-board raid
    controllers.



    --

    //Aho

  17. Re: Hard disk that change device every boot

    Dragomir Kollaric wrote:
    > ["Followup-To:" nach comp.os.linux.hardware gesetzt.]


    Hate when people makes follow-ups, that destrois the thread, I hope my post
    didn't get spread to too many news servers, did a cancel when I noticed that
    it wasn't in the newsgroup I subscribe to.

    --

    //Aho

+ Reply to Thread