2

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 ?

alci
  • 443
  • 2
  • 6
  • 15

2 Answers2

3

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

James L
  • 5,915
  • 1
  • 19
  • 24
  • 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 07 '10 at 08:13
0

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.

alci
  • 443
  • 2
  • 6
  • 15