{"id":342,"date":"2010-09-30T12:26:02","date_gmt":"2010-09-30T12:26:02","guid":{"rendered":"http:\/\/blog.cyberwizzard.nl\/?p=342"},"modified":"2016-03-17T22:01:44","modified_gmt":"2016-03-17T21:01:44","slug":"determining-the-uuid-of-a-partition","status":"publish","type":"post","link":"https:\/\/blog.cyberwizzard.nl\/?p=342","title":{"rendered":"Determining the UUID of a partition"},"content":{"rendered":"<p>From Wikipedia:<\/p>\n<blockquote><p>A <b>Universally Unique Identifier<\/b> (<b>UUID<\/b>) is an identifier standard used in <a class=\"mw-redirect\" title=\"Software\" href=\"http:\/\/en.wikipedia.org\/wiki\/Software\">software<\/a> construction, standardized by the <a title=\"Open Software Foundation\" href=\"http:\/\/en.wikipedia.org\/wiki\/Open_Software_Foundation\">Open Software Foundation<\/a> (OSF) as part of the <a title=\"Distributed Computing Environment\" href=\"http:\/\/en.wikipedia.org\/wiki\/Distributed_Computing_Environment\">Distributed Computing Environment<\/a> (DCE).<\/p>\n<p>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. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve name conflicts.<\/p><\/blockquote>\n<p>Since CentOS\u00a0(and Ubuntu and others) use the UUID\u00a0of partitions to mount or perform other operations on them, I needed to find the UUID\u00a0of my storage partition. The downside to using UUIDs is obvious:\u00a0I know the device name (\/dev\/sdb1) but I\u00a0have no clue what the UUID\u00a0of the partition is.<\/p>\n<p>The upside is that if I move the drives around, so my <code class=\"not-hl\">\/dev\/sdb1<\/code> becomes <code class=\"not-hl\">\/dev\/sda1<\/code> for example, everything will still work because the identifiers remained unchanged.<\/p>\n<p>Enough talking, I found 3 ways of finding the UUID\u00a0of a drive on Linux. Note that this is not all of them though, just enough for me.<\/p>\n<h2 id=\"post-342-option-1.3A.C2.A0use-.2Fdev\">Option 1:\u00a0Use \/dev <a class=\"heading-link\" href=\"https:\/\/blog.cyberwizzard.nl\/?p=342#option-1.3A.C2.A0use-.2Fdev\" title=\"Link to this section\">&#8734;<\/a><\/h2>\n<p>Since the UUID\u00a0to device mapping needs to be done somewhere for the kernel and system tools, why not use that ourselves?<br \/>\n<code class=\"not-hl\">ls -l \/dev\/disk\/by-uuid<\/code><\/p>\n<h2 id=\"post-342-option-2.3A-use-udev\">Option 2: Use udev <a class=\"heading-link\" href=\"https:\/\/blog.cyberwizzard.nl\/?p=342#option-2.3A-use-udev\" title=\"Link to this section\">&#8734;<\/a><\/h2>\n<p>The <code class=\"not-hl\">vol_id<\/code> program pulls the information from udev and presents it all in a fairly readable form. For some reason, my Ubuntu 10.10 does not have it anymore but possibly others still do.<br \/>\n<code class=\"not-hl\">vol_id \/dev\/sdb1<\/code><\/p>\n<h2 id=\"post-342-option-3.3A-use-blkid\">Option 3: Use blkid <a class=\"heading-link\" href=\"https:\/\/blog.cyberwizzard.nl\/?p=342#option-3.3A-use-blkid\" title=\"Link to this section\">&#8734;<\/a><\/h2>\n<p>The option I tend to use it to use the program called <code class=\"not-hl\">blkid<\/code>. Which as sole purpose (as its name suggests) is to show the block device ID\u00a0of a block device *gasp*.<br \/>\n<code class=\"not-hl\">blkid \/dev\/sdb1<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From Wikipedia: A Universally Unique Identifier (UUID) is an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-linux-gentoolinux"],"views":3551,"_links":{"self":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342"}],"version-history":[{"count":3,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions"}],"predecessor-version":[{"id":527,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions\/527"}],"wp:attachment":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}