Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 11-29-2006, 07:24 PM   #1
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
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
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,893

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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
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
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
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.
Old 11-30-2006, 04:18 PM   #7
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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
Registered: Nov 2005
Location: Canada
Distribution: Mint, Debian
Posts: 168

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
Senior Member
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
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
Registered: Apr 2005
Location: Brazil
Distribution: SUSE 9.0 Pro, SUSE OSS 10.0, KDE 3.4.2
Posts: 156

Rep: Reputation: 30
like befor said.


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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:28 PM.

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