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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-26-2012, 09:24 AM
|
#1
|
|
LQ Newbie
Registered: Aug 2011
Posts: 8
Rep: 
|
Can I "Back up" my system by copy and paste? (ext4)
I've got my linux laptop (CentOS 6) with many source-built applications, lots of modified configuration, and a few spare keywords in the grub config.
I'm hoping to (restore-ably) back up the entire system by simply copying all the files on the root partition, and the relevant ones in the /boot partition.
Is this do-able? is it straightforward?
Am I crazy? lol.
I know there are other backup options but I figured this may be easier to restore from.
|
|
|
|
05-26-2012, 09:33 AM
|
#2
|
|
Member
Registered: Apr 2012
Distribution: debian, gentoo
Posts: 53
Rep:
|
you can save image of entire partition including mbr. It's a most easy way. Acronis or dd can help you. Copy/paste doesn't restore main boot record.
|
|
|
1 members found this post helpful.
|
05-26-2012, 09:37 AM
|
#3
|
|
LQ Newbie
Registered: Aug 2011
Posts: 8
Original Poster
Rep: 
|
Quote:
Originally Posted by Teufel
you can save image of entire partition including mbr. It's a most easy way. Acronis or dd can help you. Copy/paste doesn't restore main boot record.
|
Yes of course, but would this only be required for the boot partition? or both? If simply copy/paste works for the root partition it would reduce the space needed (dd a drive of mostly empty space seems a bit overkill)
Having a separate boot partition has it's advantages, is this one of them?
|
|
|
|
05-26-2012, 05:40 PM
|
#4
|
|
Member
Registered: Apr 2012
Distribution: debian, gentoo
Posts: 53
Rep:
|
If you have two partitions (/boot and /) you can save root (/) as simple gzip archive. But I am not sure this way is correct for /boot. As well you can't save mbr in this manner.
Also you can combine dd with gzip in order to reduce image size (if you confused with empty space).
Something like this:
Code:
# dd if=/dev/sda conv=sync,noerror bs=64K | gzip -c > /mnt/sdb1/sda.img.gz
here /dev/sda is disk you want to backup, /mnt/sdb1 - destination partition for saving backup archive (usb stick/hard e.t.c.)
and how to restore it from archive:
Code:
# gunzip -c /mnt/sdb1/sda.img.gz | dd of=/dev/sda conv=sync,noerror bs=64K
Last edited by Teufel; 05-26-2012 at 05:42 PM.
|
|
|
|
05-26-2012, 10:00 PM
|
#5
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,230
|
Allow me to toss in dissenting view.
"dd" is absolutely unequivocally the worst option for backup. Especially with "noerror".
Use a filesystem aware tool like rsync or cp so you know if/when the source has errors. Better to find out right there, right then. Likewise, copying MBR is very dodgy - any change to partitions after the backup is just a disaster waiting to happen. Just reinstall the boot-loader (to the MBR, not a complete package re-install) after any restore.
Last edited by syg00; 05-27-2012 at 12:47 AM.
Reason: typo
|
|
|
|
05-27-2012, 04:24 AM
|
#6
|
|
Member
Registered: Apr 2012
Distribution: debian, gentoo
Posts: 53
Rep:
|
Yes, if you need just a files copy you can use cp, but cp doesn't give you image.
"conv=sync,noerror" option preserves real image size if some blocks are unreadable.
Also if you going to change your partitions (size, order, GUID e.t.c.), the best way to restore is just fresh installation from distribution media.
|
|
|
|
05-27-2012, 06:32 AM
|
#7
|
|
Moderator
Registered: May 2001
Posts: 24,805
|
I agree with the rsync option because with Centos, and basically any RPM-based installation, you wouldn't need backups of /bin, /sbin, /usr and those other areas that hold libraries, binaries, etc, etc the system only modifies on installation and update. RPMDB output should be enough to rebuild a system, leaving only contents that have changed like /boot/grub*, /selinux, /etc, /var (need some exclusions there as you don't need cache/yum for example), /root and /home. And if you rsync inside a script you can easily save the MBR to file and have it backed up as well.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:41 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|