Hi Mathias, On 2019/9/1 20:49, Mathias G wrote: > Hi Tao > > On 23.08.19 14:15, Hou Tao wrote: >> Could you please save the following script as /usr/lib/systemd/system-shutdown/md_debug.sh and make it executable: >> >> #!/bin/bash >> mount -o remount,rw / >> mdadm -D /dev/md* > /md_debug.txt >> mdadm -S /dev/md* >> /md_debug.txt >> mount -o remount,ro / >> >> The script will dump the details of md devices to the /md_debug.txt and stop the md devices forcibly before shutdown or reboot. >> And we can check the content of md_debug.txt if the problem reoccurs. > > Thanks for the code snipped. I tried to put the script to As showed in the following lines, we should use "&>" and "&>>" to save the output from both the standard output and standard error output: mdadm -D /dev/md* &> /md_debug.txt mdadm -S /dev/md* &>> /md_debug.txt Could you please update the code snippet accordingly ? Regards, Tao > /usr/lib/systemd/system-shutdown/ > > but it was not executed at all. > > I remembered that I tried to create some debug info by myself and I had > to put the script to: > /lib/systemd/system-shutdown/ > instead to make it working. No idea why, the execute bit was set. > > This is what I also did, I'll let you know about the debug output. >