Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 1995 20:50:29 -0500 (EST)
From:      "Jonathan M. Bresler" <jmb@freebsd.org>
To:        Bill Henderson <wjh@bhoss.ifx.net>
Cc:        questions@freebsd.org
Subject:   Re: HARD DISK COPY ? help
Message-ID:  <Pine.BSF.3.91.951223204756.23608F-100000@Aspen.Woc.Atinc.COM>
In-Reply-To: <XFMail.951223141917.wjh@bhoss.ifx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 23 Dec 1995, Bill Henderson wrote:

> Could someone give me directions on how to create a stand alone boot floppy with
>  the nessary
> exe's to do a disk image or copy from one disk to another ? or should I use the dump util ?
> 
> I really need help on how to do this

	here is a little script that i have used.   you may have to 
modify it to get it working in your enviroment.  it uses a kernel called 
MINI for instance.

	you may need to remove some binaries as well, depending upon what 
you want/need.

	best of luck


Jonathan M. Bresler        FreeBSD Postmaster         jmb@FreeBSD.ORG
play go. ride bike. hack FreeBSD.--ah the good life 
i am moving to a new job.                 PLEASE USE: jmb@FreeBSD.ORG

#!/bin/sh
#
# create a fixit floppy
#
# alternate method suggested by joerg_wunsch@uriah.heep.sax.de
# Floppy 1:
#
# disklabel -r -w -B fd0 fd1200
# newfs -t 2 -u 15 -i 65536 -l 1 /dev/rfd0a
# mount /dev/fd0a /mnt
# cp custom.kernel /mnt/kernel
# umount /mnt
# 
# Floppy 2:
# 
# the regular boot.flp
# 
# After the kernel has been loaded (perhaps with -c to give you a "safe"
# time window), swap the floppies.
#
#

#
# create a bootable floppy
#

#
# format the floppy
#
# /usr/sbin/fdformat -q fd0

# place boot block on the floppy
#
disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440

#
# newfs the one and only partition
#
/sbin/newfs -t 2 -u 18 -l 1 /dev/rfd0a

#
# mount the new floppy
#
/sbin/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			# needed ??
mkdir /mnt/var			# needed ??
#	mkdir -p /mnt/usr/share/misc

#
# populate the directories
#
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/umount > /mnt/sbin/umount
#	gzip -c -best /sbin/shutdown > /mnt/sbin/shutdown
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
#	gzip -c -best /bin/ls > /mnt/bin/ls

#	cp -f termcap /mnt/usr/share/misc/termcap
cp /root/.profile /mnt/root

cp -f /dev/MAKEDEV /mnt/dev

chmod 500 /mnt/sbin/init
chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/umount
#	chmod 4550 /mnt/sbin/shutdown
chmod 555 /mnt/sbin/halt
chmod 6555 /mnt/sbin/restore
chmod 555 /mnt/bin/sh /mnt/bin/sync /mnt/bin/ls
#	chmod 444 /mnt/usr/share/misc/termcap
#
# create the devices nodes 
#
cd /mnt/dev
./MAKEDEV std
#	./MAKEDEV wd0
#	./MAKEDEV wd1
./MAKEDEV sd0
./MAKEDEV sd1
./MAKEDEV pty0			# needed ??
cd /

#
# create minimum filesystem table
#
cat > /mnt/etc/fstab <<EOM			# XXX syntax Error
/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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951223204756.23608F-100000>