[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where do I find the definitive man page for mdadm?



Hello,

On Fri, Nov 12, 2021 at 03:41:15PM -0700, Charles Curley wrote:
> On Fri, 12 Nov 2021 14:12:58 -0500
> Gene Heskett <gheskett@shentel.net> wrote:
> > Despite nuking mdadm.conf, and zeroing the drive with dd, its still 
> > locked and untouchable by gparted. And I cannot rmmod the raid stuff, 
> > its busy. Blanking the third one now with dd a 34 minute job. I'll 
> > reboot again when the 4th drive has been zeroed.
> 
> There is a daemon that maintains the array for you. That has to be shut
> down. So rebooting may be the way to go.

I have found that if trying to work on the underlying block devices
of an mdadm array, the array needs to be stopped first. So:

# mdadm --stop /dev/md0 # or whatever it is called

You may still find that you have intermittent issues with the
underlying device being "in use", as udev will keep trying to
assemble things due to seeing the mdadm metadata on the block devices.

To remove mdadm metadata (and everything else), I find it easiest to
use wipefs:

# wipefs -a /dev/sda1 # or whatever each block device is called

mdadm does detect previous metadata and ask you if you want to
remove it / go ahead, but because of being in a race with udev I do
tend to just do a wipefs instead.

Normally I can stop an array and repurpose its underlying devices
without having to reboot. As long as it's all unmounted of course.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: