Native backup/restore partition options

Tom Metro blu-5a1Jt6qxUNc at public.gmane.org
Sat Jun 30 12:22:35 EDT 2007


Scott Ehrlich wrote:
> Please remind me the dd option to preserve just the Linux partitions of 
> the drive? 

Your questions is a little vague as to whether you are trying to 
preserve the partition table or a specific partition.

You do the latter by using the partition device name as the source 
device for dd. So instead of 'dd if=/dev/hda ...' you do 'dd 
if=/dev/hda1 ...' for the first partition.


> I've never played with blocksize, etc.

You shouldn't need to for this, though I typically set the block size to 
something large, like 10 to 100 MB, to maximize throughput when cloning 
disks.


> Also, what is the best way to know where data ends so I know where to 
> start to safely write zeros to the unused area on a partition before 
> preserving it?

The best way is to let the file system figure it out. Just create a 
regular file:

dd if=/dev/zero of=/path/to/partition/zero

Wait until it fails from running out of disk space, and then delete the 
file.

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.






More information about the Discuss mailing list