Backup / Restore on Centos

Any step by step guideline to backup / restore Centos server ? I'm looking for the cheapest way to have the whole server backup and I could consider using a USB portal hdd to archieve my purpose.

Thanks
AXISHKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

farzanjCommented:
Command

rsync -auz  source destination


It the destination is another computer, it should have sshd service running on it.

It is similar to ssh but different in that it transfers files that changed since last backup.

Option -z compresses traffic over the network
0
AXISHKAuthor Commented:
Sorry, not really familer with Centos. How to enable sshd and rsync ? Any more detail steps ?

Great Thanks.
0
farzanjCommented:
Check if ssh is installed
rpm -qa | grep ssh

If you have openssh-server rpm, you need to install it.
yum install *ssh*

If you have it, start it
service sshd restart

Make it persist after reboot
chkconfig sshd on

It should be ready to accept connections.  So you can scp or rsync to this server now.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

AXISHKAuthor Commented:
Rsync doesn't work, do I need to install it. However, I could run scp. Are they the same ?

Do I need to do anything if I plug a USB portal HDD on the centos before I could use it as a backup ?

Thanks
0
farzanjCommented:
See if you have rsync utility
rpm -qa | grep rsync

If the above command does not return anything, run this

yum install rsync

Scp and rsync both run on top of ssh.  They are very similar except that rsync would check to compare the destination and tries to send only modifications, thus saving effort for back ups
0
AXISHKAuthor Commented:
Thanks, one more check, do I need to do anything before a USB HDD is recongized by Centos.

0
farzanjCommented:
You need to mount it normally.  If you could not find it on the GUI, ask about it
0
AXISHKAuthor Commented:
Sorry, no GUI is enable. Kindly advise the steps to mount it,

Tks again.
0
farzanjCommented:
Show me the output of the following

lshal | grep 'block.device'

Then I will be in a position to advise
0
AXISHKAuthor Commented:
[root@ippbx ~]# lshal | grep 'block.device'
  block.device = '/dev/sda'  (string)
  block.device = '/dev/sda1'  (string)
  block.device = '/dev/sda2'  (string)
  block.device = '/dev/sda3'  (string)
  block.device = '/dev/sdb'  (string)
  block.device = '/dev/sdb1'  (string)
  block.device = '/dev/sdb2'  (string)
  block.device = '/dev/sdb3'  (string)
  block.device = '/dev/scd0'  (string)


Tks
0
farzanjCommented:
Do you have anything in /media?

If not, good.

Then do this
mount /dev/scd0 /media

cd /media

ls

Did I choose the correct one?
0
AXISHKAuthor Commented:
[root@ippbx /]# mount /dev/scd0 /media
mount: No medium found
[root@ippbx /]#


What's the /dev/scd0 ? What's the purpose of this command ?

Thanks
0
farzanjCommented:
Ok.

Does your USB have three partitions on it?

Try:

mount /dev/sdb1 /media

cd /media
ls

If it is not, remove it with command
cd -
umount /media


0
farzanjCommented:
Lets see if it is even getting recognized or not.

Do this.
Put your USB and make sure it is in properly
The issue the above command as
'

 
lshal | grep 'block.device

Open in new window


Now remove it and issue the above command again.

I want to see both outputs
0
madunixCommented:
-http://amanda.zmanda.com/  amanda is a great backup solution, if you're willing to spend the time to learn how to set it up and so on.  It works very well, and there's good support from their mailing list.

-Backuppc is also a nice solution for backups for a nice how to(debian) but it should work on all linux as well check out http://www.debian-administration.org/articles/588
http://www.linux-magazine.com/w3/issue/105/060-061_kurt.pdf

-check bacula http://www.bacula.org
http://www.linux-magazine.com/w3/issue/57/Bacula_Backup_System.pdf

-http://clonezilla.org/
Free (GPL) Software.
Filesystem supported: ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS of MS Windows, and HFS+ of Mac OS. Therefore you can clone GNU/Linux, MS windows and Intel-based Mac OS, no matter it's 32-bit (x86) or 64-bit (x86-64) OS. For these file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.
LVM2 (LVM version 1 is not) under GNU/Linux is supported.
Multicast is supported in Clonezilla SE, which is suitable for massively clone. You can also remotely use it to save or restore a bunch of computers if PXE and Wake-on-LAN are supported in your clients.

-mondo
http://www.mondorescue.org/
Mondo is comprehensive. Mondo supports LVM 1/2, RAID, ext2, ext3, ext4, JFS, XFS, ReiserFS, VFAT, and can support additional filesystems easily: just e-mail the mailing list with your request. It supports software raid as well as most hardware raid controllers. It supports adjustments in disk geometry, including migration from non-RAID to RAID. Mondo runs on all major Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo) and is getting better all the time. You may even use it to backup non-Linux partitions, such as NTFS.
Mondo is free! It has been published under the GPL v2 (GNU Public License), partly to expose it to thousands of potential beta-testers but mostly as a contribution to the Linux community.


- rsync scripting

- netcat
On the source server: (cd / && tar -cvf - ) | nc 192.168.1.2 2000
On the destination:: nc -l -p 2000 | tar -xvf -
0
AXISHKAuthor Commented:
Before Insert USB
[root@ippbx ~]# lshal | grep 'block.device'
  block.device = '/dev/sda'  (string)
  block.device = '/dev/sda1'  (string)
  block.device = '/dev/sda2'  (string)
  block.device = '/dev/sda3'  (string)
  block.device = '/dev/sdb'  (string)
  block.device = '/dev/sdb1'  (string)
  block.device = '/dev/sdb2'  (string)
  block.device = '/dev/sdb3'  (string)
  block.device = '/dev/scd0'  (string)
[root@ippbx ~]#


After insert USB
[root@ippbx ~]# lshal | grep 'block.device'
  block.device = '/dev/sdc'  (string)
  block.device = '/dev/sdc1'  (string)
  block.device = '/dev/sda'  (string)
  block.device = '/dev/sda1'  (string)
  block.device = '/dev/sda2'  (string)
  block.device = '/dev/sda3'  (string)
  block.device = '/dev/sdb'  (string)
  block.device = '/dev/sdb1'  (string)
  block.device = '/dev/sdb2'  (string)
  block.device = '/dev/sdb3'  (string)
  block.device = '/dev/scd0'  (string)


So, the command to mount the USB should be

mount /dev/sdc /media  Or

mount /dev/sdc1 /media

correct ?

Thanks
0
farzanjCommented:
Yes, I would go for

mount /dev/sdc1 /media

This should do it.

It it complains for type of file system issue this command

mount -t vfat /mdev/sdc1 /media
0
farzanjCommented:
Sorry typo in the last command
mount -t vfat /dev/sdc1 /media
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Tks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.