Home » Questions » Computers [ Ask a new question ]

Automatically distinguish difference between multiple HDDs in linux?

Automatically distinguish difference between multiple HDDs in linux?

I'm running Ubuntu Server 9.10. I have two external USB HDDs. I use them each for different backup reasons. So certain data gets stored on one HDD, and different information gets stored on the other HDD.

Asked by: Guest | Views: 245
Total answers/comments: 2
Guest [Entry]

"Storage device identification can be performed using the UUID of the device. Identification based on /dev/sd* is not reliable.

In ubuntu 9.10 you can use blkid to list the devices' UUID and you can use this command in a script to properly identify a specific HDD since UUID are uniquely assigned to a specific HDD.

You can find more information here, but note that the command vol_id is not available since ubuntu 9.10."
Guest [Entry]

"Just responding to my own question for anyone else's future reference...

I've found that a good method for distinguishing between devices is to just give them labels using e2label.

Also, I can distinguish between devices here

/dev/disk/by-label/

and

/dev/disk/by-uuid"