{"id":2348,"date":"2016-06-29T19:24:15","date_gmt":"2016-06-29T07:24:15","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=2348"},"modified":"2023-05-28T19:57:12","modified_gmt":"2023-05-28T07:57:12","slug":"wipe-a-raid-disk","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=2348","title":{"rendered":"Wipe a RAID disk"},"content":{"rendered":"<p>If for some reason you have a disk which used to be in a software RAID and you need to add it back into OMV then OMV will still recognize it as a RAID disk, even if you have reformatted it.<\/p>\n<p>In my case I had a disk that was removed from the array for a while and then inserted back &#8211; the disk itself was not faulty. In this case I actually saw two arrays under RAID management:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2349\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/06\/OMVmirrorsetup05.jpg\" alt=\"MOV duplicate arrays\" width=\"500\" height=\"103\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/06\/OMVmirrorsetup05.jpg 500w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/06\/OMVmirrorsetup05-150x31.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/06\/OMVmirrorsetup05-300x62.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p>OMV allows you to wipe a disk by going to &#8220;Storage | Physical Disks&#8221;, selecting the disk concerned and then clicking on &#8220;wipe&#8221;. If you have the above scenario this doesn&#8217;t work until you remove any shares and then file system and so on. So we need another way to do this.<\/p>\n<p>The best way I found is to shutdown the PC and remove\/unplug all disks except for the one you need to wipe, just so you don&#8217;t accidentally wipe the wrong thing. Then boot from a Debian live USB key &#8211; see <a  href=\"http:\/\/www.zoyinc.com\/?p=2353\">Create a Debian Live USB flashdrive<\/a>.<\/p>\n<p>Once you have booted into Debian live run:<\/p>\n<pre class=\"crayon:false;\">lsblk<\/pre>\n<p>This should return something like:<\/p>\n<pre class=\"crayon:false;\">NAME\u00a0\u00a0 MAJ:MIN RM\u00a0 SIZE RO TYPE MOUNTPOINT\nsda\u00a0\u00a0\u00a0\u00a0\u00a0 8:0\u00a0\u00a0\u00a0 0 74.5G\u00a0 0 disk\nsdb\u00a0\u00a0\u00a0\u00a0\u00a0 8:16\u00a0\u00a0 1\u00a0 7.5G\u00a0 0 disk\n\u2514\u2500sdb1\u00a0\u00a0 8:17\u00a0\u00a0 1\u00a0 1.2G\u00a0 0 part \/lib\/live\/mount\/medium\nloop0\u00a0\u00a0\u00a0 7:0\u00a0\u00a0\u00a0 0\u00a0 1.1G\u00a0 1 loop \/lib\/live\/mount\/rootfs\/filesystem.squashfs<\/pre>\n<p>You can see the USB key is showing up as &#8220;sdb1&#8221; which means the one to wipe is &#8220;sda&#8221;.<\/p>\n<p>I would suggest you first run &#8220;sgdisk&#8221;:<\/p>\n<pre class=\"crayon:false;\">sgdisk --zap \/dev\/sda<\/pre>\n<p>This will return:<\/p>\n<pre class=\"crayon:false;\">Creating new GPT entries.\n GPT data structures destroyed! You may now partition the disk using fdisk or\n other utilities.<\/pre>\n<p>Just to be safe you can also run:<\/p>\n<pre class=\"crayon:false;\">gdisk \/dev\/sda\n\nThis will ask \"Command (? for help)\", to which <strong>you should enter \"x\"<\/strong> to go to expert mode. You should then enter \"z\" as the expert command. At the end you will be asked about \"Blank out MBR? (Y\/N)\" to which you should enter \"y\". This sequence would look like:\n\n<\/pre>\n<pre class=\"crayon:false;\">GPT fdisk (gdisk) version 0.8.10\n\nPartition table scan:\nMBR: not present\nBSD: not present\nAPM: not present\nGPT: not present\n\nCreating new GPT entries.\n\nCommand (? for help): x\n\nExpert command (? for help): z\nAbout to wipe out GPT on \/dev\/sda. Proceed? (Y\/N): y\nGPT data structures destroyed! You may now partition the disk using fdisk or\nother utilities.\nBlank out MBR? (Y\/N): y<\/pre>\n<p>Then you can reboot back into OMV and go to &#8220;Storage | Physical Disks&#8221; menu to select the disk and then click on wipe.<\/p>\n<h2>Wipe the entire disk<\/h2>\n<p>This was the first thing I tried and the method usually suggested is:<\/p>\n<pre class=\"crayon:false;\">dd if=\/dev\/zero of=\/dev\/sda<\/pre>\n<p>But this zeros the entire drive and will take a very long time.<\/p>\n<h2>Where is the RAID metadata<\/h2>\n<p>Unlike the MBR the RAID metadata is not necessarily stored at the start of the disk in fact it is often stored at the end of the disk. This can make it challenging to remove.<\/p>\n<p>Apparently it can be:<\/p>\n<ul>\n<li>At the end<\/li>\n<li>At the beginning<\/li>\n<li>4k from the beginning<\/li>\n<\/ul>\n<h2>This is not a secure wipe<\/h2>\n<p>Just remember we are only wiping the disk enough to add into OMV, though you won&#8217;t see anything on the disk this is in no way a secure wipe. If you want that there are lots of methods you can use, just not this one.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If for some reason you have a disk which used to be in a software RAID and you need to add it back into OMV then OMV will still recognize it as a RAID disk, even if you have reformatted it. In my case I had a disk that was removed from the array for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[312,4,313],"tags":[318,323,324,322,7,319,320,326,321],"class_list":["post-2348","post","type-post","status-publish","format-standard","hentry","category-debian","category-linux","category-open-media-vault","tag-debian","tag-disk","tag-drive","tag-erase","tag-hdd","tag-omv","tag-open-media-vault","tag-raid","tag-wipe"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2348"}],"version-history":[{"count":8,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2348\/revisions"}],"predecessor-version":[{"id":5264,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2348\/revisions\/5264"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2348"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}