{"id":1401,"date":"2013-10-18T19:18:29","date_gmt":"2013-10-18T11:18:29","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=1401"},"modified":"2013-10-18T19:22:34","modified_gmt":"2013-10-18T11:22:34","slug":"ubuntu-13-diskby-id-name-changes-zfs","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2013\/10\/ubuntu-13-diskby-id-name-changes-zfs\/","title":{"rendered":"Ubuntu 13 disk\/by-id name changes (zfs)"},"content":{"rendered":"<p>Looks like Ubuntu 13 has changed the dev id&#8217;s for disks!<br \/>\nIf you use ZFS, like us, then you may be caught by this subtle naughty change.<\/p>\n<p>Previously, disk-id&#8217;s were something like this:<br \/>\nscsi-SATA_ST4000DM000-1CD_Z3000WGF<\/p>\n<p>In Ubuntu 13 this changed:<br \/>\nata-ST4000DM000-1CD168_Z3000WGF<\/p>\n<p>According to the FAQ in ZFS on Linux, this *isn&#8217;t* supposed to change.<\/p>\n<p><a href=\"http:\/\/zfsonlinux.org\/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool\">http:\/\/zfsonlinux.org\/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool<\/a><\/p>\n<p><code>\/dev\/disk\/by-id\/: Best for small pools (less than 10 disks)<br \/>\nSummary: This directory contains disk identifiers with more human readable names. The disk identifier usually consists of the interface type, vendor name, model number, device serial number, and partition number. This approach is more user friendly because it simplifies identifying a specific disk.<br \/>\nBenefits: Nice for small systems with a single disk controller. <strong>Because the names are persistent and guaranteed not to change<\/strong>, it doesn't matter how the disks are attached to the system. You can take them all out, randomly mixed them up on the desk, put them back anywhere in the system and your pool will still be automatically imported correctly.<\/code><\/p>\n<p>So&#8230; on a reboot after upgrading a clients NAS, all the data was missing, with the nefarious pool error.<br \/>\nSee below:<\/p>\n<p><code><br \/>\nroot@hpnas:# zpool status<br \/>\npool: nas<br \/>\nstate: UNAVAIL<br \/>\nstatus: One or more devices could not be used because the label is missing<br \/>\nor invalid. There are insufficient replicas for the pool to continue<br \/>\nfunctioning.<br \/>\naction: Destroy and re-create the pool from<br \/>\na backup source.<br \/>\nsee: http:\/\/zfsonlinux.org\/msg\/ZFS-8000-5E<br \/>\nscan: none requested<br \/>\nconfig:<\/p>\n<p>NAME STATE READ WRITE CKSUM<br \/>\nnas UNAVAIL 0 0 0 insufficient replicas<br \/>\nraidz1-0 UNAVAIL 0 0 0 insufficient replicas<br \/>\nscsi-SATA_ST4000DM000-1CD_Z3000WGF UNAVAIL 0 0 0<br \/>\nscsi-SATA_ST4000DX000-1CL_Z1Z036ST UNAVAIL 0 0 0<br \/>\nscsi-SATA_ST4000DX000-1CL_Z1Z04QDM UNAVAIL 0 0 0<br \/>\nscsi-SATA_ST4000DX000-1CL_Z1Z05B9Y UNAVAIL 0 0 0<br \/>\n<\/code><\/p>\n<p>Don&#8217;t worry, the data&#8217;s still there. Ubuntu has just changed the disk names, so ZFS assumes the disks are broken.<\/p>\n<p>Simple way to fix it is to export the pool, then reimport with the new names.<br \/>\nOur pool is named &#8220;nas&#8221; in the example below:<\/p>\n<p><code>root@hpnas:# zpool export nas<br \/>\nroot@hpnas:# zpool import -d \/dev\/disk\/by-id nas -f<br \/>\n<\/code><\/p>\n<p>As you can see, our pool is now a happy chappy, and our data should be back<\/p>\n<p><code><br \/>\nroot@hpnas:# zfs list<br \/>\nNAME USED AVAIL REFER MOUNTPOINT<br \/>\nnas 5.25T 5.12T 209K \/nas<br \/>\nnas\/storage 5.25T 5.12T 5.25T \/nas\/storage<br \/>\nroot@hpnas:\/dev\/disk\/by-id# zfs list<br \/>\nNAME USED AVAIL REFER MOUNTPOINT<br \/>\nnas 5.25T 5.12T 209K \/nas<br \/>\nnas\/storage 5.25T 5.12T 5.25T \/nas\/storage<br \/>\nroot@hpnas:\/dev\/disk\/by-id# zpool status<br \/>\npool: nas<br \/>\nstate: ONLINE<br \/>\nscan: none requested<br \/>\nconfig:<\/p>\n<p>NAME STATE READ WRITE CKSUM<br \/>\nnas ONLINE 0 0 0<br \/>\nraidz1-0 ONLINE 0 0 0<br \/>\nata-ST4000DM000-1CD168_Z3000WGF ONLINE 0 0 0<br \/>\nata-ST4000DX000-1CL160_Z1Z036ST ONLINE 0 0 0<br \/>\nata-ST4000DX000-1CL160_Z1Z04QDM ONLINE 0 0 0<br \/>\nata-ST4000DX000-1CL160_Z1Z05B9Y ONLINE 0 0 0<\/p>\n<p>errors: No known data errors<br \/>\n<\/code><\/p>\n<p>Bit naughty of Ubuntu to do that imho&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looks like Ubuntu 13 has changed the dev id&#8217;s for disks! If you use ZFS, like us, then you may be caught by this subtle naughty change. Previously, disk-id&#8217;s were something like this: scsi-SATA_ST4000DM000-1CD_Z3000WGF In Ubuntu 13 this changed: ata-ST4000DM000-1CD168_Z3000WGF According to the FAQ in ZFS on Linux, this *isn&#8217;t* supposed to change. http:\/\/zfsonlinux.org\/faq.html#WhatDevNamesShouldIUseWhenCreatingMyPool \/dev\/disk\/by-id\/: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25,4],"tags":[],"class_list":["post-1401","post","type-post","status-publish","format-standard","hentry","category-technical-mumbo-jumbo","category-useful-info"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=1401"}],"version-history":[{"count":3,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1401\/revisions"}],"predecessor-version":[{"id":1404,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1401\/revisions\/1404"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=1401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=1401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=1401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}