LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RAID array creations fails (https://www.linuxquestions.org/questions/linux-newbie-8/raid-array-creations-fails-837744/)

gopimallikharjun 10-13-2010 04:03 AM

RAID array creations fails
 
Hello Raid Experts

I am trying to create a raid array and I am getting the following error, Probably someone can help me out in this regard.

sh-3.1# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 5 251 1984027+ fd Linux raid autodetect
/dev/sda2 1 4 32098+ 83 Linux
/dev/sda3 252 498 1984027+ 83 Linux
/dev/sda4 499 57985 461760557+ f W95 Ext'd (LBA)
/dev/sda5 499 57985 461760557 fd Linux raid autodetect

Partition table entries are not in disk order

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 498 57985 461760742+ f W95 Ext'd (LBA)
/dev/sdb5 498 57985 461760742 fd Linux raid autodetect

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 498 57985 461760742+ f W95 Ext'd (LBA)
/dev/sdc5 498 57985 461760742 fd Linux raid autodetect

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 498 57985 461760742+ f W95 Ext'd (LBA)
/dev/sdd5 498 11996 92351562+ 83 Linux
/dev/sdd6 11996 16595 36940429 83 Linux
/dev/sdd7 16595 34990 147761719+ 83 Linux
/dev/sdd8 34991 57985 184702149 83 Linux


When I try to create Raid array /dev/md1, I am getting following error.

/sbin/mdadm --verbose --create --level=0 --raid-devices=3 /dev/md1 /dev/sda5 /dev/sdb5 /dev/sdc5

mdadm: chunk size defaults to 512K
mdadm: super1.x cannot open /dev/sda5: Device or resource busy
mdadm: ddf: Cannot use /dev/sda5: Device or resource busy
mdadm: Cannot use /dev/sda5: It is busy
mdadm: device /dev/sda5 not suitable for any style of array


Any pointers in this regard is appreciated ...

longbow0 10-13-2010 04:50 AM

have you umounted /dev/sda5?

gopimallikharjun 10-13-2010 04:57 AM

Yes, I tried both options - by mounting and then unmounting also ...

Made sure that no one is using this device by checking using lsof

longbow0 10-13-2010 07:57 AM

may be this link would be useful
http://www.righteoushack.net/?p=197

michael.luczkow 12-30-2015 03:26 AM

Sorry to bump an ancient thread, but I came across this in searching and though I'd add some keywords for future people searching.

Longbow0, the link you posted was dead on. That was the problem.

Short version: For some reason, the package "dmraid" causes certain block devices (which may or may not be or have been used in a fakeraid) to not be able to have their superblock wiped or be added to a new mdadm raid device.

Here's what I saw:

Code:

fdisk -l | grep GB | grep 3000 (Show my 3TB disks)
Disk /dev/sdf: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdd: 3000.6 GB, 3000592982016 bytes
Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdn: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes
Disk /dev/sde: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdg: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdj: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdk: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdm: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdo: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdl: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdi: 3000.6 GB, 3000592982016 bytes
Disk /dev/sdh: 3000.6 GB, 3000592982016 bytes
Disk /dev/mapper/ddf1_49424d202020202010000079101403b2437f272b36611111: 3000.0 GB, 2999999004672 bytes
Disk /dev/mapper/ddf1_49424d202020202010000079101403b2437f272b90111111: 3000.0 GB, 2999999004672 bytes

So, what the heck are those /dev/mapper/ddf1_49xxx devices???

Throw some blocks on them with "dd" and they reveal themselves as /dev/sde and /dev/sdl.

Code:

[root@stack ~]# mdadm --zero-superblock /dev/sde
mdadm: Couldn't open /dev/sde for write - not zeroing

That's odd, none of my other 3TB disks did that. WTF? Lets try to make the raid anyway:

Code:

[root@stack ~]# mdadm --create /dev/md0 --level=6 --raid-devices=15 /dev/sd{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}
mdadm: super1.x cannot open /dev/sde: Device or resource busy
mdadm: /dev/sde is not suitable for this array.
mdadm: super1.x cannot open /dev/sdl: Device or resource busy
mdadm: /dev/sdl is not suitable for this array.
mdadm: create aborted

Ehrmm... nope.

Code:

[root@stack ~]# dd if=/dev/zero bs=1024 count=10M conv=fsync of=/dev/sde
^C134401+0 records in
134401+0 records out
137626624 bytes (138 MB) copied, 1.59491 s, 86.3 MB/s

I can put blocks on it just fine, so what's the problem? No, it's not mounted either. None of my software raid devices are mounted anywhere, they are presented as raw blocks to VMs that are not even powered on at the moment.

Code:

[root@stack ~]# yum erase dmraid
.....
Removed:
  dmraid.x86_64 0:1.0.0.rc16-11.el6                                                                                                                                                                                                         
Dependency Removed:
  dmraid-events.x86_64 0:1.0.0.rc16-11.el6                                                                                                                                                                                                 
Complete!

reboot.

Works like a champ!

Code:

[root@stack ~]# mdadm --create /dev/md0 --level=6 --raid-devices=15 /dev/sd{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}

[root@stack ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid6 sdo[14] sdn[13] sdm[12] sdl[11] sdk[10] sdj[9] sdi[8] sdh[7] sdg[6] sdf[5] sde[4] sdd[3] sdc[2] sdb[1] sda[0]
      38091755520 blocks super 1.2 level 6, 512k chunk, algorithm 2 [15/15] [UUUUUUUUUUUUUUU]
      [>....................]  resync =  2.1% (63183872/2930135040) finish=513.4min speed=95670K/sec
      bitmap: 22/22 pages [88KB], 65536KB chunk

unused devices: <none>



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