Have a burning urge to discover the UUID’s of your disk partitions? Run Ubuntu or some other Debian based distro like maybe Debian? Well have I got the article for you friend! Here it is, two easy steps to discovering your UUID – and the best part? For two steps I’ll give you two different ways to get that pesky UUID on your screen.
But first, what exactly is a UUID? From Wikipedia we see that a UUID is a Universally Unique Identifier. “The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. Thus, anyone can create a UUID and use it to identify something with reasonable confidence that the identifier will never be unintentionally used by anyone for anything else.”
For a little more trivia: A UUID is a 16-byte (128-bit) number. The number of theoretically possible UUIDs is therefore 216*8 = 2128 = 25616 or about 3.4 × 1038. This means that 1 trillion UUIDs would have to be created every nanosecond for 10 billion years to exhaust the number of UUIDs. That’s a lot of UUIDs.
These unique ID’s are used by Ubuntu to identify your various partitions for the system. So if you do a quick
cat /etc/fstab
You should see at least one, probably two and possibly more UUID’s in there. One for your primary partition and one for your swap partition, plus more if you have any removable devices, other drives or other partitions around. It will look something like UUID=1c9e4ae2-0ddc-4e3c-8758-4cdd6c90407a.
So how do you discover just what partition belongs to which UUID? Open up a terminal session (Applications -> Accessories -> Terminal) and type the following:
blkid
On my system, the output is as follows:
/dev/sda1: UUID=”1c9e4ae2-0ddc-4e3c-8758-4cdd6c90407a” SEC_TYPE=”ext2″ TYPE=”ext3″
/dev/sda5: UUID=”a647ea33-74ee-4123-84bf-7edc32e2e39b” TYPE=”swap”
So sda1 (my primary partition) and sda5 (my swap partition) are identified.
Or, your could type:
ls -l /dev/disk/by-uuid
and see something like this:
lrwxrwxrwx 1 root root 10 2008-01-02 08:26 1c9e4ae2-0ddc-4e3c-8758-4cdd6c90407a -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-01-02 08:26 a647ea33-74ee-4123-84bf-7edc32e2e39b -> ../../sda5
There you can get the UUID and also see who owns the partitions, when they were last touched, their permissions and finally, what they’re called (sda1 and sda5 in this case).
If you’re trying to pin down which UUID is associated with a particular thing, such as your root partition, you can cat /etc/fstab and look for the UUID associated with the mount point “/“.
Technorati Tags: uuid, ubuntu, how to, what drive
Popularity: 30% [?]












October 12th, 2008 at 1:45 am
I had to run ‘sudo blkid’ to get results, thanks for the info.
November 5th, 2008 at 10:22 am
After resizing my swap partition with GParted on Ubuntu 8.10 I had to format it to reflect the new size. Then I found out after reboot that no swap was activated because UUID had changed. I used partition name /dev/sda* in /etc/fstab to correct the problem and was wondering on how to find out the correct UUID to make it the proper way. This article came up first on Google and was of great help. Keep up the good work!
November 23rd, 2008 at 4:59 pm
Q:
How to find your UUID’s for devices in Ubuntu (and other Debian based distros)
A: blkid
how hard was that?
February 15th, 2009 at 7:13 pm
short and sweet great thanks.
March 6th, 2009 at 10:21 am
another way to find uuid is the command:
sudo vol_id -u /dev/hda1
replace hda1 with the partition for which you wish to find the UUID
May 16th, 2009 at 9:42 am
Great stuff – the only small wrinkle was that I had to use sudo blkid as mentioned above. I upgraded a 2-disk RAID0 array to a 4-disk RAID5 array, and this article was the last link in the chain, to let me put the new UUID into /etc/fstab.
August 21st, 2010 at 8:36 am
Helped me a lot. THX.
October 1st, 2010 at 7:09 am
Great to learn a new topic today(UUID).
October 13th, 2010 at 3:58 pm
I have visited Wikipedia and I learned something about UUID.Thanks for the really needed info.
November 4th, 2010 at 11:42 am
“blkid” and “ls -l /dev/disk/by-uuid” also work in Arch Linux (which isn’t based on any distribution).
Thanks for the info. Bookmarked.
November 17th, 2010 at 3:09 am
How to acquisition your UUID’s for accessories in Ubuntu (and added Debian based distros)
December 9th, 2010 at 6:37 am
Thanks for taking the time to share this, I feel strongly about it and love reading more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely useful for me.
January 3rd, 2011 at 4:10 am
I used partition name /dev/sda* in /etc/fstab to correct the problem and was wondering on how to find out the correct UUID to make it the proper way. This article came up first on Google and was of great help. I have visited Wikipedia and I learned something about UUID.Thanks for the really needed info.
March 12th, 2011 at 7:17 am
great site in the world i really enjoy this site
June 18th, 2011 at 3:15 pm
To tell America that becoming a soldier gets enlistees immortal superpowers that will keep them safe in combat.
August 11th, 2011 at 11:21 am
This article came up first on Google and was of great help.
August 12th, 2011 at 12:55 am
I needed to update /etc/fstab to be sure the same devices are mounted at the same mount points in a 5TB system comprised of both internal SATA and external USB hdd’s. This info worked like a charm-school graduate
.
October 4th, 2011 at 7:23 am
thanks for the tips. UUIDs were blocking my path in a ReadyNAS recovery – I didn’t realise they were an Ubuntu concept rather than a Netgear’s.
October 13th, 2011 at 9:17 am
I need to find the UUID for my devices while running Ubuntu 7.10 linux on my box. I found this article very useful ! Posted under Linux (Ubuntu) by robinbajaj on
October 22nd, 2011 at 1:35 pm
interesting question I have. I ran gparted and copied a partition and now both partitions show the same UUID – how will this effect the setup? Its interesting because I made one primary and one logical and when running blkid they show the same UUID.
October 24th, 2011 at 12:25 am
After install Windows 8, I don’t see Ubuntu. Now with the right UUID, I found a light in the road.
Gracias, muy interesante y claro, tu articulo.
Saludos, desde Maguana en Santiago Rodriguez
November 2nd, 2011 at 4:31 pm
I do agree with all of the ideas you’ve introduced to your post. They are very convincing and will certainly work. Nonetheless, the posts are very short for starters. May just you please extend them a bit from next time? Thank you for the post.
November 26th, 2011 at 5:38 pm
Well this is very interesting indeed.Would love to read a little more of this. Great post. Thanks for the heads-up…This blog was very informative and knowledgeable
January 30th, 2012 at 4:11 am
This is such a great knowledge. Thanks for this valuable information. You have a lot of good ideas and concepts and lots of great information and inspirations. Keep on posting.