Skip to contentSkip to conversation

Why can't I stop these arrays?

DISCUSSION Richard Michael 4 participants 5 messages Jun 22, 2008 – Jun 23, 2008 MD RAID

lore
Share & tools
lore
#0 lore raw

I am experimenting with various array configurations. I have several arrays running and I want to stop them. They are not mounted; indeed, they don't even have filesystems on them. As far as I can tell, nothing on the system is using them.

I have tried stopping the monitoring mdadm process, but I still cannot stop the arrays. (Although, if it was necessary to stop the monitoring process for all arrays just to stop one of them, that would be a bug.)

There is a raid5 resyncing, which might be causing the problem (although it shouldn't), but it needs hours to finish the resync. Also, none of the components in the raid5 array are in the arrays I want to stop, so again, I don't see why there should be a problem.

(Though, md3 is also a raid5 and md5 is comprised of md3, so in some sense md5 also "has something to do with" raid5. Problem?)

Aside, how can I stop the resync to test if it is interferring? Note, the system is running of the resyncing raid5, so I need to stop the resync but *not* stop the array.

Any advice? Probably I've missed something obvious..

[root@server ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md5 : active raid1 md3[0]

      1952475584 blocks [2/1] [U_]

md3 : active raid5 sdd2[0] sdg2[3](S) sdf2[2] sde2[1]

      1952475648 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

md0 : active raid1 sda1[0] sdb1[1]

      521984 blocks [3/2] [UU_]

md1 : active raid5 sdc2[3] sda2[0] sdb2[1]

      1952475648 blocks level 5, 256k chunk, algorithm 2 [3/2] [UU_]
      [=======>.............]  recovery = 35.9% (351008004/976237824)

finish=163.5min speed=63727K/sec

unused devices: <none>
[root@server ~]# mdadm --stop /dev/md5
mdadm: fail to stop array /dev/md5: Device or resource busy [root@server ~]# mdadm --stop /dev/md3
mdadm: fail to stop array /dev/md3: Device or resource busy

Thanks,
Richard

#1 lore raw
Quoted 36 lines · Richard Michael

I am experimenting with various array configurations. I have several arrays running and I want to stop them. They are not mounted; indeed, they don't even have filesystems on them. As far as I can tell, nothing on the system is using them.

I have tried stopping the monitoring mdadm process, but I still cannot stop the arrays. (Although, if it was necessary to stop the monitoring process for all arrays just to stop one of them, that would be a bug.)

There is a raid5 resyncing, which might be causing the problem (although it shouldn't), but it needs hours to finish the resync. Also, none of the components in the raid5 array are in the arrays I want to stop, so again, I don't see why there should be a problem.

(Though, md3 is also a raid5 and md5 is comprised of md3, so in some sense md5 also "has something to do with" raid5. Problem?)

Aside, how can I stop the resync to test if it is interferring? Note, the system is running of the resyncing raid5, so I need to stop the resync but *not* stop the array.

Any advice? Probably I've missed something obvious..

[root@server ~]# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] [raid1] md5 : active raid1 md3[0]

      1952475584 blocks [2/1] [U_]

md3 : active raid5 sdd2[0] sdg2[3](S) sdf2[2] sde2[1]

      1952475648 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

md0 : active raid1 sda1[0] sdb1[1]

      521984 blocks [3/2] [UU_]

md1 : active raid5 sdc2[3] sda2[0] sdb2[1]

      1952475648 blocks level 5, 256k chunk, algorithm 2 [3/2] [UU_]
      [=======>.............]  recovery = 35.9% (351008004/976237824)
Quoted 8 lines

finish=163.5min speed=63727K/sec

unused devices: <none>
[root@server ~]# mdadm --stop /dev/md5
mdadm: fail to stop array /dev/md5: Device or resource busy [root@server ~]# mdadm --stop /dev/md3
mdadm: fail to stop array /dev/md3: Device or resource busy

Do they have volume groups on them?

If so you need to turn them off.

I would "vgdisplay" and if they show up in there they will need to be turned off there before they can be unmounted (vgchange -a y device).

Roger

#4 lore raw
In reply to Richard Michael
Quoted 1 line · Richard Michael

they don't even have filesystems on them. As far as I can tell, nothing on the system is using them.

Have you used the "lsof" utility to see what process might be accessing the md devices? That's where I start when I run into the problem you described (not knowing what is locking what I want to unmount or stop).

Signature · 1 line
Mikael Abrahamsson    email: [email protected]
#2 lore raw

Re: Why can't I stop these arrays? PATCH

In reply to Roger Heflin
Quoted 1 line
Quoted 1 line

Any advice? Probably I've missed something obvious..

Yes, of course I did. :) (To other poster, I checked lsof immediately.)

Quoted 1 line

Do they have volume groups on them?

Yes, I do. I should know, since I created them. I've been fooling around all day with lvm, but somehow completely forget it would keep the array active..

Quoted 2 lines

I would "vgdisplay" and if they show up in there they will need to be turned off there before they can be unmounted (vgchange -a y device).

I'm fairly certain here you mean: "vgchange -a n <vg_name>".

Thanks Roger!

Since this has come up on the mailing before, is there any interest in this trivial one liner? (Perhaps it needs to go elsewhere in the code as well.)

Manage.c 2008-06-22 20:35:25.000000000 -0400 renamed from Manage.c 2008-06-05 22:11:04.000000000 -0400 +1 -0
diff -u -r mdadm-2.6.7/Manage.c mdadm-2.6.7-local/Manage.c
@@ -115,6 +115,7 @@
                        if (quiet==0)
                                fprintf(stderr, Name ": fail to stop array %s: %s\n",
                                        devname, strerror(errno));
+                               fprintf(stderr, "Perhaps a running process, mounted filesystem or active volume group?\n");
                        return 1;
                }
                if (quiet <= 0)

Regards,
Richard

#3 lore raw

Re: Why can't I stop these arrays? PATCH

Quoted 10 lines · On Sunday June 22, [email protected] wrote:

Since this has come up on the mailing before, is there any interest in this trivial one liner? (Perhaps it needs to go elsewhere in the code as well.)

diff -u -r mdadm-2.6.7/Manage.c mdadm-2.6.7-local/Manage.c

Manage.c 2008-06-22 20:35:25.000000000 -0400 line 121

Quoted 7 lines
Manage.c 2008-06-22 20:35:25.000000000 -0400 renamed from Manage.c 2008-06-05 22:11:04.000000000 -0400 +1 -0
@@ -115,6 +115,7 @@
                        if (quiet==0)
                                fprintf(stderr, Name ": fail to stop array %s: %s\n",
                                        devname, strerror(errno));
+                               fprintf(stderr, "Perhaps a running process, mounted filesystem or active volume group?\n");
                        return 1;
                }
                if (quiet <= 0)

Somewhere way down on my TODO list is
Improve error messages to try and really explain what is going on.

This is in line with that so I'm happy to take it. However I would at least like the new message to be conditional on
errno == EBUSY

I don't think any other error are possible, but it is good practice, provides implicit documentation, and guards against possible future changes.

NeilBrown