Command Line Basics: List Hard Drives By UUID
Recent versions of Linux use a unique identifier for hard drives in order to make sure they get mounted to the same location all the time. If you've looked into your /etc/fstab file for auto mounting drives, then you're probably already familiar with the long character strings that are used for UUID's.
The question is, how do I find out the UUID for each drive on my computer? Well, there's more than one way to do this, but the simplest is probably the blkid command.
This will list all of the drives on your system. If you're only interested in finding the UUID of a particular drive partition, then just enter that partition device after the command. For example, to find the UUID of partition 3 on drive "a" enter:
Edit: Based on Stefan's comment below, your system may behave differently. You may have to invoke the command like this:
This can be useful if you've added a drive to your system, or you've modified the partitions on an existing drive and you want to make appropriate changes to the /etc/fstab file.