- view: text
- select for diffs
Thu Apr 22 16:53:17 2004 UTC
(11 years, 1 month ago) by cpressey
CVS tags: HEAD
Split the suggested invocation of fdisk (which is failing for some
people) into two seperate invocations (which seems to work for them.)
The real solution would be to find out why fdisk -IB is troublesome,
but in the interim, this should save some frustration.
Problem-experienced-by: geekgod.com, Devon H. O'Dell, Dave Leimbach
DRAGONFLY CDROM README FILE
This CDROM boots DragonFly BSD. Basically what you get is a full base
system on CD with certain critical directories, such as /tmp, remounted
read-write using MFS. Your existing hard drive is not effected by
booting this CDROM.
NOTE!!! DRAGONFLY IS UNDERGOING DEVELOPMENT AND IS CONSIDERED
EXPERIMENTAL! BSD RELATED EXPERIENCE IS RECOMMENDED WHEN USING
If you just want to play with DragonFly and not mess with your hard disk,
this CDROM boots into a fully operational console-based system, though
without swap it should be noted that you are limited by available memory.
We are currently developing automatic installation tools. There are none
on this CD.
Manual installation of DragonFly onto an HD involve the following sequence
of commands. You must be familiar with BSD style UNIX systems to do
installations manually. The primary IDE hard drive is typically 'ad0'
and DragonFly is typically installed onto the first free slice
(ad0s1 if disk is empty, ad0s2 if your first slice contains
another OS, etc). Be careful to substitute the correct partition name
in the steps below.
# OPTIONAL STEP: If your disk is already partitioned and you
# have a spare primary partition on which you want to install
# Dragonfly, skip this step. However, sometimes old boot
# blocks or cruft in the boot area can interfere with the
# initialization process. A cure is to zero out the start of
# the disk before running fdisk.
# WARNING: This COMPLETELY WIPES and repartitions your hard drive.
dd if=/dev/zero of=/dev/ad0 bs=32k count=16
fdisk -I ad0
fdisk -B ad0
# If you didn't zero the disk as above, but have a spare slice
# whose partition type you want to change to UFS, use fdisk(8)
# This installs boot blocks onto the HD and verifies their
# installation. See note just above the 'reboot' below for
# things to try if it does not boot from your HD. If you
# already have a multi-OS bootloader installed you can skip
# this step.
boot0cfg -B ad0
boot0cfg -v ad0
# This creates an initial label on the chosen slice of the HD. If
# you have problems booting you could try wiping the first 32 blocks
# of the slice with dd and then reinstalling the label. Replace
# 'ad0s1' with the chosen slice.
# dd if=/dev/zero of=/dev/ad0s1 bs=32k count=16
disklabel -B -r -w ad0s1 auto
# Edit the label. Create various standard partitions. The typical
# configurations is:
# ad0s1a 256m This will be your /
# ad0s1b 1024m This will be your swap
# ad0s1c (leave alone)
# ad0s1d 256m This will be your /var
# ad0s1e 256m This will be your /tmp
# ad0s1f 8192m This will be your /usr (min 4096m)
# ad0s1g * All remaining space to your /home
# An example disklabel can be found in /etc/disklabel.ad0s1
disklabel -e ad0s1
# Newfs (format) the various filesystems. Softupdates is not
# normally enabled on the root filesystem because large kernel or
# world installs/upgrades can run it out of space due to softupdate's
# delayed bitmap freeing code.
newfs -U /dev/ad0s1d
newfs -U /dev/ad0s1e
newfs -U /dev/ad0s1f
newfs -U /dev/ad0s1g
# Mount the filesystems
mount /dev/ad0s1a /mnt
mount /dev/ad0s1d /mnt/var
mount /dev/ad0s1e /mnt/tmp
mount /dev/ad0s1f /mnt/usr
mount /dev/ad0s1g /mnt/home
# Copy the CDRom onto the target. cpdup won't cross mount boundaries
# on the source (e.g. the MFS remounts) so it takes a few commands.
cpdup / /mnt
cpdup /var /mnt/var
cpdup /etc /mnt/etc
cpdup /dev /mnt/dev
cpdup /usr /mnt/usr
# Cleanup. Also, with /tmp a partition it is usually reasonable
# to make /var/tmp a softlink to /tmp
chmod 1777 /mnt/tmp
rm -rf /mnt/var/tmp
ln -s /tmp /mnt/var/tmp
# Edit /mnt/etc/fstab to reflect the new mounts. An example fstab
# file based on the above parameters exists as /mnt/etc/fstab.example
# which you can rename to /mnt/etc/fstab.
mv /mnt/etc/fstab.example /mnt/etc/fstab
# save out your disklabel just in case. It's a good idea to save
# it to /etc so you can get at it from your backups. You do intend
# to backup your system, yah? :-) (this isn't critical but it's a
# good idea).
disklabel ad0s1 > /mnt/etc/disklabel.ad0s1
Once you've duplicated the CD onto your HD you have to make some edits
so the system boots properly from your HD. Primarily you must remove
or edit /mnt/boot/loader.conf, which exists on the CD to tell the kernel
to mount the CD's root partition.
# Remove /mnt/boot/loader.conf so the kernel does not try to
# obtain the root filesystem from the CD, and remove the other
# cruft that was sitting on the CD that you don't need on the HD.
rm -r /mnt/rr_moved
At this point it should be possible to reboot. The CD may be locked
since it is currently mounted. Be careful of the CD drawer closing
on you when you open it during the reboot. Remove the CD and allow
the system to boot from the HD.
WARNING do not just hit reset, the kernel may not have written out
all the pending data to your HD. Either unmount the HD partitions
or type reboot.
(remove CD when convenient, be careful of the CD drawer closing on you)
WHAT TO TRY IF THE SYSTEM WILL NOT BOOT FROM YOUR HD. There are a
couple of things to try. If you can select CHS or LBA mode in your BIOS,
try changing the mode to LBA. If that doesn't work boot from the CD
again and use boot0cfg to turn on packet mode (boot0cfg -o packet ad0).
Once you have a working HD based system you can clean up /etc/rc.conf
to enable things like cron, sendmail, setup your networking, and so
forth. If 'ifconfig' does not show your networking device you could
try to kldload it from /modules. With a recognized network device
you can ifconfig its IP address or, if you have a DHCP server on your
network, use 'dhclient <interfacename>' to obtain an IP address from
USING CVSUP TO OBTAIN A CVS TREE, PORTS, AND DOING BUILDWORLDS
cvsup can be used to obtain the DragonFly cvs repository, the FreeBSD
ports tree, and so on and so forth. 'man cvsup' for more information on
its capabilities. cvsup is a port (not part of the base system), but
it IS included on the CD. The cvsup example files are in
/usr/share/examples/cvsup. You will primarily be interested in the
DragonFly CVS repository, DragonFly-supfile, and the FreeBSD ports,
FreeBSD-ports-supfile. Once you have done the initial cvsup of the
blocks of data that you want you may wish to create a cron job to
keep it all up to date. However, please do not run an unattended cvsup
more then once a day.
# get the CVS pository (it is placed in /home/dcvs)
# install the source from the CVS hierarchy
cvs -R -d /home/dcvs checkout src
cvs -R -d /home/dcvs checkout dfports
# get the FreeBSD ports tree (it is directly broken out into /usr/ports)
cvsup -h cvsup.freebsd.org /usr/share/examples/cvsup/FreeBSD-ports-supfile
# buildworld and installworld examples
# buildkernel and installkernel examples. Create your own custom kernel
# config in /usr/src/sys/i386/conf/<YOURKERNEL> and you can build and
# install custom kernels.
# WARNING! Always keep a fully working backup kernel in / in case
# you blow it. Remember that /kernel.old is overwritten when you
# make installkernel. It is usually a good idea to maintain an emergency
# kernel as /kernel.GENERIC or /kernel.bak. If all else fails you can
# still fall back to booting the CD.
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
EMERGENCY RECOVERY FROM THE CD
Lets say you blew up your kernel or something else in / and you need to
boot the CD to fix it. Remember that you have a fully operational
system when booting the CD, but that you have to fsck and mount your
hard drive (typically onto /mnt) to get at the contents of your HD.
Your HD is typically an IDE hard drive, so the device is typically
/dev/ad0. DragonFly is typically on the first slice, which is
/dev/ad0s1, and the root partition is always in partition 'a',
which is /dev/ad0s1a.
# fsck root before trying to mount it.
# mount root read-write onto /mnt
mount /dev/ad0s1a /mnt
# copy files from the CD as appropriate to make it possible to boot
# from your HD again. Note that /mnt/kernel may be flags-protected.
chflags noschg /mnt/kernel
cp /kernel /mnt/kernel
cp /modules/* /mnt/modules/
If you want to mount other partitions from your HD but have forgotten
what they are, simply cat /mnt/etc/fstab after mounting the root
$DragonFly: src/nrelease/root/README,v 1.12 2004/04/22 16:53:17 cpressey Exp $