From 51981686db3e3a033e9ca4f950bcba5bb619c6e7 Mon Sep 17 00:00:00 2001 From: ccurley <> Date: Wed, 12 Feb 2003 15:47:46 +0000 Subject: [PATCH] Changes because I added a new, separate script to mount the target drives. --- .../scripts/first.stage | 22 ++++++++++- .../scripts/make.dev.hda | 37 ++++++++++--------- .../scripts/restore.metadata | 8 ++-- 3 files changed, 43 insertions(+), 24 deletions(-) diff --git a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/first.stage b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/first.stage index 5f4ca180..985005f8 100755 --- a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/first.stage +++ b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/first.stage @@ -5,7 +5,7 @@ # only option is -c, which forces bad block checking during formatting # of the partitions. -# Time-stamp: <2002-07-25 14:22:03 ccurley first.stage> +# Time-stamp: <2003-01-09 11:32:59 ccurley first.stage> # Copyright 2002 through the last date of modification Charles Curley. @@ -40,5 +40,23 @@ for drive in $( ls make.dev.* ); do ./$drive $blockcheck; done -restore.metadata +# WARNING: If your Linux system mount partitions across hard drive +# boundaries, you will have multiple "mount.dev.* scripts. You must +# ensure that they run in the proper order, which the loop below may +# not do. The root partition should be mounted first, then the rest in +# the order they cascade. If they cross mount, you'll have to handle +# that manually. + +# The "ls -tr" will list the scripts in the order they are created, so +# it might be a good idea to create them (in the script save.metadata) +# in the order in which you should run them. + +for drive in $( ls -tr mount.dev.* ); do + ./$drive; +done + +./restore.metadata + +# People who are really confident may comment this line in. +# reboot \ No newline at end of file diff --git a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/make.dev.hda b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/make.dev.hda index 53510c8d..ed1979be 100755 --- a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/make.dev.hda +++ b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/make.dev.hda @@ -25,6 +25,16 @@ # For more information contact the author, Charles Curley, at # http://w3.trib.com/~ccurley/. + +export blockcheck=$1; + +if [ "$blockcheck" != "-c" ] && [ -n "$blockcheck" ] +then + echo "${0}: automated restore with no human interaction." + echo "${0}: -c: block check during file system making." + exit 1; +fi + dd if=/dev/zero of=/dev/hda bs=512 count=2 sync @@ -34,29 +44,20 @@ fdisk /dev/hda < dev.hda sync echo -echo formatting and checking /dev/hda1 -mkdosfs -c /dev/hda1 +echo formatting /dev/hda1 +mkdosfs $blockcheck /dev/hda1 # restore FAT boot sector. dd if=dev.hda1 of=/dev/hda1 bs=512 count=1 echo -echo formatting and checking /dev/hda2 -badblocks -c 128 -o /tmp/dev.hda2 /dev/hda2 -mke2fs -L /boot -l /tmp/dev.hda2 /dev/hda2 +echo formatting /dev/hda2 +mke2fs -j $blockcheck -L /boot /dev/hda2 echo -echo formatting and checking /dev/hda5 -badblocks -c 128 -o /tmp/dev.hda5 /dev/hda5 -mke2fs -L / -l /tmp/dev.hda5 /dev/hda5 +echo formatting /dev/hda3 +mke2fs -j $blockcheck -L / /dev/hda3 -mkswap -c /dev/hda6 +echo Making /dev/hda5 a swap partition. +mkswap $blockcheck /dev/hda5 - - -# / is the mountpoint for /dev/hda5. -mkdir /target/ -mount /dev/hda5 /target/ - -# /boot is the mountpoint for /dev/hda2. -mkdir /target/boot -mount /dev/hda2 /target/boot +fdisk -l "/dev/hda" diff --git a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/restore.metadata b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/restore.metadata index f256f2ff..377eb465 100755 --- a/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/restore.metadata +++ b/LDP/howto/docbook/Linux-Complete-Backup-and-Recovery-HOWTO/scripts/restore.metadata @@ -5,7 +5,7 @@ # and mounted. It also assumes the ZIP disk has already been # mounted. Mounting the ZIP disk read only is probably a good idea. -# Time-stamp: <2002-09-10 11:05:43 ccurley restore.metadata> +# Time-stamp: <2003-01-08 18:26:44 ccurley restore.metadata> # Copyright 2000 through the last date of modification Charles Curley. @@ -51,10 +51,10 @@ done # things. # If you boot via an initrd, make sure you build a directory here so -# the kernel can mount the initrd. +# the kernel can mount the initrd at boot. -for dir in mnt mnt/save mnt/zip mnt/cdrom mnt/floppy mnt/imports proc; do -mkdir $target/$dir +for dir in mnt/save mnt/zip mnt/cdrom mnt/floppy mnt/imports proc initrd; do +mkdir -p $target/$dir done chmod a-w $target/proc # Restore /proc's read-only permissions