Monday, July 26, 2010

Linux: Using dd To Back Up Hard Drive Partitions

I am going to use the omnipresent and omnipotent tool called dd to back up a hard drive partition. I am working with the drive /dev/sdb. First, I save a text file that has information on the partition table layout.

fdisk -l /dev/sdb > hdpt.txt
fdisk -l -u /dev/sdb >> hdpt.txt

Then, I choose the compression format to use for the backup archive.

  • gzip
  • bzip2
  • lzma
  • xz

My choice for the compression format is lzma which provides superior compression and faster decompression. The following command backs up a partition at /dev/sdb1 with dd and lzma.

dd if=/dev/sdb1 | lzma -9c > backup01.bin.lzma

To restore this backup later, use the following command:

lzcat backup01.bin.lzma | dd of=/dev/sdb1

About This Blog

KBlog logo This blog seeks to provide useful information to people, based on the author's knowledge and experience. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Follow by Email

Total Pageviews