?
Solved

what is the best way to backup a redhat box ?

Posted on 2009-02-08
8
Medium Priority
?
558 Views
Last Modified: 2016-10-27
I have a CD drive, a large hard drive with USB adapter.  I do have a copy of acronis as well as what ever is on the centos cd.   I said redhat in the title but it is really centos ( it is just a ssh jumpoff server )
0
Comment
Question by:itguy411
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 81

Assisted Solution

by:arnold
arnold earned 400 total points
ID: 23584498
Using acronis to image the drive is one option.  Using dump from centos is another.  Since you are only using this system as a jumpoff server, there isn't that much data on it to backup.
You could use an older workstation loaded with centos setup as a cluster.  This way if one system goes down, you still have a jumpoff server/system available.

What is the effect on your operations if this system goes down for 1 hour, 2 hours, 1 day etc.?
Centos can be installed over the net using the net-install option.
0
 

Author Comment

by:itguy411
ID: 23584511
What about just taring up the whole drive after I boot from CD.  What are the pro and cons of this?  What if I go to a different size drive ?   Do I have to record the exact partitioning of the hard drive ?  

I want to make darn sure the backup works and actually trying it is hard to do because I would need a drive to do this

To: "Gentian Hila" <genti.tech@gmail.com>, "General Red Hat Linux discussion list" <redhat-list@redhat.com>

tar -zcvf <backupname.tgz> <directories_to_backup - can be />
 
(man tar)
 
Careful, max file size is 2GB, so you may need to write a script to back up directories separately & make multiple tar files.
 
    -Tom
0
 
LVL 23

Accepted Solution

by:
Mysidia earned 800 total points
ID: 23585293
Is the large USB hard drive blank?
This works best if you have only 1 or 2 filesystems on your Linux box

I would suggest   type 'df' on your main system and  'fdisk -l'
take a look at how your current system's filesystems are laid out

(1) attach the drive
(2) Create a big first partition on the USB drive for 'data'
(3) Partition the rest of the USB drive similarly to how your live hard drive is partitioned
(4) Make ext3 filesystems on the partitions of the USB drive,
mkswap the partition on the USB drive that corresponds to your swap, etc.

(5) Reboot your system into single user mode

(6)  Mount each partition of your USB drive that corresponds to a partition on your main system,  one partition at a time

(7) i.e.  if you have mounted the usb partition on /mnt/usb, then

rsync -avl --progress --one-file-system  /mountpoint-on-your-system   /mnt/usb
umount /mnt/usb


The idea is to create an identical copy of your running system on the hard drive attached with USB.


Should you ever need to, you can then take the hard drive off the USB adapter, plug it into your system, boot from CD,  install grub,    change your kernel boot options   in /boot/grub/menu.lst to add a

root=/dev/XXXXXX  
line to specify the root filesystem

Edit  /etc/fstab  to the appropriate devices, etc.


I say that because CentOS by default uses a LVM setup,  and your USB setup will most likely either not use LVM, or you will need to name the volume group differently   (to avoid naming conflict with the system you're running on while creating the backup)

But essentially the result is a backup you can drop in.
It shouldn't be too hard to test this either.


You can drop a second copy or tarball of the root filesystem on the extra 'data' portion of the USB drive, or use rsnapshot for those portions,  which you update more frequently, to keep multiple backups,  and leave the "live backup"  portion unchanged, always ready to drop in.

0
 
LVL 23

Expert Comment

by:Mysidia
ID: 23585302
*Note that to make a partitioned USB drive bootable as live backup, it's necessary not only to tune /etc/fstab and kernel options, but also to install grub bootloader on the USB hard drive,  and mark the partition  'active'  in fdisk, when you want to boot from it.

Always keep Redhat system rescue CDs, and a Knoppix CD around.   Good idea to keep a memtest+ CD, ultimate boot CD, and other troubleshooting tools around also, for emergencies.
0
 
LVL 16

Assisted Solution

by:ai_ja_nai
ai_ja_nai earned 800 total points
ID: 23588290
>What about just taring up the whole drive after I boot from CD.  
I'd go for a dd of the partition and then for a tar of the created image, to save 0-padded space

>What are the pro and cons of this?  
This is imho the best solution because is exactly what acronis does at the lowest level

>What if I go to a different size drive ?
Keeping in mind that you can do it with just a bigger drive, not smaller, it depends. With simple tar you just fill up a preexisting filesystem (thus, discouraged).
With the dd image you can write up on a even bigger device and re-do a 1:1 copy of the original drive, without any complaints by the system.

>Do I have to record the exact partitioning of the hard drive ?  
A tar archive doesn't care about that, it just sucks up all the files it encounters in a single archive. So, you will have to care about it.
DD will remember the size, so you just have to look at it to find a fit partition before you start the recreation.

>I want to make darn sure the backup works and actually trying it is hard to do because I would need a drive to do this
Not at all: you can go for virtualization and reproduce your backed environment in a VirtualBox, in a Xen or in a VMWare and see it lighting up as normal...

>Careful, max file size is 2GB, so you may need to write a script to back up directories separately & make multiple tar files.
False. I've got 12GB tar archives at work. This guy pobably has been blocked by his own old filesystem's limitations
0
 

Author Comment

by:itguy411
ID: 23604942
So just booting on the Acronis cd my company provides is not a good way to back this up ?
0
 
LVL 16

Assisted Solution

by:ai_ja_nai
ai_ja_nai earned 800 total points
ID: 23606690
Nobody said this.
It seems that Acronis build a good piece of software (I say "it seems" because I really never tried that); simply I don't use it because I like free stuff and I feel more comfortable with it :)
0
 

Author Closing Comment

by:itguy411
ID: 31544239
Cool.  I am going to use acronis because it is simplest
0
Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
What's worse than having your data encrypted by ransomware? Getting attacked by a so-called "wiper," which simply destroys the data and offers you no hope of ever seeing it again.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question