Can I "Back up" my system by copy and paste? (ext4)
Linux - GeneralThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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:
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.