{"id":1334,"date":"2017-01-11T18:13:34","date_gmt":"2017-01-11T17:13:34","guid":{"rendered":"https:\/\/elkano.org\/blog\/?p=1334"},"modified":"2017-01-11T18:13:34","modified_gmt":"2017-01-11T17:13:34","slug":"mkfs-xfs-open-devdevice-device-resource-busy","status":"publish","type":"post","link":"https:\/\/elkano.org\/blog\/mkfs-xfs-open-devdevice-device-resource-busy\/","title":{"rendered":"mkfs.xfs: cannot open \/dev\/[device]: Device or resource busy"},"content":{"rendered":"<p>If you hit this error trying to format a partition after you have installed a new disk in your server:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"atomic\">\r\n~# mkfs -t xfs -f -i size=2048 \/dev\/sdav2\r\nmkfs.xfs: cannot open \/dev\/sdav2: Device or resource busy\r\n<\/pre>\n<p>Maybe you have multipath enabled and the new device has been detected.  Run this command to see if multipath has detected it.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"atomic\">\r\n~# multipath -ll \/dev\/sdav\r\n2796a30585a4b6e45 dm-12 ,\r\nsize=2.2T features=&#039;0&#039; hwhandler=&#039;0&#039; wp=rw\r\n|-+- policy=&#039;service-time 0&#039; prio=0 status=active\r\n| `- #:#:#:# sdav 66:48  active undef running\r\n<\/pre>\n<p>then to fix it, remove from multipath:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"atomic\">\r\n~# multipath -f \/dev\/sdav\r\n<\/pre>\n<p>And finally you can format it without any problem:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"atomic\">\r\n~# mkfs -t xfs -f -i size=2048 \/dev\/sdav2\r\nmeta-data=\/dev\/device            isize=2048   agcount=4, agsize=3277258 blks\r\n         =                       sectsz=512   attr=2\r\ndata     =                       bsize=4096   blocks=13109032, imaxpct=25\r\n         =                       sunit=0      swidth=0 blks\r\nnaming   =version 2              bsize=4096   ascii-ci=0\r\nlog      =internal log           bsize=4096   blocks=6400, version=2\r\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\r\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you hit this error trying to format a partition after you have installed a new disk in your server: ~# mkfs -t xfs -f -i size=2048 \/dev\/sdav2 mkfs.xfs: cannot open \/dev\/sdav2: Device or resource busy Maybe you have multipath enabled and the new device has been detected. Run this command to see if multipath [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[156,3],"tags":[121,209,210,208],"_links":{"self":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/1334"}],"collection":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/comments?post=1334"}],"version-history":[{"count":0,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/1334\/revisions"}],"wp:attachment":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/media?parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/categories?post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/tags?post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}