Solved

Adding a second drive to backup.

Posted on 2003-11-25
3
451 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Ubuntu - Volume "boot" has only 0 bytes disk space remainig 6 64
AWS ELB 5 78
cannot rename datastore 3 48
What is linux 4.8.22? Is it the same as ubuntu 16.10 ?? 2 40
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

810 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