5484l1

Listing 1. make.dev.hda

#! /bin/sh

# A script to restore the partition data of a hard drive and format
# the partitions. Created at bare metal backup time by the Perl script
# make.fdisk. This script replaces make.partitions which was written
# manually.

# Time-stamp: <2001-01-10 11:38:55 root>

# Copyright 2001 Charles Curley.

# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# You can also contact the Free Software Foundation at http://www.fsf.org/

# For more information contact the author, Charles Curley, at
# http://w3.trib.com/~ccurley/.

fdisk /dev/hda < dev.hda

mke2fs /dev/hda1
mke2fs /dev/hda5
mke2fs /dev/hda6
mke2fs /dev/hda7
mke2fs /dev/hda8
mkswap /dev/hda9

mkdir /target/
mount /dev/hda8 /target/
mkdir /target/boot
mount /dev/hda1 /target/boot
mkdir /target/home
mount /dev/hda6 /target/home
mkdir /target/usr
mount /dev/hda5 /target/usr
mkdir /target/var
mount /dev/hda7 /target/var