LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Backup / Image of Linux Drive (http://www.linuxquestions.org/questions/linux-server-73/backup-image-of-linux-drive-614620/)

Visitek 01-18-2008 06:47 PM

Backup / Image of Linux Drive
 
I am using debian (without x) and I need a script that can be added to cron.weekly which will do a backup to an NTFS formatted drive

Can anyone tell me where I can find one or how to write it

Thanks - much appreciated

Ian

trickykid 01-19-2008 10:11 AM

rsync -a [source] [destination]

There, add all the paths of files you want in [source] and put them where you want them to go in [destination].

Be creative and make it more complex if you want, but don't make others write scripts for a setup/configuration they know nothing about and certainly don't know what files you need backed up.

Your title also mentioned to image a drive, are you wanting to take the whole drive image? If so, use dd but I wouldn't rely on dd as a backup, it's not reliable and there's not need to waste the time and space on a full disk image.

Visitek 01-20-2008 03:27 PM

Disk Image
 
Thanks

There, add all the paths of files you want in [source] and put them where you want them to go in [destination].

I found script that used rsync and the essence of it was:
rsync -rlt --delete --exclude=.* --modify-window=1 $backup_dir $backup_mount_point/$backup_target

This works and have tested successfully, however if not dd then what ( for the disk image)?

Your title also mentioned to image a drive, are you wanting to take the whole drive image? If so, use dd but I wouldn't rely on dd as a backup, it's not reliable and there's not need to waste the time and space on a full disk image.

I still would like to do this (I am a bit of a noob still) and replace my existing drive with (effectively a ghost image) copy of it.

jailbait 01-20-2008 04:09 PM

Quote:

Originally Posted by Visitek (Post 3029359)
I still would like to do this (I am a bit of a noob still) and replace my existing drive with (effectively a ghost image) copy of it.

Using dd to create ghost images is not a good idea for backup and recovery. You can back up and restore filesystems or parts of file systems and get a much stronger backup and recovery system than when you try to backup ghost images. I recommend that you use rsynch for backing up across a network and cp for backing up across drives on the same computer. If you are backing up to tape use tar. If you are backing up to CD or DVD use mkisofs and cdrecord. If you need to compress your backup use tar and bzip2. Compressing your backup saves storage space but it makes recovery more difficult and time consuming.

You can save a lot of computer time by using an update file system. You take a full backup the first time. Then on subsequent backups you only back up files that have changed since the previous backup.

So, like trickykid says people will come up with widely differing backup systems based on their individual needs and equipment available. I suggest that you describe the equipment you have available for backup and recovery and then develop a plan to back up your configuration. Then post the equipment list and plan here and we can help you refine it.

-------------------------------
Steve Stites

trickykid 01-20-2008 10:41 PM

dd is not a backup. I'd say it's best to use dd for moving one image from one location to the next on a case by case basis, nothing more and nothing less, that's all it's good for, ever. If you want to ghost the same image across multiple systems, go buy norton ghost or something just like it. ;)

JZL240I-U 01-28-2008 07:16 AM

Quote:

Originally Posted by trickykid (Post 3029725)
...I'd say it's best to use dd for moving one image from one location to the next on a case by case basis, nothing more and nothing less, that's all it's good for, ever....

I don't think AwesomeMachine would agree http://www.linuxquestions.org/questi...ommand-362506/

:p :D ;)

trickykid 01-28-2008 11:01 AM

Quote:

Originally Posted by JZL240I-U (Post 3037488)
I don't think AwesomeMachine would agree http://www.linuxquestions.org/questi...ommand-362506/

:p :D ;)

Actually I think he would. I see that post with a bunch of tips and hints to play with imaging, creating image files, etc. But I don't agree with the creation of images for backup purposes. Sure, you can create an image of a drive or partition with dd but it's not a good way to perform regular backups. It's unsafe, unreliable without integrity check that most other solutions will offer, etc. If you want data type backups with an easy way to restore or recover, from a single file or multiple files, dd is not for you and I still stand by my reasoning for not using it as a regular type backup solution.

I've been the primary backup administrator in each of my positions for the past 5 plus years. I've talked to just about every vendor that deals with backup and disaster recovery. I'm sure every admin I know would have a heart attack if they walked into a place that used dd as their primary backup solution, I know I would. ;)

But don't get me wrong, I love dd for all the other reasons and capabilities it has, but it's like RAID, its not a backup solution so don't treat it like one.

JZL240I-U 01-28-2008 11:10 AM

Quote:

Originally Posted by trickykid (Post 3037688)
...I see that post with a bunch of tips and hints to play with imaging, creating image files, etc.

Well it is a little bit more than that in my eyes but I don't want to nitpick ;).

Quote:

Originally Posted by trickykid (Post 3037688)
But I don't agree with the creation of images for backup purposes. ... I still stand by my reasoning for not using it as a regular type backup solution....But don't get me wrong, I love dd for all the other reasons and capabilities it has, but it's like RAID, its not a backup solution so don't treat it like one.

And here we entirely agree. I don't use if for backups either, I use rsnapshot with fcron but not dd.

dd certainly is a nifty tool for a variety of other purposes, and just for the record, AwesomeMachine did not propose it as backup tool so if I gave that impression that was my error and not his.

OracleSmith 06-13-2008 06:01 PM

I am very late to this thread, so I apologize.

I am trying to close all holes in my Linux Disaster Recovery plan. I am quite comfortable with our solution for basic data backups (hot and cold backups of databases, for instance). Also our offsite storage, etc.

In the Unix world, I used sysback to backup the OS and I don't really see an equivalent in the Linux world.

Ideally, I will have a bootable CD-ROM that will let me address a tape backup. Then I can restore an image which essentially lays down my Linux (RedHat) OS. Following this, I can use my backup software to restore databases, files, and so forth.

I am looking at the open source PartImage. I am also considering the Bare Metal tools from Tivoli and NetBackup. I can see where dd might be a good solution here.

Any thoughts for me?

JZL240I-U 06-17-2008 07:31 AM

I suggest you open your own thread with a title that conveys yous subject. In this old thread there is little chance that people look in.

For what it is worth (I'm no expert at all): If you use LVM you can make snapshots of your system anytime.

trickykid 06-17-2008 11:46 AM

Quote:

Originally Posted by OracleSmith (Post 3184126)
I am looking at the open source PartImage. I am also considering the Bare Metal tools from Tivoli and NetBackup. I can see where dd might be a good solution here.

Any thoughts for me?

dd is still not suitable for what you're describing. dd is not a backup tool, it's more of an imaging tool. Bare metal recoveries are where you can reinstall the OS or the base OS and then apply all the data that was there afterwards from backups. In your case and dealing with Oracle and probably other important data, you might want to go commercial like Netbackup or Tivoli, when they have built in tools to verify the data being backed up, something dd does not have. The only way to verify your backups with dd would be to randomly select a dd image you create and restore it to verify, which would be a painstakingly task as an administrator.

squeel 10-01-2008 07:31 AM

Its free and it works: Mondo Rescue at www.mondorescue.org.

The app can generate ISO images of your system's current configuration enabling you to restore it "exactly" as it is/was at the time of the ISO builds. Any dynamic data (databases etc.) could be lost during the ISO generation but these should be backed up using another process. I have used this app to successfully backup a Centos 5 dedicated Linux box that used LVM for partitioning. The restore to another machine with the same drive configuration was flawless. It even restores the "taskbar" with icons for each user.

I use it for "bare metal" restores so I generate ISO images and write them to a hard drive. Then I move them to a "Windows" box where I will use a Windows app to burn the ISO images. Why???? because while this app can burn directly to your CD/DVD drive it always failed on my hardware configuration. This is not an application problem. It has/had to do with my hardware. Also it generates more then one ISO image for me so burning directly would require that I be awake to shuffle discs in/out of the drive. It supports cron, etc. Spend some time with the documentation first. It does a lot.

Suggestion: make and burn ISO images of your current system (safe). Then restore to ANOTHER LINUX box to be sure that it works for you and that your backup accomplished what you wanted it to do. I would not want to rebuild my current online server and find out that while the app worked the write to disk was flawed or that my backup parameters did not "get everything".


All times are GMT -5. The time now is 08:05 PM.