mirror of https://github.com/tLDP/LDP
Changes because I added a new, separate script to mount the target drives.
This commit is contained in:
parent
ec80f4c4b2
commit
51981686db
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue