My Certifications

LPI

Comptia A+
BB Training
Certified Ethical Hacker


Tags

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

Restore a partimage backup to loopback

  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

Ubuntu Encrypted Loopback Disk

So I have a need for a encrypted disk - as a loop back file. I wrote earlier on how to restore a partimage backup to loopback, so lets see if we can make this work.

  1. We need to tell the kernal how to encrypt disks with a module
    • modprobe cryptoloop
  2. Create the loop file (like before, but with urandom to help hide the disk, the count is MB*1000 so in this case 1M)
    • dd if=/dev/urandom of=myharddisk.img bs=1000 count=1000 
  3. Create the loopback device (I'm going to use TwoFish)
    • losetup -e twofish /dev/loop0 ./myharddisk.img
  4. At this point, you will be asked for a password - create your own
  5. Create the file system of choice (ext3 for me)
    • mkfs.ext3 /dev/loop0  
  6. Mount the new loop back point /dev/loop0
    • mount /dev/loop0 /mnt/my/mount/point

Enjoy!