LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RAID 1 - Unable to remove a disk from an array (https://www.linuxquestions.org/questions/linux-server-73/raid-1-unable-to-remove-a-disk-from-an-array-902305/)

satoshi 09-10-2011 11:00 AM

RAID 1 - Unable to remove a disk from an array
 
Hi there,

I'm trying to remove a disk from an array but I get a device busy error.

Code:

# mdadm --fail /dev/md2 /dev/sdd2
mdadm: set /dev/sdd2 faulty in /dev/md2
# mdadm --remove /dev/md2 /dev/sdd2
mdadm: hot remove failed for /dev/sdd2: Device or resource busy

The strange thing is that if a remove the /dev/sdd2 partition using fdisk and then I restart the server, the /dev/md2 RAID partition disappears. But when I create the /dev/sdd2 partition again and I restart the server, the /dev/md2 partition appears again (and the /dev/sdd2 is still busy).

Any help is really appreciated.

Some useful information:

cat /etc/mdadm.conf
Code:

(... comments...)
ARRAY /dev/md1 level=raid1 num-devices=4 UUID=f05a1031:ad1bd9fe:a4d2adc2:26fd5302

cat /proc/mdstat
Code:

Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md1 : active raid1 sdd1[3] sdc1[2] sdb1[1] sda1[0]
      6142912 blocks [4/4] [UUUU]

md2 : active raid1 sdd2[3]
      1048512 blocks [4/1] [___U]

unused devices: <none>

mdadm --detail --scan
Code:

ARRAY /dev/md/2_0 metadata=0.90 UUID=56e4c700:1889447e:34b941fd:060f7980
ARRAY /dev/md1 metadata=0.90 UUID=f05a1031:ad1bd9fe:a4d2adc2:26fd5302

mount
Code:

rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered)
proc on /proc type proc (rw,relatime)
rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)
sysfs on /sys type sysfs (rw,relatime)
/dev on /dev type devtmpfs (rw,relatime,size=4046860k,nr_inodes=1011715,mode=755)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)

fdisk -l
Code:

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00081621

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            4096    12290048    6142976+  fd  Linux raid autodetect
/dev/sdb2        12290049    14387200    1048576  fd  Linux raid autodetect

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061093

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *        4096    12290048    6142976+  fd  Linux raid autodetect
/dev/sda2        12290049    14387200    1048576  fd  Linux raid autodetect

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c5988

  Device Boot      Start        End      Blocks  Id  System
/dev/sdd1            4096    12290048    6142976+  fd  Linux raid autodetect
/dev/sdd2        12290049    14387200    1048576  fd  Linux raid autodetect

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a2f73

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1            4096    12290048    6142976+  fd  Linux raid autodetect
/dev/sdc2        12290049    14387200    1048576  fd  Linux raid autodetect

Disk /dev/md2: 1073 MB, 1073676288 bytes
2 heads, 4 sectors/track, 262128 cylinders, total 2097024 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md1: 6290 MB, 6290341888 bytes
2 heads, 4 sectors/track, 1535728 cylinders, total 12285824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

uname -r
Code:

gentoo-2.6.39-hardened-r8-xxxx-std-64

ranelson 09-15-2011 12:09 AM

you can not remove the ONLY disk in an array

mdadm will use a faulty disk before accepting NO disk


All times are GMT -5. The time now is 04:57 AM.