What's an easy way to replace a drive?

Jerry McAllister jerrymc at clunix.cl.msu.edu
Thu Mar 24 11:11:22 PST 2005


> 
> Gary Smithe writes:
> 
> > May not be the best answer, but if the drive's data is still intact
> > (i.e. readable) and the replacement will be identical, maybe try DD or
> > similar from a bootable "rescue" cd, like freesbie?  If not that, then
> > you may be able to copy the data between the 2 drives using same said
> > bootable CD after creating the partitions.
> 
> Is it possible to dd the entire contents of one drive into a single file
> on another drive (assuming the latter drive is big enough)?  If so, I
> could save time by just copying the drive wholesale to a huge file on
> another drive, replacing it, then copying everything back.  Not sure if
> "whole drive" would include content outside the FS, though (?).

Whatever piece you dd will be copied whole including boot sector
and slice/partition table if you dd a slice or a partition instead of 
just the files.    So, yes you could do it, but...

The problem with dd-ing a partition or slice is that when you put it 
back, what was on the old drive would then overwrite the new including 
the slice and partition tables and boot sector, etc.  It is likely that 
the new/rebuilt disk would be slightly different than the old so you 
really want to slice/partition/newfs it from scratch.

I would recommend using dump(8) to copy each of the filesystems to a file.   
Then create new slices & partitions, newfs them and restore(8) the contents 
back. It is safer and just as efficient.

////jerry

> 
> -- 
> Anthony
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 



More information about the freebsd-questions mailing list