Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Just use rsync -a in single user mode to copy everything. Exclude
- /dev*
- /proc/*
- /sys/*
- /tmp/*
- lost+found/
- /media/
and other directories with mountpoints that you don't want to copy.
Create them empty on destination filesystem with the same rights.
Use grub-install after operation, to configure boot loader in destination environment (or restore it after rollback)).
If you want an exact copy of your HD you can use dd.
dd if=/dev/sda (or whatever your device is) of=/dev/file.containing.HD.image
using /dev/sda will do an exact image of that drive wich will contain the partitions on that drive (sda1, sda2, etc...) and all its data.
If this is a true server using hardware this might complicate the usage of something like DD, especially if done without booting to the OS.If this really is critical data I would recommend you do a file level backup to another disk/share, which you can then verify easily from a different server. Then if you can shutdown and boot to a CD or something similar and do a DD to get a block level copy off to a different disk as well that wouldn't hurt.
But what interests me is that if this is a part of a cluster, why even bother? Everything should be replicated across all nodes, otherwise you would have serious problems with failing over or load balancing on the cluster nodes. Realistically all that should be on local dis is the OS and configuration files.
Is there anyway, i can backup everything on my server, and then revert back to the original system?
I use dump(8) and restore(8) for exactly this purpose.
Backup the filesystems (using snapshots if they're LVM2; otherwise, you may need to boot with a live CD to get good backups) and an easy-to-access copy of /etc/fstab.
Upgrade and/or make your changes.
If rollback is needed, boot with a live CD, create the filesystems, and restore(8).
Tape device optional. You can do all this over ssh(1).
If this is a true server using hardware this might complicate the usage of something like DD
Quite true, I wasn't thinking of RAID systems, just a simple HD.
Quote:
Originally Posted by ComputerErik
But what interests me is that if this is a part of a cluster, why even bother? Everything should be replicated across all nodes, otherwise you would have serious problems with failing over or load balancing on the cluster nodes. Realistically all that should be on local dis is the OS and configuration files.
Good point, if it were a [Heartbeat|OpenAIS]/Pacemaker cluster all servers should have the same files (clusterwise talking of course). But what about the rest of the files or services (if any) that may not be running through the cluster? maybe that is what he wants to backup too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.