Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a partition lying on a software raid device, /dev/md4

On boot, fsck fails and the partiton cannot be mounted. Trying to fsck manually, I get an error:

sudo fsck /dev/md4 fsck from util-linux-ng 2.17.2 e2fsck 1.41.11 (14-Mar-2010) fsck.ext4: Device or resource busy while trying to open /dev/md4 Filesystem mounted or opened exclusively by another program?

sudo lsof /dev/md4 gives no output...

Is there a way to force a fsck on an md device ?

share|improve this question
    
Have you tried rebuilding the RAID array? –  wolfgangsz Sep 6 '10 at 16:42
    
In fact I cannot even stop the raid array! mdadm --stop /dev/md4 also gives me a "device or resource busy" error. –  alci Sep 7 '10 at 9:08
add comment

2 Answers

It's mounted, but it won't show as an opened file (try it with other mounted drives). Do grep "/dev/md" /proc/mounts and see if it says where it's mounted. If not, see what cat /proc/mdstat says. Once you've unmounted it, fsck should work.

You may have a failed disk, see what mdadm -D /dev/md4 says - if it gives a dodgy disk, remove it mdadm -v /dev/md4 -r /dev/whatever, replace it or fdisk it, then mdadm /dev/md4 -a /dev/whatever

share|improve this answer
    
Hi. Well, it does not appear to be mounted. cat /etc/mtab has no reference to /dev/md4. Also, cat /proc/mdstat shows a healthy md4 array: Personalities : [linear] [multipath] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] md4 : active raid10 sdj1[7] sdh1[5] sdg1[4] sdi1[6] sdc1[0] sde1[2] sdf1[3] sdd1[1] 140619520 blocks 64K chunks 2 near-copies [8/8] [UUUUUUUU] –  alci Sep 7 '10 at 8:13
add comment

Ok, I've found the culprit. The partition does not contain a fs anymore. Instead, it is under the control of lvm (and the lvm partitions are used by kvm virtual machines). But the person that made the change forgot to remove the relevant entry from /etc/fstab.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.