Results 1 to 4 of 4

Thread: How to tell which physical disk = which device in mdadm?

  1. #1
    Join Date
    Apr 2005
    Location
    New York, NY
    Beans
    158
    Distro
    Ubuntu 15.10 Wily Werewolf

    How to tell which physical disk = which device in mdadm?

    I have an mdadm-based RAID 5 array, and recently realized that were a given disk to die, I'm not sure I'd be able to identify which physical disk needed to be replaced.

    Is there any way to determine which physical disk corresponds to which device (e.g. /dev/sda), short of unplugging them one at a time?

    Wishing I'd paid better attention when I built the array

  2. #2
    Join Date
    Feb 2005
    Location
    Oregon
    Beans
    496
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to tell which physical disk = which device in mdadm?

    "hdparm -I /dev/sda" should tell you the serial number of sda. Then you'd look for the drive with that serial printed on it. Or if you can't access it to check, you'd check the serials of all the other drives.

  3. #3
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,136
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to tell which physical disk = which device in mdadm?

    If you don't know for sure, one way is to use smartctl to look at the serial #, it will match the serial # on the drive label.
    Code:
    sudo apt-get install smartmontools
    like this...
    Code:
    root@fileserver:~# smartctl -d ata -a /dev/sdb | grep Serial
    Serial Number:    9TE07BS0
    root@fileserver:~# smartctl -d ata -a /dev/sdc | grep Serial
    Serial Number:    WD-WMATV1391142
    Or use sdparm, or hdparm
    Code:
    root@fileserver:~# hdparm -I /dev/sdb | grep Serial | head -n1
    Last edited by rubylaser; May 16th, 2011 at 11:48 PM.

  4. #4
    Join Date
    Apr 2005
    Location
    New York, NY
    Beans
    158
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: How to tell which physical disk = which device in mdadm?

    This is *exactly* what I was looking for. Many thanks!

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
  •