LINK="#3366FF" VLINK="#A000A0">



(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to tag@lists.linuxgazette.net


(!) Regarding backups

Answer From Bruce Harada

Comments by Heather Stern

Hi. I read your answer to the person trying to backup their notebook's hard drive with tar. The way I do backups of my notebooks is as follows:

  1. Start the notebook up from a bootdisk floppy that includes support for network connectivity and NFS (I use Slackware's bootdisk/rootdisk/pcmcia three-disk combination, but it requires some fiddling with).
  2. Mount a directory from the computer you want to make the backup to (I'm leaving out the setup requirements for NFS (/etc/export, etc.), since if you want to use this method, you're probably familiar with them already). One thing you should probably be careful of is that the exported filesystem should use no_root_squash to avoid permission problems when writing the backup file.
  3. Say your laptop has its HD as /dev/hda, and you've mounted the remote directory as /tmp/mnt/backup/ on the notebook. Do the following:
     # dd if=/dev/hda of=/tmp/mnt/backup/notebook-hda
    
    This will send the entire contents of /dev/hda to the remote directory as a single file.
     
    One thing some people might be saying here is, "What if the notebook's HD is larger than 2GB?" Some Linux systems support files larger than 2GB, but NFS (at least V2; I don't know about V3) almost certainly doesn't. In that case, you can try:
     # dd if=/dev/hda | gzip >/tmp/mnt/backup/notebook-hda.gz
    
    which will compress it for you (hopefully to below the 2GB limit, although it's probably a good idea not to try this unless you're positive that the final file will come in under 2GB). Compressing it will take longer than you think it should, though, so be ready to wait a while.
  4. When you need to restore the backup, just use the bootdisk to start up the notebook, mount the exported filesystem as before, and do:
     # dd if=/tmp/mnt/backup/notebook-hda of=/dev/hda
    
    or, if you compressed it,
     # gunzip -c /tmp/mnt/backup/notebook-hda.gz | dd of=/dev/hda
    
    This backup takes care of everything, including partition tables and bootblocks, which (in my book) makes it much more reliable than tar. I've used it to back up some of my older notebooks, with around 500MB hard drives, and the final (compressed) file was about 350MB. Both backup and restore worked fine, without any problems.

    That's about it - I hope it's of help.

    -- Bruce Harada

    (!) [Heather] it's worth noting that this works best when restoring to the same size hard drives, or especially, the exact same drive; a larger one may leave its extra space invisible, a smaller one will have bits falling off the end, and some drives of the same approximate size have different geometries, so fdisk may think strangely of you :(
    However for backing up your own notebook to a stable desktop server it works great!


    This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
    Published in issue 64 of Linux Gazette March 2001
    HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


    [ Answer Guy Current Index ] greetings   1   2   3   4   6   7   9 [ Index of Past Answers ]
    11   12   15   16   18
    20   22   24   25   26   28   29