Update Emergency Restore Procedure section to use the livefs CDROM

instead of a fixit floppy (the given fixit floppy build procedure does
not work).  I had this change on my todo list since 2003...

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
Security:
This commit is contained in:
Marc Fonvieille 2010-08-21 20:49:54 +00:00
parent 2807eac095
commit c7bf2534e7
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=36296

View file

@ -2686,187 +2686,36 @@ sa0(ncr1:4:0): Logical unit is in process of becoming ready</screen>
two copies of
each.</para>
<indexterm><primary>fix-it floppies</primary></indexterm>
<para>Second, determine that the boot and fix-it floppies
(<filename>boot.flp</filename> and <filename>fixit.flp</filename>)
have all your devices. The easiest way to check is to reboot your
machine with the boot floppy in the floppy drive and check the boot
messages. If all your devices are listed and functional, skip on to
step three.</para>
<para>Otherwise, you have to create two custom bootable
floppies which have a kernel that can mount all of your disks
and access your tape drive. These floppies must contain:
<command>fdisk</command>, <command>bsdlabel</command>,
<command>newfs</command>, <command>mount</command>, and
whichever backup program you use. These programs must be
statically linked. If you use <command>dump</command>, the
floppy must contain <command>restore</command>.</para>
<indexterm><primary>livefs CD</primary></indexterm>
<para>Second, burn a <quote>livefs</quote> CDROM. This CDROM
contains support for booting into a &os;
<quote>livefs</quote> rescue mode allowing the user to
perform many tasks like running &man.dump.8;,
&man.restore.8;, &man.fdisk.8;, &man.bsdlabel.8;,
&man.newfs.8;, &man.mount.8;, and more. Livefs CD image for
&os;/&arch.i386;&nbsp;&rel.current;-RELEASE is available
from <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/releases/&arch.i386;/ISO-IMAGES/&rel.current;/&os;-&rel.current;-RELEASE-&arch.i386;-livefs.iso"></ulink>.</para>
<para>Third, create backup tapes regularly. Any changes that you make
after your last backup may be irretrievably lost. Write-protect the
backup tapes.</para>
<para>Fourth, test the floppies (either <filename>boot.flp</filename>
and <filename>fixit.flp</filename> or the two custom bootable
floppies you made in step two.) and backup tapes. Make notes of the
procedure. Store these notes with the bootable floppy, the
<para>Fourth, test the <quote>livefs</quote> CDROM
you made in step two and backup tapes. Make notes of the
procedure. Store these notes with the CDROM, the
printouts and the backup tapes. You will be so distraught when
restoring that the notes may prevent you from destroying your backup
tapes (How? In place of <command>tar xvf /dev/sa0</command>, you
might accidentally type <command>tar cvf /dev/sa0</command> and
over-write your backup tape).</para>
<para>For an added measure of security, make bootable floppies and two
<para>For an added measure of security, make <quote>livefs</quote> CDROM and two
backup tapes each time. Store one of each at a remote location. A
remote location is NOT the basement of the same office building. A
number of firms in the World Trade Center learned this lesson the
hard way. A remote location should be physically separated from
your computers and disk drives by a significant distance.</para>
<example>
<title>A Script for Creating a Bootable Floppy</title>
<programlisting><![ CDATA [#!/bin/sh
#
# create a restore floppy
#
# format the floppy
#
PATH=/bin:/sbin:/usr/sbin:/usr/bin
fdformat -q fd0
if [ $? -ne 0 ]
then
echo "Bad floppy, please use a new one"
exit 1
fi
# place boot blocks on the floppy
#
bsdlabel -w -B /dev/fd0c fd1440
#
# newfs the one and only partition
#
newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 5 -o space /dev/fd0a
#
# mount the new floppy
#
mount /dev/fd0a /mnt
#
# create required directories
#
mkdir /mnt/dev
mkdir /mnt/bin
mkdir /mnt/sbin
mkdir /mnt/etc
mkdir /mnt/root
mkdir /mnt/mnt # for the root partition
mkdir /mnt/tmp
mkdir /mnt/var
#
# populate the directories
#
if [ ! -x /sys/compile/MINI/kernel ]
then
cat << EOM
The MINI kernel does not exist, please create one.
Here is an example config file:
#
# MINI -- A kernel to get FreeBSD onto a disk.
#
machine "i386"
cpu "I486_CPU"
ident MINI
maxusers 5
options INET # needed for _tcp _icmpstat _ipstat
# _udpstat _tcpstat _udb
options FFS #Berkeley Fast File System
options FAT_CURSOR #block cursor in syscons or pccons
options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device
options NCONS=2 #1 virtual consoles
options USERCONFIG #Allow user configuration with -c XXX
config kernel root on da0 swap on da0 and da1 dumps on da0
device isa0
device pci0
device fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
device fd0 at fdc0 drive 0
device ncr0
device scbus0
device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr
device npx0 at isa? port "IO_NPX" irq 13 vector npxintr
device da0
device da1
device da2
device sa0
pseudo-device loop # required by INET
pseudo-device gzip # Exec gzipped a.out's
EOM
exit 1
fi
cp -f /sys/compile/MINI/kernel /mnt
gzip -c -best /sbin/init > /mnt/sbin/init
gzip -c -best /sbin/fsck > /mnt/sbin/fsck
gzip -c -best /sbin/mount > /mnt/sbin/mount
gzip -c -best /sbin/halt > /mnt/sbin/halt
gzip -c -best /sbin/restore > /mnt/sbin/restore
gzip -c -best /bin/sh > /mnt/bin/sh
gzip -c -best /bin/sync > /mnt/bin/sync
cp /root/.profile /mnt/root
chmod 500 /mnt/sbin/init
chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt
chmod 555 /mnt/bin/sh /mnt/bin/sync
chmod 6555 /mnt/sbin/restore
#
# create minimum file system table
#
cat > /mnt/etc/fstab <<EOM
/dev/fd0a / ufs rw 1 1
EOM
#
# create minimum passwd file
#
cat > /mnt/etc/passwd <<EOM
root:*:0:0:Charlie &:/root:/bin/sh
EOM
cat > /mnt/etc/master.passwd <<EOM
root::0:0::0:0:Charlie &:/root:/bin/sh
EOM
chmod 600 /mnt/etc/master.passwd
chmod 644 /mnt/etc/passwd
/usr/sbin/pwd_mkdb -d/mnt/etc /mnt/etc/master.passwd
#
# umount the floppy and inform the user
#
/sbin/umount /mnt
echo "The floppy has been unmounted and is now ready."]]></programlisting>
</example>
</sect3>
<sect3>
@ -2879,23 +2728,16 @@ echo "The floppy has been unmounted and is now ready."]]></programlisting>
<para>If the hardware has been damaged, the parts should be replaced
before attempting to use the computer.</para>
<para>If your hardware is okay, check your floppies. If you are using
a custom boot floppy, boot single-user (type <literal>-s</literal>
at the <prompt>boot:</prompt> prompt). Skip the following
paragraph.</para>
<para>If you are using the <filename>boot.flp</filename> and
<filename>fixit.flp</filename> floppies, keep reading. Insert the
<filename>boot.flp</filename> floppy in the first floppy drive and
<para>If your hardware is okay, insert the
<quote>livefs</quote> CDROM in the CDROM drive and
boot the computer. The original install menu will be displayed on
the screen. Select the <literal>Fixit--Repair mode with CDROM or
floppy.</literal> option. Insert the
<filename>fixit.flp</filename> when prompted.
the screen. Select the correct country, then choose
<guimenuitem>Fixit -- Repair mode with CDROM/DVD/floppy or
start a shell.</guimenuitem> option and select the
<guimenuitem>CDROM/DVD -- Use the live filesystem
CDROM/DVD</guimenuitem> item. The tool
<command>restore</command> and the other programs that you need are
located in <filename class="directory">/mnt2/rescue</filename>
(<filename class="directory">/mnt2/stand</filename> for
&os; versions older than 5.2).</para>
located in <filename class="directory">/mnt2/rescue</filename>.</para>
<para>Recover each file system separately.</para>
<indexterm>
@ -2913,7 +2755,7 @@ echo "The floppy has been unmounted and is now ready."]]></programlisting>
bsdlabel was damaged, use <command>bsdlabel</command> to re-partition and
label the disk to match the label that you printed and saved. Use
<command>newfs</command> to re-create the file systems. Re-mount the root
partition of the floppy read-write (<command>mount -u -o rw
partition of the disk read-write (<command>mount -u -o rw
/mnt</command>). Use your backup program and backup tapes to
recover the data for this file system (e.g. <command>restore vrf
/dev/sa0</command>). Unmount the file system (e.g. <command>umount