Re: Problem creating software raid - Device or resource busy.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Basheer wrote:
Hi,
Hi

I'm not familiar with your kernel or mdadm versions - please say.

Drive 1
----------
/dev/sda1 = swap
/dev/sda2 = linux raid   (os & data is here)
/dev/sda3 = linux raid

Are you describing partition types here (ie 0xfd = raid autodetect in fdisk)?

Drive 2
----------
/dev/sdb1 = swap
/dev/sdb2 = linux resiser
/dev/sdb3 = linux reiser
Do you mean you actually have live filesystems here?

You seem to indicate that there are filesystems on disk 2 but none on disk 1. Yet you say "os & data is here" ?
What do you mean by that?

Please show:
* partitions of both disks
* existing filesystems on both disks


FYI A raid device is usually made from empty partitions (devices) and you create a new filesystem inside the raid device. You can't usually just 'raid' them after the fact.


Using mdadm I managed to create /dev/md0 in raid 1 (mirror).
What command?

/dev/sda3 & /dev/sdb3 where added to this set.
That would make sense - but a normal md device has a superblock and this would overwrite bits of your filesystem if you already have data on the disk. That is bad.

Good so far....
hmmmm.... debatable :)

now for the problem....

Problems Area
-----------------------
Using mdadm I failed to create /dev/md1 in raid 1 (mirror). /dev/sda2 & /dev/sdb2 where part of this set. I get this error: mdadm: cannot open device /dev/sda2: Device or resource busy.
yes. It sounds like you've got some confusion about creating a mirrored filesystem. I suspect you have a mounted filesystem on /dev/sda2

Have a look at the FAQ stuff here:
http://linux-raid.osdl.org/

I booted from rescue CD, and ran the mdam command to create /dev/md1 ... and it worked! I let the raid sync.
Well, it would :)
The rescue system won't have mounted anything.

> How to do I solve this?

I think you need to:
* repair any damage to your data
* prepare your kernel and init system
* go to a rescue system
* create a 'broken' mirror using your empty disk (disk2?).
* make a filesystem on the broken mirror
* copy the good filesystems to the broken mirror
* add the now free partitions from disk1 to the broken mirror
* wait for a resync
* reboot



David
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux