Back Up (And Restore) LVM Partitions With LVM Snapshots - Page 3

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Submitted by falko (Contact Author) (Forums) on Sun, 2007-04-15 12:29. ::

4 Restore A Backup

This chapter is about restoring the /dev/server1/root volume from the dd image we've created in the previous chapter. Normally you can restore a backup from the same running system if the volume that you want to restore doesn't contain system-critical files. But because the /dev/server1/root volume is the system partition of our machine, we must use a rescue system or Live-CD to restore the backup. The rescue system/Live-CD must support LVM.

To restore the /dev/server1/root volume, I boot the system from the Debian Etch Netinstall CD and type in rescue at the boot prompt:

Select your language:

Choose your country:

Choose your keyboard layout:

You can accept the default hostname:

You can also accept the default domain name (which is empty):

Select the backup volume (/dev/server1/backups) as the root file system:

Then select Execute a shell in the installer environment:

Hit Continue:

Now we have a shell:

Run

mount

and you should see that /dev/server1/backups is mounted on /target. So the dd image of the /dev/server1/root volume should be /target/root.dd. To restore it, we simply run

dd if=/target/root.dd of=/dev/server1/root

That's it. It can take a few minutes until the task is finished. Afterwards you can remove the Live-CD and boot into the normal system again.

 

5 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by entplex (registered user) on Thu, 2009-02-26 02:57.
I really enjoyed the tutorial, everything worked well and  it was nice and straight forward, but would you mind including how to restore a tar style backup?  dd backups are great, but they don't allow for the use of compression and use space on the destination disk for the free space on the source disk.
Submitted by Anonymous (not registered) on Sun, 2009-03-01 01:06.

dd image files are very compressable! Just run gzip(1) or bzip2(1) on the 'rawImageFile.dd'.  Bzip2 will give you better compression, but will take longer (use pbipz2 if you have a multi-core box, it'll be faster).  This will give you rawImageFile.dd.bz2. 

 

You just have to have storage space available to uncompress it when you do a restore.  If you're of the geeky persuasion, pipe the output of bunzip2(1) directly to the disk.  This also applies to compressing the image file; you can pipe the output of dd(8) to bzip2 and compress the image, on the fly, directly to the raw file.

Submitted by Ritesh Raj Sarraf (not registered) on Fri, 2009-04-03 19:43.
Thanks for pointing out dd+compression_utils.

I was wondering if there are tools which could take a block diff and allow generating a delta ?
Submitted by Anonymous (not registered) on Thu, 2009-05-21 00:45.
look at rdiff-backup
Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions
Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com