Creating image of / partition for disaster recovery
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Creating image of / partition for disaster recovery
Hello folks,
This forum's never led me down.. All my queries got solved..
Now, i need little help here.
I want to image my / partition so as if something goes wrong, i can just restore the image. In windows, i used Macrium Reflect which worked flawlessly.
How do i do this in Ubuntu 10.10?
Googling yielded some results like use partimage or ddrescue etc. but i'm confused.
Can anyone guide me through the process?
Thanks
I just boot a live Linux CD and use tar to make a copy of the partition.
You could also use Clonezilla booted from a live CD.
It is possible to make a backup of the root file system while the system is running but I don't like to back up a live system.
I also like to make a backup of the MBR before I do the system backup. I usually only do this once when the system is first installed. I put the backup of the MBR into the /root directory or the / directory. Now if I have to replace the disk drive I can restore the MBR boot code from the backup in the file system.
Last edited by stress_junkie; 04-26-2011 at 10:54 AM.
I just boot a live Linux CD and use tar to make a copy of the partition.
You could also use Clonezilla booted from a live CD.
It is possible to make a backup of the root file system while the system is running but I don't like to back up a live system.
I also like to make a backup of the MBR before I do the system backup. I usually only do this once when the system is first installed. I put the backup of the MBR into the /root directory or the / directory. Now if I have to replace the disk drive I can restore the MBR boot code from the backup in the file system.
I read the tar method.. But won't it take much space sitting around? And won't imaging system partition back up the mbr even? If not, how do i do it?
Last edited by EzioAuditore; 04-26-2011 at 11:12 AM.
I read the tar method.. But won't it take much space sitting around?
Not if you use gzip to make the archive file. Many of the files are ASCII text so they will compress very well.
Code:
tar -cz <etc>
Adding the z to the tar command will automatically feed the files through gzip to compress them before they are added to the archive file.
So if I had booted a live Linux CD such as the System Rescue CD, and if I had mounted my installed Linux partition under /mnt/sda2, and if I had mounted my external disk drive backup partition under /mnt/backup then the following would create a good backup of the installed Linux root file system in a file called archive.tgz on the external disk drive.
Code:
cd /mnt/sda2
tar -czvf /mnt/backup/archive.tgz .
Last edited by stress_junkie; 04-26-2011 at 11:14 AM.
The steps to restore onto the same disk are very similar.
Boot a live Linux CD.
Mount the external disk partition holding the archive file to /mnt/backup.
Mount the partition intended to hold the root file system to /mnt/sda2.
Then do this:
Code:
cd /mnt/sda2
tar -xzvf /mnt/backup/archive.tgz .
This will not restore the MBR. That can be recreated by chrooting into the restored file system and running update-grub and grub-install.
If you are restoring the entire archive then you will need to format the destination partition before trying to write the backup files onto it.
Last edited by stress_junkie; 04-26-2011 at 06:29 PM.
I like fsarchiver for backing up a partition. Never had a problem with it. Unlike partition magic, fsarchiver can restore to a partition smaller than the original as long as there's enough space for the uncompressed filesystem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.