Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17th December 2010, 02:28 PM
zkab Offline
Registered User
 
Join Date: Oct 2009
Posts: 71
linuxchrome
Backup image

I migrated from Debian to Fedora some times ago ... and am very pleased with Fedora 14
Since Fedora has ext4 file system (Debian has ext3) I have following questions:

1) I want to create a disk image as backup that I store on a networked drive and if something goes very wrong - disk crash (hopefully not) - I want to restore it
2) df gives:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_zkab-lv_root
51606140 5237160 45844824 11% /
tmpfs 4094796 712 4094084 1% /dev/shm
/dev/sda1 495844 68878 401366 15% /boot
/dev/mapper/vg_zkab-lv_home
245418184 66565248 166386352 29% /home

3) Can I just create a disk image with:
dd if=/dev/sda1 of=/disk2.img
gzip disk2.img
and then save 'disk2.img.gz' on a networked disk
4) Will there be any problems with files in use during the dd operation ?
5) Do I restore it with following: a) make a basic installation with Fedora on the crashed disk and b) dd if=disk2.img of=/dev/sda1
6) Or should I use 'dd if=/dev/sda' instead ... to get it right when restoring ... I am not sure about LMV /dev/mapper stuff

Appreciate some guidelines how to proceed ...
Reply With Quote
  #2  
Old 18th December 2010, 05:01 PM
mk27's Avatar
mk27 Offline
Registered User
 
Join Date: Dec 2008
Posts: 87
linuxfedorafirefox
Re: Backup image

Quote:
Originally Posted by zkab View Post
3) Can I just create a disk image with:
dd if=/dev/sda1 of=/disk2.img
gzip disk2.img
Yep, that is a fine way to do it. However, obviously "disk2.img" cannot be on /dev/sda1, so if that is where your root filesystem is when you do this, you will need to use a path to a different device, large enough to hold the image. Also, use "bs=1024".

Quote:
4) Will there be any problems with files in use during the dd operation ?
No. However, one problem with doing this while you are using the system is that the state of many system files, and virtual things like proc, will be very different than they are when the system boots. Since the only way this image could be used would be if you were to replace another install with it, you will be booting into it, but those system files will not be correct. That may not be much of an issue -- it's the same thing as would happen if you pulled the plug without halting. Usually fine, occasionally a problem.

Ie, if you have a second installation on the computer, or a bootable CD-ROM or something you can use, do it from there instead of from "inside" the system itself.

Quote:
5) Do I restore it with following: a) make a basic installation with Fedora on the crashed disk and b) dd if=disk2.img of=/dev/sda1
Just the second part (dd again). That's all. There is no point in installing anything to the disk first because you will be overwriting it. That means you definitely cannot do this if you are booted into a system on /dev/sda1. You MUST do it from somewhere else, such as a bootable CDROM. I've done this more than a few times, it works perfectly. You can actually take an image of an entire device (inc. all partitions) this way.

However, you might instead want to check out something called "rsnapshot", which is a very clever and simple way to backup the drive. Whenever you want a fresh backup, you just run the command, "rsnapshot", which makes it very very easy to do. This will also spare you the hassle of having to use a second system if you don't have one available.

http://rsnapshot.org/
Reply With Quote
  #3  
Old 19th December 2010, 11:06 AM
zkab Offline
Registered User
 
Join Date: Oct 2009
Posts: 71
linuxchrome
Re: Backup image

Thanks for your excellent explanation. ... I will study rsnapshot ...
I am also looking at dd_rescue which seems more powerful than dd and ddrescue.

So what do you think about:
dd_rescue /dev/sda1 - | bzip2 > /location_of_my_networked_device/backup_img.bz2

Will it work ?

I will run the backup via cron during nighttime ... so basically my system is doing nothing ... except the backup

Last edited by zkab; 19th December 2010 at 11:10 AM. Reason: Added information
Reply With Quote
  #4  
Old 19th December 2010, 05:23 PM
mk27's Avatar
mk27 Offline
Registered User
 
Join Date: Dec 2008
Posts: 87
linuxfedorafirefox
Re: Backup image

Quote:
Originally Posted by zkab View Post
Thanks for your excellent explanation. ... I will study rsnapshot ...
I am also looking at dd_rescue which seems more powerful than dd and ddrescue.
I don't know why you would want to use ddrescue instead of dd unless you suspect your hard drive has bad blocks or will produce read errors for some reason, which if it does you should not be using the drive anyway.

Quote:
Originally Posted by zkab View Post
So what do you think about:
dd_rescue /dev/sda1 - | bzip2 > /location_of_my_networked_device/backup_img.bz2

Will it work ?
It should, try it.
Reply With Quote
  #5  
Old 20th December 2010, 03:23 PM
zkab Offline
Registered User
 
Join Date: Oct 2009
Posts: 71
linuxchrome
Re: Backup image

The reason for using dd_rescue was that I read somewhere that of= for dd can't be a networked device ... maybe I am wrong
So basically I want to do this ... if it works

dd if=/dev/sda1 bs=1024 | gzip -9 | dd of=/location_of_my_networked_device/backup.img.gz

The disk /dev/sda1 has nfs mounted volume that I don't want to include in the dd operation ... how do I exclude these nfs volumes ?

Last edited by zkab; 20th December 2010 at 03:54 PM.
Reply With Quote
  #6  
Old 20th December 2010, 05:28 PM
mk27's Avatar
mk27 Offline
Registered User
 
Join Date: Dec 2008
Posts: 87
linuxfedorafirefox
Re: Backup image

Quote:
Originally Posted by zkab View Post
The reason for using dd_rescue was that I read somewhere that of= for dd can't be a networked device ...
Could be, I was not aware of this.

Quote:
Originally Posted by zkab View Post
The disk /dev/sda1 has nfs mounted volume that I don't want to include in the dd operation ... how do I exclude these nfs volumes ?
You can't using that method. You will certainly be happier in the long run if you use rsnapshot instead -- transferring your entire harddrive every night is a lot of wasted resources. Rsnapshot does a smart ananlysis and only saves things that have changed since the last backup. Also it should allow you to exclude directories.
Reply With Quote
  #7  
Old 20th December 2010, 05:31 PM
zkab Offline
Registered User
 
Join Date: Oct 2009
Posts: 71
linuxchrome
Re: Backup image

OK - I will follow your advice and go for rsnapshot
Thanks for your help
Reply With Quote
Reply

Tags
backup, image

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora backup image and recovery xprezons Using Fedora 9 9th March 2009 11:49 PM
Size of Ext3 backup image tvoltagg Using Fedora 10 16th June 2008 12:22 AM
possible to run image backup of running system? DennyCrane Using Fedora 2 4th May 2008 02:16 AM
How to backup image using Acronis? d_GeNeRiT Using Fedora 0 28th January 2006 02:56 AM


Current GMT-time: 22:17 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat