LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-26-2011, 10:46 AM   #1
EzioAuditore
Member
 
Registered: Mar 2011
Posts: 45

Rep: Reputation: 0
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
 
Old 04-26-2011, 10:51 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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.
 
Old 04-26-2011, 10:51 AM   #3
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
use the parted magic live cd or system rescue CD

Start gparted

highlight partition
copy

paste in free space somewhere else (in another hdd usually)

Do not do this from within Ubuntu


(With clonezilla whole hard disk can be cloned)
 
Old 04-26-2011, 11:06 AM   #4
EzioAuditore
Member
 
Registered: Mar 2011
Posts: 45

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stress_junkie View Post
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.
 
Old 04-26-2011, 11:09 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by EzioAuditore View Post
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.
 
Old 04-26-2011, 11:27 AM   #6
EzioAuditore
Member
 
Registered: Mar 2011
Posts: 45

Original Poster
Rep: Reputation: 0
And the steps to restore it?
 
Old 04-26-2011, 06:26 PM   #7
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by EzioAuditore View Post
And the steps to restore it?
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.
 
Old 04-30-2011, 03:06 PM   #8
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
live disaster recovery image kaplan71 Linux - Software 2 04-06-2010 03:49 PM
Creating a GHOST image of my ext3 partition mario_er Mandriva 9 02-28-2009 07:35 AM
disaster and recovery SolarisZen Linux - Hardware 1 12-21-2007 06:50 AM
Creating dd image Win2k Partition with split sr_25 Linux - Newbie 5 07-08-2007 10:32 PM
Disaster Recovery souperdad Linux - General 4 11-10-2004 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration