I have the following software raid made using mdadm:
Code:
dell-desktop dev # cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb6[1]
717040448 blocks super 1.2 [2/1] [_U]
unused devices: <none>
I have a failed drive I am replacing (which no longer appears above. It was /dev/sda1), and need to fail the /dev/sdb6 device so I can do some work on it (won't get into that), re-add it, then add the new hard disk to the array.
Also,
Code:
dell-desktop dev # fdisk -l
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00011318
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41945087 20971520 83 Linux
/dev/sdb2 41945088 1953523711 955789312 5 Extended
/dev/sdb5 41947136 54530047 6291456 82 Linux swap / Solaris
/dev/sdb6 519178240 1953523711 717172736 fd Linux raid autodetect
Disk /dev/md0: 734.2 GB, 734249418752 bytes
2 heads, 4 sectors/track, 179260112 cylinders, total 1434080896 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Disk /dev/md0 doesn't contain a valid partition table
/dev/md0 is not mounted. I get the following response running:
Code:
dell-desktop dev # mdadm --fail /dev/md0 /dev/sdb6
mdadm: set device faulty failed for /dev/sdb6: Device or resource busy
I can't figure out what has the device busy.
Running lsof, fuser, and losetup shows nothing is using the device (as expected since it is a fresh boot and nothing is mounted regarding it). There are no exports on this, but I have no way I know of to check to see if a kernel module is holding onto it.
How can I find out what has it busy, fix that, and fail the device so I can remove it from the system, work on it, then re-add it?
Oddly, I can do:
Code:
# mdadmin -S /dev/md0
Successfully, despite the report that /dev/sdb6 is busy.
This makes me actually think it is /dev/md0 that is latching onto it since it doesn't have another raid device to hold onto so it is "desperately clinging to it."
With thanks for the help ...