Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2005 14:11:19 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        freebsd-questions@freebsd.org
Cc:        Jerry McAllister <jerrymc@msu.edu>
Subject:   Re: What's an easy way to replace a drive?
Message-ID:  <200503241911.j2OJBKJ07841@clunix.cl.msu.edu>
In-Reply-To: <1473492382.20050324195730@wanadoo.fr> from "Anthony Atkielski" at Mar 24, 2005 07:57:30 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503241911.j2OJBKJ07841>