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

Re: raid0 - move a partition to a new drive?



hi ya peter

On Wed, 5 May 2004, Peter Sebastian Masny wrote:

> Hi all, not really a Debian question, but you guys seem to know everything...

backup all the important data FIRST
 
> I have a software RAID0 array of three disks.  Two of them are full-disk 

raid0 -- stripping ... no redundancy ... if one drive dies, the whole raid
	is dead, ( you lost data on all 3 disks )

	but in theory, if you dd if=120GB of=new-120GB-disk  should work
	as long as you do the dd correctly from a stand alone system
	( raid cannot be up at the time )

	http://1u-raid5.net/Differences/

> partitions on identical 120GB drives, and the third is a 120GB partition on a 
> larger disk.  I now have a third 120GB (same model as the other two) and want 
> to move the partition from the larger drive to the third identical one.  The 
> head size of the larger drive(255) is different than for the smaller 
> ones(16), and its partition is a few MB larger as a result.

the 16 head vs 255 head is semi irrelevant ... the ide drivers and disk
controllers takes take of the remapping for you
 
> How can I move the partition on the larger drive onto the new smaller one? 

use dd 

> Is there a way to copy the partition?

dd if=/dev/hdc1  of=/dev/hdd1

	hdc1 == 120MB of the 250MB disk
	hdd1 == new 120MB disk

be prepared to lose all data on all 3 disks, if dd didnt copy all the
data the other 2 disks is expecting to be on the new 120MB disk

> Remember the larger partition is a few 
> MB bigger than the small ones.  I think a dd might possibly work anyway, as 
> it would copy the main blocks, and leave out the trailing unused blocks, but 
> I suspect that in real life this solution would freak out the raid system.

yup ... so you have to trick it 

i dont know if there is any raid meta data that is kept on each disks
that replacing one disk with another one will work, even after you
made an identical partition and data with bit-level dd  copying

> I don't have an extra 250 GB available for copy-off-copy-back.

c ya
alvin 



Reply to: