Solved

Adding a second drive to backup.

Posted on 2003-11-25
3
456 Views
Last Modified: 2013-12-16
Hey guys,  (I'm a novice)

I've got a quick question.  I've been running a redhat 8.0 box for about 7 months now, and I haven't been backing anything up, and well I think I should probably look at doing that.  What I was thinking about doing is adding a second harddrive to the system, and having it be the system backup.  Like it if would copy the entire system on the second drive every day, or whatever.....not to clear on that, but formatting the machine, and setting up a raid config isn't a option for me right now.

Thanks

John Staggs
0
Comment
Question by:johnstaggs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9822005
I will suggest you to have a look here http://www.tldp.org/LDP/sag/backups.html so that you know how to backup your data/system into another media and this one http://www.biochemistry.unimelb.edu.au/pscotney/backup/Backup-HOWTO.html
0
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
ID: 9824265
Why not just convert the system to a RAID 1 configuration since you are adding a second drive. It's not difficult to convert a single drive system to s software RAID 1 configuration and you don't have to set up backup procedures.  The process that I use to do this looks like:

 1) Get a list of the partitions on the boot drive with 'fdisk -l
    /dev/hda'. Then create partitions with fdisk on the second drive
    of the same size and mark those partitions as being "Linux raid"
    (type fd in fdisk).

 2) Create /etc/raidtab listing entries for both drives and all
    partitions. Mark the current boot drive as failed.

 3) Execute mkraid on each md device you've defined in /etc/raidtab.

 4) Make a file system on each md device except the one used for swap. Specify
    the appropriate label (/, /home) for those file systems. For the swap
    device execute mkswap.

 5) Make an initrd image and make sure that Grub is configured to use it.

 6) For each file system on the boot disk use dump/restore to transfer those
    file systems to the corresponding md device. Note that you'll have to
    specify the device, not the mount point. E.G., use:

    mkdir /mnt/disk
    mount /dev/md0 /mnt/disk
    dump 0f - /dev/hda1 | (cd /mnt/disk; restore rf -)

    not:
   
    mount /dev/md0 /mnt/disk
    dump 0f - /boot | (cd /mnt/disk; restore rf -)
   
    It is safest to do the dump/restore in single user mode.

 7) Make a boot floppy (mkbootdisk)

 8) Mount the md device that contains /boot and edit grub.conf to set "root="
    to point to the correct md device. Also edit the fstab file on the md
    device to point swap to the correct md device.

 9) Reboot and you should be running off of the md devices. If something goes
    wrong you have the boot floppy.

10) Use fdisk to change the partition types on hda to be "Linux raid".

11) For each md device, execute 'raidhotadd /dev/md?'.

12) Edit /etc/raidtab and remove the 'failed flag' for hda.

Note:

grub-install seems to get confused by md devices. So to install grub in the
MBR you can use the grub shell. Execute grub and then use:

grub> root (hd0,0)
grub> setup --stage2=/boot/grub/stage2 --prefix=/grub (hd0)

Example raidtab:

# /boot
raiddev                /dev/md0
raid-level                1
nr-raid-disks                2
chunk-size                64k
persistent-superblock          1
nr-spare-disks                0
    device          /dev/hda1
    raid-disk     0
    device          /dev/hdb1
    raid-disk     1
# /
raiddev                /dev/md1
raid-level                1
nr-raid-disks                2
chunk-size                64k
persistent-superblock          1
nr-spare-disks                0
    device          /dev/hda2
    raid-disk     0
    device          /dev/hdb2
    raid-disk     1
# swap
raiddev                /dev/md2
raid-level                1
nr-raid-disks                2
chunk-size                64k
persistent-superblock          1
nr-spare-disks                0
    device          /dev/hda3
    raid-disk     0
    device          /dev/hdb3
    raid-disk     1
# /var
raiddev                /dev/md3
raid-level                1
nr-raid-disks                2
chunk-size                64k
persistent-superblock          1
nr-spare-disks                0
    device          /dev/hda5
    raid-disk     0
    device          /dev/hdb5
    raid-disk     1
# /home
raiddev                /dev/md4
raid-level                1
nr-raid-disks                2
chunk-size                64k
persistent-superblock          1
nr-spare-disks                0
    device          /dev/hda6
    raid-disk     0
    device          /dev/hdb6
    raid-disk     1
0
 

Author Comment

by:johnstaggs
ID: 9824478
I'll probably go ahead and just setup raid 1 on the system..since that is the *correct* thing to do in this case, thanks for your help jlevie!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

724 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