{"id":297,"date":"2009-06-13T17:48:29","date_gmt":"2009-06-14T00:48:29","guid":{"rendered":"http:\/\/www.kernelcrash.com\/blog\/?p=297"},"modified":"2009-06-13T17:48:29","modified_gmt":"2009-06-14T00:48:29","slug":"removing-an-md-swap-partition","status":"publish","type":"post","link":"https:\/\/www.kernelcrash.com\/blog\/removing-an-md-swap-partition\/2009\/06\/13\/","title":{"rendered":"Removing an md swap partition"},"content":{"rendered":"<p>My core2duo linux box here has been running a software RAID1 swap and root for some time now. Basically \/dev\/md1 is the mirrored swap using the first gig of two drives, and the root partition is \/dev\/md2 using partition 2 on the same drives. It all works quite well.<\/p>\n<p>Recently I was doing some experiments with virtual machines and in an attempt to improve performance I thought I&#8217;d change the RAID1 swap to a RAID0 swap. I thought this should be relatively simple. I had another partition elsewhere that I added in as additional swap first, then removed the \/dev\/md1 swap from the system;<\/p>\n<blockquote>\n<pre>swapoff \/dev\/md1<\/pre>\n<\/blockquote>\n<p>And then tried to shut down and delete the \/dev\/md1 array. This did not work<\/p>\n<blockquote>\n<pre>mdadm --stop \/dev\/md1\r\nDevice or resource busy.<\/pre>\n<\/blockquote>\n<p>Hmmm, I&#8217;ve removed md devices before and I thought this should really work, since the device is no longer used as swap. So off to the google we go. Of course lots of people have similar problems &#8230; and it was interesting that a lot seemed to be related to swap. Per a lot of forum discussions, there are questions and not many answers.<\/p>\n<p>However, I found <a href=\"http:\/\/forums.opensuse.org\/archives\/sf-archives\/archives-install-boot\/336906-unable-delete-sw-raid-volume-using-mdadm.html\">this SUSE forum post<\/a> and it had the answer that worked for me. Basically I had to reboot, edit the grub boot config and added &#8216;noresume&#8217; onto the end of the kernel line. Once it was booted up, I could now stop \/dev\/md1 and remove it. Something to do with software suspend locking the swap device. Crazy. Very un-unixy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My core2duo linux box here has been running a software RAID1 swap and root for some time now. Basically \/dev\/md1 is the mirrored swap using the first gig of two drives, and the root partition is \/dev\/md2 using partition 2 on the same drives. It all works quite well. Recently I was doing some experiments [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":5,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions\/302"}],"wp:attachment":[{"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kernelcrash.com\/blog\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}