LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-15-2011, 12:21 PM   #1
JeepingAZ
LQ Newbie
 
Registered: Feb 2011
Location: Chandler, AZ
Distribution: SuSE 11.0 & Ubuntu
Posts: 2

Rep: Reputation: 0
mdadm --manage /dev/md0 --add /dev/sdb1 returns device busy


Some background:
I have created a RAID 1 array with two disks and three partitions. I removed one disk and used 'dd' to create a second duplicate disk. Both disks individually boot OK. I now want to add the second/duplicate disk back into the disk 1 RAID-1 array. I keep getting "Device or resource busy" on almost ALL mdadm commands I have tried. A search on this seems to indicate many people are having the same problem with no resolution found yet.
I have tried 'lsof' to see what is using my md0 array without success. Also setting the boot parameters to 'nodmraid' also does not work. I have SUSE 11.0. By the way to make sure the duplicated disk boots OK I changed the harddisk serial numbers in the /boot/grub/menu.lst file on disk 1 to /dev/md2 (root) BEFORE running 'dd'.

Here is my setup:
fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000be40b

Device Boot Start End Blocks Id System
/dev/sda1 1 131 1052226 fd Linux raid autodetect
/dev/sda2 132 118468 950541952+ fd Linux raid autodetect
/dev/sda3 118469 121079 20972857+ fd Linux raid autodetect
/dev/sda4 121080 121601 4192965 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000be40b

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 131 1052226 fd Linux raid autodetect
/dev/sdb2 132 118468 950541952+ fd Linux raid autodetect
/dev/sdb3 118469 121079 20972857+ fd Linux raid autodetect
/dev/sdb4 121080 121601 4192965 82 Linux swap / Solaris

Disk /dev/md2: 21.4 GB, 21476130816 bytes
2 heads, 4 sectors/track, 5243196 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

Disk /dev/md0: 1077 MB, 1077465088 bytes
2 heads, 4 sectors/track, 263053 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

Disk /dev/md1: 973.3 GB, 973354819584 bytes
2 heads, 4 sectors/track, 237635454 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

cat /proc/mdstat
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4]
md1 : active raid1 sda2[0]
950541816 blocks super 1.0 [2/1] [U_]
bitmap: 144/454 pages [576KB], 1024KB chunk

md0 : active raid1 sda1[0]
1052212 blocks super 1.0 [2/1] [U_]
bitmap: 2/9 pages [8KB], 64KB chunk

md2 : active raid1 sda3[0]
20972784 blocks super 1.0 [2/1] [U_]
bitmap: 69/161 pages [276KB], 64KB chunk

I want to add in the second disk sdb1 to md0:

mdadm --detail /dev/md0
/dev/md0:
Version : 01.00.03
Creation Time : Fri Feb 11 15:31:43 2011
Raid Level : raid1
Array Size : 1052212 (1027.72 MiB 1077.47 MB)
Used Dev Size : 1052212 (1027.72 MiB 1077.47 MB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent

Intent Bitmap : Internal

Update Time : Tue Feb 15 10:50:22 2011
State : active, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

Name : 0
UUID : 67693ed8:f3f8d464:3a1b5a82:de014fe6
Events : 126

Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 0 0 1 removed

mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: add new device failed for /dev/sdb1 as 2: Device or resource busy

and so it goes with most of the mdadm commands.
 
Old 02-16-2011, 05:38 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

Adding to degraded md devices works even if it's busy. It's probably /dev/sdb1 that is busy. Are you sure it's not mounted already?
 
Old 02-17-2011, 12:18 PM   #3
JeepingAZ
LQ Newbie
 
Registered: Feb 2011
Location: Chandler, AZ
Distribution: SuSE 11.0 & Ubuntu
Posts: 2

Original Poster
Rep: Reputation: 0
Smile Disk Duplication for a RAID1 system.

I hadn't thought of umounting /dev/sdb1. Thanks.

I decided on a different path to duplicating my disks. After using 'dd' to duplicate RAID1 disk 1(sda) I replaced the original disk 1 with the duplicate, added disk 2(sdb) back into the md array and then watched disk 2 sync up.

Basically I don't save any time by duplicating disks as the md sync time is almost as slow as doing 'dd'. I tried using CloneZilla but it is no help. It seems to keep artifacts around that cause other / boot problems.

Thanks again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID Created with 'mdadm' on /dev/md0, but uses /dev/md3 Hummdis Linux - Software 1 03-12-2010 08:06 AM
After creating raid6 array, mkfs.jfs /dev/md0, then cannot mount /dev/md0 artagel Debian 4 12-06-2009 08:30 AM
Cannot create /dev/md1 using mdadm after /dev/md0 is created dwong05 Linux - Newbie 1 05-04-2009 02:37 AM
RAID5 using mdadm, how to mount /dev/md0? ggduff Linux - Software 4 11-14-2007 01:59 AM
mdadm: no device found for /dev/md0 doorito Linux - Server 1 04-09-2007 09:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration