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.
#
#
#
Thanks, I did not know this command. I usually just used “ls -l /dev/disk/by-uuid/”.
Even though “blkid” works fine, “blkid [device]” does not work (it just does not output anything). Any hints?
#
Yeah, I just learned the command myself. I've used the same ls command in the past.
It's funny. I wrote this post on my netbook running Ubuntu Jaunty and it worked fine. Now on my Karmic desktop I have the same issue. Even blkid did nothing at first until I invoked it with sudo. Maybe the default behavior in Jaunty is different. Try something like:
Take a look at
for usage options.
#
As a point of interest, here's the version info from blkid -v from Ubuntu Jaunty
and from Karmic
This would likely explain the difference in behavior.
#