[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How do people on this list backup stuff?

> I am curious to find out how people back stuff? Specifically
> I am interested in finding out whether it is necessary
> to use a tape system or is it also possible to use another
> hardrive. Afterall, it would appear a hardrive is cheaper
> than a *quality* tape system? 

Before I tell you what I do to make a perfect and bootable copy of your
current Linux setup, let me tell you how I have my hard drives configured.

For my everyday setup, I go into the BIOS setup program and turn off all
IDE support and boot from a SCSI hard drive using /dev/sda6.  I keep my
backup on the IDE hard drive /dev/hda.  Thus, to boot my backup, all I
have to do is go into the BIOS setup program and enable IDE support.  When
IDE is enabled, the computer will boot from /dev/hda.  Thus, if my Linux
partition ever crashes, I don't have to boot a stripped down version of
Linux from floppy.  Instead, I get the full blown version in the state it
was in at the time of the last backup. 

The trick is to get your current Linux setup (hereinafter known as
/dev/sda6) over to your backup partition (hereinafter know as /dev/hda1) 
and then to make it bootable.  Be extra careful with the "make it
bootable" partion of what follows because it entails installing LILO
which, if done improperly, can have very serious ramifications. 


(Paul Serice, copyright 1997, use at your own risk, and analogize for
your setup!) 

1) Format your backup partition:  "mke2fs /dev/hda1"  (Of course, if your
   backup partition is other than hda1, then use it instead.  Needless to 
   say, this step is irreversible so get it right.)

2) Mount the newly formatted partition:  "mount -t ext2 /dev/hda1 /mnt"

3) I'm not sure if this next step is necessary, but delete the
"lost+found" directory on the newly formatted partition.
     a) "cd /mnt"
     b) "rm -r lost+found"

4) Make an exact copy of your Linux setup and put it on your backup
     a) "cd /"
     b) "find / -xdev -print | cpio -pdam /mnt"

   NOTE: I found this method in _Unix Unleashed_.  I think it is superior
         to using tar and gzip. 
5) Make your backup bootable:

     a) Edit /mnt/etc/fstab (*not* /etc/fstab).

        This file tells Linux which partition you want to use as your
        root partition.  You need to let Linux know you'll be booting
        to /dev/hda1 as your root partition instead of to /dev/sda6.
        To accomplish this, you just delete the "/dev/sda6" and replace
        it with "/dev/hda1" leaving the rest of that line like you
        found it.

     b) Edit /mnt/etc/lilo.conf (*not* /etc/lilo.conf).

        Near the top of this file find and edit (or create) the lines that
        say "boot=/dev/sda6" and "root=/dev/sda6".  The first line tells
        lilo where to install itself (in this case lilo installs itself
        into the extended partion /dev/sda6.  The second line tells
        lilo that the root partition will be /dev/sda6.

        On my system, I boot the backup straight from the Master Boot
        Record.  Thus, I edit the "boot=" parameter to read 
        "boot=/dev/hda".  Because the root is /dev/hda1, the "root="
        parameter becomes "root=/dev/hda1.  Analogize as necessary.

     c) Now, tell lilo to install itself.

        At this point, you should understand something about lilo.  If you
        are installing lilo for /dev/hda1, it needs to have /dev/hda1
        mounted as the root partition.  Thus, if you just type "lilo",
        lilo will read /etc/lilo.conf and see your original Linux setup
        instead of your Linux backup.  If you run lilo with the -r
        parameter, lilo will temporarily switch the root partition to the
        one you specify.

        To do this, type "lilo -r /mnt".

        NOTE: Because using lilo can be destructive I suggest you first
        run lilo using "lilo -r /mnt -v -v -v -t".  This will run lilo
        and show you what it will do without making any changes to your

6) To restore from your backup, just boot to /dev/hda1 and use it as your

IMPORTANT:  It's a good idea to have a floppy which will let you boot
directly to your root Linux partition when your MBR gets futzed.  (I use
this diskette to boot my original Linux partition so that I may back it up
because, once the IDE hard drive is on-line, the BIOS will try to boot my
backup skipping the normal bootup procedure of reading the MBR on the
SCSI.)  To create this diskette, if your kernel is /vmlinuz then 1)
"fdformat /dev/fd0H1440" to low-level format a floppy.  (See "man
fdformat" and "man mknod" to create /dev/fd0H1440 if you don't have this
device already.)

Good Luck
Paul Serice

This message was delayed because the list mail delivery agent was down.

Reply to: