LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-29-2006, 07:24 PM   #1
cr9c1
LQ Newbie
 
Registered: Nov 2005
Posts: 7

Rep: Reputation: 0
Making a backup of the entire LINUX OS


I've looked over a few options for making a backup of the entire linux os, pretty much a duplicate image of the drive. Some people have rsync scripts that does this, others use RAID, LVM, etc.

I need a fast, easy hack to make an image of my harddrive onto another harddrive, so in the event of failure, I can plug in a kernel boot disk or install lilo on the 2nd drive and just boot to it.

Anybody have any ideas, or an rsync script that would image drive c to drive d (hda to hdb)?

Or any other solutions that are easy to install and operate? I'm running Slackware 11.0
 
Old 11-29-2006, 08:01 PM   #2
hepburnenthorpe
Member
 
Registered: Jun 2006
Location: Sydney
Distribution: Gentoo + Debian
Posts: 132

Rep: Reputation: 15
check out man dd.
 
Old 11-29-2006, 08:01 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,782

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Suppose you have two hard drives: hda is the working drive; hdb is the backup drive. Hdb is large enough to hold the contents of hda.

Use the dd command to make a bit-for-bit mirror image of hda on hdb (including the MBR). Every time you use dd, it will overwrite the previous image.

In the event of a disaster on hda, just open the box and switch the jumpers, changing hda from master to slave, and hdb from slave to master. Then boot up.

Search these forums for discussion on the use of dd.
 
Old 11-30-2006, 05:37 AM   #4
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
As bigrigdriver said use the dd command. I have just recovered a drive that was dying on my server this way.;
Ideally you need to shutdown multiuser interfaces by doing as root;

int1 to take the system into single user mode and then do;

dd if=/dev/hda of=/dev/hdb bs=4k

interpretation; DiskDump InputFile=/dev/hda to OutputFile=/dev/hdb in chunks of 4kB

Read this in-depth summary Learn dd command

Last edited by TigerOC; 11-30-2006 at 05:38 AM.
 
Old 11-30-2006, 09:37 AM   #5
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
Use dd like these guys said to create the initial image, then use rsync to keep specific directories synced (ie: home dirs, documentroots, mailboxes, etc.)
 
Old 11-30-2006, 09:48 AM   #6
dohpaz
Member
 
Registered: Feb 2006
Location: Edmonton
Distribution: Slackware 12.2, Ubuntu
Posts: 117

Rep: Reputation: 16
You can use dd as others have suggested, and rsync is also great for incremental backups. I use a tool call G4U(Ghost for Unix) which uses dd I think. I like it because it allows me to easily make full image backups over the network to an ftp server. It also simplifies drive to drive backups as well.

http://www.feyrer.de/g4u/
 
Old 11-30-2006, 04:18 PM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
For those of you who are making image backups using dd, how are you managing to get a valid image of the 'system' partition(s), while the machine is running? Doesn't a partiton have to be unmounted before copying it's image?

--- rod.
 
Old 11-30-2006, 05:43 PM   #8
eerok
Member
 
Registered: Nov 2005
Location: Canada
Distribution: Debian
Posts: 167

Rep: Reputation: 32
I've used mondo on debian, and it works very well (though it's a little fussy) ... however, I see no official slack package for it. It's nice because it gives you a thoroughly verified bootable cd/dvd with your backup data and the restore tools on it.

I've also used tarballs for backups. I don't like dd because who knows what hardware or fs I'll end up restoring to? The more flexible a backup is, the more useful it is to me.
 
Old 11-30-2006, 06:45 PM   #9
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by theNbomr
For those of you who are making image backups using dd, how are you managing to get a valid image of the 'system' partition(s), while the machine is running? Doesn't a partiton have to be unmounted before copying it's image?

--- rod.
No, you can copy it whilst it is mounted; in my experiance the only problems are stray pid files.

You could also pipe the output of dd through gzip and into a file for a compressed backup. You'll then need a live cd to restore the backup.

As said you can use tar to backup the system, when you untar to your new filesystem on your new drive you'll need to install a mbr.

Last edited by phil.d.g; 11-30-2006 at 06:46 PM.
 
Old 11-30-2006, 06:45 PM   #10
Sören Schneider
Member
 
Registered: Apr 2005
Location: Brazil
Distribution: SUSE 9.0 Pro, SUSE OSS 10.0, KDE 3.4.2
Posts: 156

Rep: Reputation: 30
dd
like befor said.
http://www.linuxquestions.org/questi...d.php?t=362506
 
  


Reply

Tags
backup, image, linux, recovery, slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to backup the entire linux os to the dat tape drive cwng76 Linux - Software 1 07-12-2006 02:41 AM
How to backup entire system without shutting down andrewjschmidt Linux - General 6 06-01-2004 06:01 PM
Backup entire system with tar sln Linux - General 2 04-30-2004 03:32 AM
How can I backup my entire system? TheDirtyPenguin Linux - Software 5 03-16-2004 08:48 AM
Can u backup entire LFS in such way ?? sapilas Linux From Scratch 1 05-02-2002 01:26 PM


All times are GMT -5. The time now is 08:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration