Identify a hard drive serial number in Linux Ubuntu 14.04

It is very important to accurately identify a hard drive before you erase the drive or prepare the drive for encryption by writing random data over the whole drive. If you choose the wrong drive, you can loose all your data from that drive. Below are some commands to indentify your drives. I am using linux Ubuntu 14.04. All commands are entered from the terminal. Terminal code will look like this sentence.

  • For the drive you are about to erase, find the serial number on the drive and record the last 5 digits (you do not need to write down the whole serial number and you will save time).
    • Here are instructions for Western Digital drives. Other manufactures are similar.
    • from http://wdc.custhelp.com/app/answers/detail/a_id/249/~/how-to-find-the-serial-number-of-a-wd-drive-or-product

      The serial number is located on the label on the back or side of the drive. Please note that the location will vary according to the drive. It is usually proceeded by a S/N: or SN:. If the serial number is unable to be read, many customers have taken digital pictures of the label and enlarged it on their computer to make it easier to read.

    • Here are google images of serial number numbers on hard drives if you are still unsure.
    • show serial number in software
      • List all physical devices with “blockid” command
        • sudo blkid
          • output is
          • /dev/sdb: UUID=”2628745a-0db3-48c7-b582-5a3ddf7e7c70″ TYPE=”crypto_LUKS”
          • Remember or copy the uuid. You can identify the device by the UUID (preferred because the UUID doesn’t change) as /dev/disk/by-uuid/2628745a-0db3-48c7-b582-5a3ddf7e7c70
      • show serial number with “hdparm” command
        • you have to change /dev/sdb with what is found on the above blkid command or use UUID
        • Identify disk by UUID
          • sudo hdparm -I /dev/disk/by-uuid/2628745a-0db3-48c7-b582-5a3ddf7e7c70 | grep -e "/dev" -e "Serial Number" -e "device sizewith M = 1000"
        • Identify disk by /dev/sdx
          • sudo hdparm -I /dev/sdb | grep -e "/dev" -e "Serial Number" -e "device sizewith M = 1000"
        • output below
          • /dev/sdb:
          • Serial Number:      WD-WCC4MKC41F22
          • device size with M = 1000*1000:     2000398 MBytes (2000 GB)
        • verify this serial number matches what is on the outside of the hard drive

Leave a Reply

Your email address will not be published. Required fields are marked *