Restore a partimage backup to loopback

User Rating: / 14
PoorBest 
  1. You need a file to mount as a HDD device - using DD, the following will instantly create a file of SIZE Gigabytes:
    • dd if=/dev/zero of=myharddisk.img bs=1000 count=0 seek=$[1000*1000*SIZE]
  2.  You need to make this file look like a block device (Choose a free /dev/loop device):
    • losetup /dev/loop0 myharddisk.img
  3. Start partimage manually from the command line, pointing to your loop device
    • partimage /dev/loop0 backupfile.000
  4. Remove the file from the loop device
    • losetup -d /dev/loop0
  5. Mount the new file on a directory
    • mount myharddisk.img /path/to/dir -o loop
  6. Enjoy the backup's files
Comments (2)
Minor corrrection
2Thursday, 21 January 2010 14:09
I believe Step 3 should be "partimage restore /dev/loop0 backupfile.000"

Thanks for the nice tutorial. You might appreciate this master-class level use of loopbacks and kvm here:

http://www.wand.net.nz/~smr26/wordpress/2008/08/28/kvm-the-hard-way/
Thanks
Saturday, 30 January 2010 18:02
Jason Kendall
Yep, I think your 100% correct - thanks for the correction. And a nice link to add to my list :)
What if not enough space
1Saturday, 18 October 2008 06:38
It looks great tip. But in my particular case, I have no device with sufficient space to uncompress my backup (I want to restore from the bzipped backup of my largest device).

Don't you know a way of directly mounting my partimage file or its uncompressed version?

Add your comment

Your name:
Your email:
Subject:
Comment:

Like it? Share it!

Add to: JBookmarks Add to: Facebook Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Technorati Add to: Google Information

Tags

This will be shown to users with no Flash or Javascript.