Solved

Adding a second drive to backup.

Posted on 2003-11-25
3
449 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now