{"id":11,"date":"2013-04-10T14:32:58","date_gmt":"2013-04-10T04:32:58","guid":{"rendered":"http:\/\/thewanderingsysadmin.net\/?p=11"},"modified":"2013-04-11T12:50:44","modified_gmt":"2013-04-11T02:50:44","slug":"quick-tip-get-the-uuid-for-a-disk-or-partition","status":"publish","type":"post","link":"https:\/\/thewanderingsysadmin.net\/?p=11","title":{"rendered":"Quick Tip: Get the UUID for a Disk or Partition"},"content":{"rendered":"<p>I was just quickly running up a small linux server to use as a backup server at a remote site, and added a new disk to an existing install.<\/p>\n<p>Since it&#8217;s at a remote site, I don&#8217;t want the chance of it barfing on boot, so I definitely want to specify my partition by UUID.<\/p>\n<p>The <a href=\"http:\/\/en.wikipedia.org\/wiki\/Universally_Unique_Identifier\">UUID<\/a> is used to identify a device, independently from its device name. Especially useful when mounting physical disks, it&#8217;s also useful for LVM volumes, etc.<\/p>\n<p>[showmyads]<\/p>\n<p>There are a few ways to get the UUID, but by far the easiest is to simply do an ls -l in \/dev\/disk\/by-uuid.<\/p>\n<pre>root@backup01:~# ls -l \/dev\/disk\/by-uuid\/\r\ntotal 0\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 16d28c61-49a6-42c0-a392-32f8853c692c -&gt; ..\/..\/sda5\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 200a1573-a5cd-484f-9740-beaf661868b5 -&gt; ..\/..\/sda7\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 70a2da02-1c69-4a6f-9a76-6a2b72add1cc -&gt; ..\/..\/dm-0\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 bf778a70-2777-4683-9d38-60f081bd432a -&gt; ..\/..\/sda1\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 c951126d-2d1b-40fa-83a4-ca7e1c7af11b -&gt; ..\/..\/sda6\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 dc64f458-a4e9-47d3-a11a-eb92c1df760b -&gt; ..\/..\/sda9\r\nlrwxrwxrwx 1 root root 10 Apr 10 14:24 e711e321-0971-423c-b1f5-5f296a3d5f7a -&gt; ..\/..\/sda8<\/pre>\n<p>In my case, I&#8217;m pointing at a LVM Logical Volume, so I can take a guess that I&#8217;m looking for dm-0, but to be sure, I want to check in \/dev\/mapper:<\/p>\n<pre>root@backup01:~# ls -l \/dev\/mapper\/\r\ntotal 0\r\ncrw------- 1 root root 10, 59 Apr 10 14:24 control\r\nlrwxrwxrwx 1 root root 7 Apr 10 14:24 VG1-Vol1 -&gt; ..\/dm-0<\/pre>\n<p>Yep, so to mount that new volume in fstab, I want to add a line like the following:<\/p>\n<pre>UUID=70a2da02-1c69-4a6f-9a76-6a2b72add1cc       \/export ext3    defaults        0       2<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was just quickly running up a small linux server to use as a backup server at a remote site, and added a new disk to an existing install. Since it&#8217;s at a remote site, I don&#8217;t want the chance of it barfing on boot, so I definitely want to specify my partition by UUID. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[9,10,8],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-linux","tag-debian","tag-lvm","tag-uuid"],"_links":{"self":[{"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":9,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=\/wp\/v2\/posts\/11\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thewanderingsysadmin.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}