[PLUG] Restart mdadm? SOLVED

John Jason Jordan johnxj at gmx.com
Sun Nov 27 21:57:19 UTC 2022


On Sun, 27 Nov 2022 12:49:54 -0800 (PST)
Rich Shepard <rshepard at appl-ecosys.com> dijo:

>On Sun, 27 Nov 2022, John Jason Jordan wrote:
>
>> I've searched documentation on mdadm and I can't figure out if there
>> is a way to just restart the array. Suggestions?  

>How do I reactivate my MDADM RAID5 array? - Super User You should try
>stopping and re-starting the array: mdadm --stop /dev/md0 mdadm
>--assemble --scan to re-assemble the array and if that doesn't work,
>you may need to update your mdadm.conf, see for example this question
>for details on how to do that. Share Improve this answer Follow edited
>Mar 20, 2017 at 10:17 Community Bot 1
>
>mdadm RAID array stop and restart - Ask Ubuntu https://askubuntu.com>questions › 1398907 › mdadm-raid-array-stop-and-restart Mar 23,
>2022Now to stop the array and restart it , I'm following below steps:
>mdadm --stop device mdadm --create ..... (the same command which I
>used to create the array at first) --- > Is it correct process to stop
>and restart RAID arrays? --- > Should I run "mdadm --zero ..." to
>clear superblock after stopping array ? Is it mandatory step to stop
>array?

Rich, I found that AskUbuntu web page, but I note that the question
received no answers. In any event, stopping the array was a problem:

sudo mdadm --stop /dev/md0
mdadm: Cannot get exclusive access to /dev/md0:Perhaps a running
process, mounted filesystem or active volume group?

The error message is hardly a surprise, since /dev/md0 was mounted -
sudo mount gave me dozens of lines, including: 
/dev/md0p1 on /media/jjj/Movies type ext4

And then sudo umount /dev/md0p1 worked. But when I tried to remount it
I got:
sudo mount -a (it's in fstab)
mount: /media/jjj/Movies: can't read superblock on /dev/md0p1

So then I did 'sudo mdadm --stop /dev/md0,' which returned:
mdadm: stopped /dev/md0

And then I found a page that gave me the final solution:

sudo mdadm -A -s
mdadm: /dev/md/0 has been started with 4 drives.

Where -A = --assemble and -s = --scan, which scans for all arrays
located in /etc/mdadm/mdadm.config - checked earlier so I knew /dev/md0
was in there with its UUID. I note that the documentation for --assemble
is confusing. Nowhere did I find anything that said its purpose is to
*restart* an already created array. I was afraid it would create a new
array.

I could have continued with mounting it on the command line, but my GUI
file manager auto-mounts everything in 'Places' just by clicking on it,
so I clicked on it, et voilà!! I'm back in business!

This array has been a pain for the past year and a half, so I'm going
to copy this whole discussion into my 'Commands.txt' file for future
reference. I still need to figure out why the array keeps failing, but
at least now I can recover somewhat gracefully.

Thanks for poking me in the right direction!



More information about the PLUG mailing list