mdadm fails to stop RAID on shutdown

Bug #111398 reported by astronic
30
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: mdadm

I use a RAID0 array for my root partition. Since the update from Edgy to Feisty I get the following error message on shutdown:

* Stopping MD array md0 fail

It seems that mdadm tries to stop the RAID while it is still busy. However on shutdown "unmounting local file systems" appears before "Stopping MD array md0", so in theory things should be fine, practically however I get the aforementioned error message.

I've never manually tempered with /etc/mdadm/mdadm.conf or with the order of init scripts, so I don't see where I could possibly be at fault here myself.

My /etc/mdadm/mdadm.conf is as follows:

DEVICE partitions
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=2584f8de:386621a1:7bed7f63:e8caced3
DEVICE partitions
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=2584f8de:386621a1:7bed7f63:e8caced3
MAILADDR root

My runlevel 0 executes the following init scripts:

tittel@uranus:/etc/rc0.d$ ls
K01kdm K20apport K25hwclock.sh README S20sendsigs S40umountfs S59cryptdisks-early
K01usplash K20dbus K25mdadm S01linux-restricted-modules-common S30urandom S48cryptdisks S60umountroot
K19hplip K20firewall K50alsa-utils S15wpa-ifupdown S31umountnfs.sh S50mdadm-raid S90halt

Let me add that I am using pam_encfs to encrypt my home directories using the login password. But the error also happens if I shut down the system via KDM right after it has booted up without logging in and therefore without the chance of encfs getting activated.

Thanks in advance for fixing this!

Revision history for this message
Gianluca (gianluca-sabena-gmail) wrote :

I confirm that I have the same problem on Ubuntu server 7.04 amd64 with 3 md partitions. When we stop the server first md array (md0) is stopped correctly, but the second md1 (swap partition) and the third md2 (lvm array) fails.

Revision history for this message
jmandawg (jmandawg) wrote :

I'm having the exact same issue here. Ubuntu server 7.04 amd64.

Revision history for this message
Achim Stumpf (hakim-news) wrote :

I have exactly the same issue on Kubuntu 7.04 alternate on i386.

Changed in mdadm:
status: Unconfirmed → Confirmed
Revision history for this message
Pablo Garcia Zamora (pablog) wrote :

I'm having the exact same issue on Ubuntu server 7.04 on amd64.

Revision history for this message
Sami J. Laine (sjlain) wrote :

I have this same issue on Ubuntu Desktop 7.04 on i386. On a desktop machine this kind of error is rather critical since user must resync all raid arrays manually after every reboot; as desktop machines tend to be turned of daily (or even several times on daily basis) this makes raid practically unusable.

Revision history for this message
Roberto Scelzo (robertoscelzo) wrote :

I'm facing the same issue on a fresh installed Feisty server AMD64;
The machine is a brand new DELL PE 1440SC with 2 sata disks.

When i perform a shutdown md0 and md1 (/ and swap) fail to
stop...

Moreover, sometimes on start up I also have this issue:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/114170

Revision history for this message
Rui Ruas (ruiruas) wrote :

I also confirm this problem. My ubuntu feisty 64 fails to stop three of four raid arrays on shutdown. While booting I receive an error message: mdadm can't find the raid arrays in conf file, but after that it boots fine with all arrays working and synchronised. (???)

Revision history for this message
Sami J. Laine (sjlain) wrote :
Revision history for this message
Sami J. Laine (sjlain) wrote :

First things first. I'd say this is not an issue that should stay this long in 'Undecided'-state. Having to manually resync RAID-arrays after each reboot is a real issue to a desktop user (of course one could always question why on earth would this desktop user use RAID but that is besides the point).

This bug really seems to be related in the bug described in http://lkml.org/lkml/2006/10/6/233 or at least the behaviour seems to be almost exactly alike.

I've added some extra output commands to /etc/init.d/mdadm-raid (see below for diff against original file). This reveals that it is the root device, /dev/md0, that is failing each and every time (well, to be honest, I only tested this three times after jumping into conclusion by bold extrapolation).

When init runs "/etc/init.d/mdadm-raid stop", as one of the last actions during the shutdown, for some odd reason /dev/md0 is still on active state but every other array is already in stopped state. Now this is as it should be, since we don't want those arrays to be busy while stopping them. Now what comes to my mind is this is not exactly a bug in mdadm but instead a bug in kernel itself (as that lkml thread hints).

234,240d233
<
< # show /proc/mdstat after each issued stop command
< cat /proc/mdstat
<
< # show what exactly has been run
< echo "C: \`$line'"
<

Revision history for this message
Sami J. Laine (sjlain) wrote :

I wonder if there is a reason for stopping md-arrays before root filesystem has been mounted read-only?

At least in my system, Feisty 7.04, init-script symlinks point to the fact that /etc/init.d/umountroot stop will be run after /etc/init.d/mdadm-raid stop:

--- clip ---
% ls /etc/rc?.d/*mdadm-raid
/etc/rc0.d/S54mdadm-raid /etc/rc6.d/S54mdadm-raid /etc/rcS.d/S25mdadm-raid
% ls /etc/rc?.d/*umountroot
/etc/rc0.d/S52umountroot /etc/rc6.d/S52umountroot
--- clip ---

Shouldn't the root filesystem be mounted read-only BEFORE root filesystem raid is stopped? Doesn't a read-write filesystem on top of a raid array result failure with stop command for that array?

Revision history for this message
Sami J. Laine (sjlain) wrote :

Erhm. That above was obviously a suggestion how init-scripts should be arranged, not a cut from running Feisty system. The Feisty sets init-scripts as following:

--- clip ---
% ls /etc/rc?.d/*mdadm-raid
/etc/rc0.d/S50mdadm-raid /etc/rc6.d/S50mdadm-raid /etc/rcS.d/S25mdadm-raid
% ls /etc/rc?.d/*umountroot
/etc/rc0.d/S60umountroot /etc/rc6.d/S60umountroot
--- clip ---

Revision history for this message
phalkone (phalkone1) wrote :

I also have this problem. Can someone advice on how to change the shutdown/reboot order.

Revision history for this message
RUSL Bicycle (bikerusl) wrote :

I'm also having this problem. Can't stop my new RAID5. No progress on this since last year? When I was setting up I think I was able to stop the RAID when I was testing. Now that I am running it isn't working however... ;p

Revision history for this message
Pablo Castellano (pablocastellano) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been too much activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu Intrepid release? Thanks in advance.

Revision history for this message
Sami J. Laine (sjlain) wrote : Re: [Bug 111398] Re: mdadm fails to stop RAID on shutdown

Pablo Castellano wrote:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. You reported this bug a while ago and there hasn't been
> too much activity in it recently. We were wondering is this still an
> issue for you? Can you try with latest Ubuntu Intrepid release? Thanks
> in advance.
>

I must say that I'm not aware wether or not this is an issue anymore.
For me it isn't as I got tired of wondering how to fix it and simply
switched back to plain old Debian. That wasn't much of a workaround but
satisfied my needs.

Thanks for your efforts anyway. Ubuntu does great job on the support
side of distribution and I've been happily installing it on my friends
machines for years.

--
Sami J. Laine @ GMail, +358504118464

Revision history for this message
Rui Ruas (ruiruas) wrote :

I can't guarantee... what happens is when using software raid1 for the
root filesystem, it sometimes fails to restart. I thought the problem
was an unclean shutdown, but can't be sure. I'm still using ubuntu (and
I'm happy with it!) and in my webserver the problem hasn't happened
again for about two months (however I only restarted once or twice...)

Pablo Castellano wrote:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. You reported this bug a while ago and there hasn't been
> too much activity in it recently. We were wondering is this still an
> issue for you? Can you try with latest Ubuntu Intrepid release? Thanks
> in advance.
>
>

--
 *Rui Ruas*
<email address hidden>
Tlm: 962915270

------------------------------------------------------------------------

Evite imprimir emails, proteja a natureza.
Avoid printing emails, protect nature.

Revision history for this message
Marc Schröder (schroed) wrote :

I have just witnessed this problem with a server running Ubuntu 7.10.
One of the two partitions in a RAID1 root partition was in an unclean
state at reboot so was kicked out by mdadm, leading to a DegradedArray
warning. I am worried: can this happen to both partitions at the same
time, or only to one at a time? In other words, is there a risk that I
lose all my data during a reboot?

Marc

Rui Ruas schrieb:
> I can't guarantee... what happens is when using software raid1 for the
> root filesystem, it sometimes fails to restart. I thought the problem
> was an unclean shutdown, but can't be sure. I'm still using ubuntu (and
> I'm happy with it!) and in my webserver the problem hasn't happened
> again for about two months (however I only restarted once or twice...)
>
> Pablo Castellano wrote:
>> Thank you for taking the time to report this bug and helping to make
>> Ubuntu better. You reported this bug a while ago and there hasn't been
>> too much activity in it recently. We were wondering is this still an
>> issue for you? Can you try with latest Ubuntu Intrepid release? Thanks
>> in advance.
>>
>>
>

--
Dr. Marc Schröder, Senior Researcher at DFKI GmbH
Coordinator EU FP7 Project SEMAINE http://www.semaine-project.eu
Chair W3C Emotion ML Incubator http://www.w3.org/2005/Incubator/emotion
Portal Editor http://emotion-research.net
Team Leader DFKI Speech Group http://mary.dfki.de
Project Leader DFG project PAVOQUE http://mary.dfki.de/pavoque

Homepage: http://www.dfki.de/~schroed
Email: <email address hidden>
Phone: +49-681-302-5303
Postal address: DFKI GmbH, Campus D3_2, Stuhlsatzenhausweg 3, D-66123
Saarbrücken, Germany
--
Official DFKI coordinates:
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
Geschaeftsfuehrung:
Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vorsitzender)
Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313

Revision history for this message
Rui Ruas (ruiruas) wrote :
Revision history for this message
ceg (ceg) wrote :

Is this still an issue with recent releases?

Changed in mdadm (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? If so, please feel free to mark this bug as new. Thanks!

Revision history for this message
astronic (bugreports-tittel) wrote :

I am not using Ubuntu 7.04 anymore, actually I am currently not using Ubuntu in a RAID configuration on any of my systems at all. Because of that I can't provide any information on this old bug. Since the bug refers to an Ubuntu version which is out of its support period, I suggest to close it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mdadm (Ubuntu) because there has been no activity for 60 days.]

Changed in mdadm (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.