LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   newbie wants to backup system before playing around... (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-wants-to-backup-system-before-playing-around-4175479785/)

davemcc 10-06-2013 07:34 AM

newbie wants to backup system before playing around...
 
Hopefully, this is an easy question. The system is red hat enterprise server 5.5. Kernel 2.6.18-194el5PAE
thx

Keith Hedger 10-06-2013 07:46 AM

Simplest solution is boot to a live cd mount the system you want to back up mount a drive thats got enough space to back everything up cd into the root of the system you want to back up and do:
Code:

tar -cvzf /path/to/mounted/disk/for/backup/systembackup.tar.gz .
When backing up a system like ythis do it as root.

To restore just do the reverse see the tar info/man page

edorig 10-06-2013 08:01 AM

It depends a bit on how much disk space you have to back up, whether you use RAID or not etc...
Moreover, it depends also whether you only want to backup user accounts or you want to restore
a full system in case to install of the new one goes wrong.
In the former case, you can do the following. I assume you
have a simple workstation, with a single disk not exceeding 1TB and USB 2.0 ports.
1) take an external 1TB HD and format it as ext3 (mkfs -t ext3 /dev/sdX1 )
2) mount it mount -t ext3 /dev/sdX1 /mnt
3) rsync -avz /home /mnt/home ; rsync -avz /etc /mnt/etc etc...

The important difference with the solution proposed by Keith Hedger is that in step 3 you
are only making a backup of user accounts, system configuration etc...

You could in principle back up in that manner the whole system by rsync -avz /bin /mnt/bin etc...
in order to restore it in case the install of the new OS fails, but then Keith Hedger's approach is better.

Keith Hedger 10-06-2013 08:17 AM

I agree with edorig you may only need to back up user accounts and configs if you have a full backup tool like rsync installed then by all means use that, the main advantage to using the tar approach is that it is available on just about every distro whether using live media or not and can therefore probably get you out of most bad situations, ideally though you should decide on what you are going to use for backups and then get into the habit of doing regular backups, if you don't you will eventually regret it! I know from experience!

I personally use the standard linux dump/restore apps statically linked on a rescue partition based on pmagic.

davemcc 10-06-2013 11:56 AM

Thx for your help
 
Thx, I am no hurry to start this. I will most likely follow your suggestions, but I will also do a little more research as well.

Stealth Bot 10-06-2013 04:09 PM

I would use clonezilla and a second hard drive either internal or external. Clonezilla is a specialty type distro for cloning filesystems. If you decide on this option watch a couple of youtube videos on using clonezilla.

The best part of this method is if you mess up your system, you don't need to reinstall the operating and configure files and services over again. All you do is restore the image file clonezilla created and your system will be fully restored as before.

Good luck

suicidaleggroll 10-06-2013 04:59 PM

For a one-time backup I would use a dd dump or clonezilla to create a mirror image of the drive, like Stealth Bot suggested. This makes restoration after a catastrophe simple and complete.

For regular backups, I would use a tool like rsync to just transfer over the modified/new files since the last backup and leave the rest alone, like edorig suggested. This makes backups efficient so you're not wasting time backing up the same files over and over again. Note that you can use this approach for the entire OS if you want, no need to just relegate it to a limited set of subdirectories.

It's all about using the right tool for the job.


All times are GMT -5. The time now is 12:29 AM.