Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm searching for a tool to backup a whole ext4 partition to an image. I tried the latest version of mondo, which is not working. What are good alternatives?

share|improve this question
add comment

6 Answers 6

Take a look at fsarchiver

It can be found on the latest SystemRescueCD

Reportedly made by the same guy who authored partimage.

It sports a lot of improvements including: - ext4 support - ntfs support - file-level instead of block-level - compression using multiple cores

Basically, after a partition is saved/compressed it can be restored to different size partitions, and partitions of different formats (so you can use it to convert a partition's format too), and if part of the backup gets corrupted it doesn't destroy the whole image (like it would on a block-level backup.

The only downside (if you consider it a downside) is, it's only a command line app at the moment (but it should get a gui eventually).


The command line entries are really simple.

To save a partition:

fsarchiver savefs /mnt/backup/gentoo-rootfs.fsa /dev/sda1

Where '/mnt/backup/gentoo-rootfs.fsa' is the path being saved to and '/dev/sda1' is the partition being cloned.

To restore a partition:

fsarchiver restfs /mnt/backup/gentoo-rootfs.fsa id=0,dest=/dev/sda1

Just reverse the options above. From what I understand (in the documentation), it looks like the id=0 is necessary because an image can contain multiple partitions. For more directions on usage (such as saving multiple partitions) checkout the QuickStart guide.

SideNote:

As it turns out, I'm actually writing this (as entertainment) from a Linux Mint LiveCD while I'm cloning a newly updated windows factory install clone. I scoured the net earlier looking for a better partition cloning alternative because I want to finally trash this Ghose '03 disc that I've been using for years. I'll drop a note to let you know how it went after I finish the restore.

Update:

Just finished the backup with no errors. It took a little while because I didn't know about the options to make it multi-threaded when I started. The compression was set to the default value (equivalent to gzip -6), the partition was 4.48GB on disk (highly trimmed/updated XP + Chrome) and the output file weighs in at 2.3GB. No complaints here.

share|improve this answer
add comment

Try Clonezilla. It runs in a liveCD environment, and supports any sort of partition (including ext4), to a variety of stores (NFS, SMB, SSH, local filesystems).

I use it all the time to image workstations in our labs.

share|improve this answer
    
Thanks, gave it a try. Looks good. One downside you have to go through really many menus before it starts backup. Are you using commandline for it? –  fmowrg Oct 9 '10 at 15:12
    
yep, that's the way to go. –  lfaraone Oct 11 '10 at 23:13
add comment

I like dd

dd if=/dev/sda1 (or just sda for the whole disk) of=/home/user/backup.img

and

dd if=/home/user/backup.img of=/dev/sda1

to get it back

share|improve this answer
3  
dd is a very bad tool to use for this purpose. First, it copies everything, including unused sectors. Second, it results in an image that is the same size as the whole disk. Finally, you can not restore it to a smaller disk, and if you restore it to a larger disk, you must resize it after to use the additional space. –  psusi Mar 1 '11 at 3:26
    
actually, it's possible to zip the img file. It's also possible to just copy the files from inside the image file to a partition (did this with a system, worked!). So the destination partition can have any size. I'm not shure if it's possible to mount a zipped img file. –  sBlatt Mar 1 '11 at 11:23
    
it is not possible to mount a compressed image. –  psusi Mar 23 '11 at 17:45
add comment

dump and restore for ext4 (sudo apt-get install dump) were just designed for that matter. Check this if you are curious:

http://unix.stackexchange.com/a/41445

share|improve this answer
add comment

Why do you want to create an image? In most cases a file based backup (like a tar ball) gives you much more flexibility when restoring it, e.g. you can restore it on a different file system or even multiple file systems.

share|improve this answer
add comment

In addition to the filebased strategy: try the command rsync to backup your data.

A program similar to this is called Déjà Dup: https://launchpad.net/deja-dup

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.