xref: /dragonfly/nrelease/root/README (revision 9bb2a92d)
1			    DRAGONFLY CDROM README FILE
2
3    This CDROM boots DragonFly BSD.  Basically what you get is a full base
4    system on CD with certain critical directories, such as /tmp, remounted
5    read-write using MFS.  Your existing hard drive is not effected by
6    booting this CDROM.
7
8    NOTE!!! DRAGONFLY IS UNDERGOING DEVELOPMENT AND IS CONSIDERED
9    EXPERIMENTAL!  BSD RELATED EXPERIENCE IS RECOMMENDED WHEN USING
10    THIS CDROM.
11
12    If you just want to play with DragonFly and not mess with your hard disk,
13    this CDROM boots into a fully operational console-based system, though
14    without swap it should be noted that you are limited by available memory.
15
16			    AUTOMATIC INSTALLATION
17
18    We are currently developing automatic installation tools.  There are none
19    on this CD.
20
21			    MANUAL INSTALLATION
22
23    Manual installation of DragonFly onto an HD involve the following sequence
24    of commands.  You must be familiar with BSD style UNIX systems to do
25    installations manually.  The primary IDE hard drive is typically 'ad0'
26    and DragonFly is typically installed onto the first free slice
27    (ad0s1 if disk is empty, ad0s2 if your first slice contains
28    another OS, etc).  Be careful to substitute the correct partition name
29    in the steps below.
30
31	# OPTIONAL STEP: If your disk is already partitioned and you
32	# have a spare primary partition on which you want to install
33	# Dragonfly, skip this step.  However, sometimes old boot
34	# blocks or cruft in the boot area can interfere with the
35	# initialization process.  A cure is to zero out the start of
36	# the disk before running fdisk.
37	#
38	# WARNING: This COMPLETELY WIPES and repartitions your hard drive.
39	#
40	dd if=/dev/zero of=/dev/ad0 bs=32k count=16
41	fdisk -IB ad0
42
43	# If you didn't zero the disk as above, but have a spare slice
44	# whose partition type you want to change to UFS, use fdisk(8)
45
46
47	# This installs boot blocks onto the HD and verifies their
48	# installation.  See note just above the 'reboot' below for
49	# things to try if it does not boot from your HD.  If you
50	# already have a multi-OS bootloader installed you can skip
51	# this step.
52	#
53	boot0cfg -B ad0
54	boot0cfg -v ad0
55
56	# This creates an initial label on the chosen slice of the HD.  If
57	# you have problems booting you could try wiping the first 32 blocks
58	# of the slice with dd and then reinstalling the label.  Replace
59	# 'ad0s1' with the chosen slice.
60	#
61	# dd if=/dev/zero of=/dev/ad0s1 bs=32k count=16
62	disklabel -B -r -w ad0s1 auto
63
64	# Edit the label.  Create various standard partitions.  The typical
65	# configurations is:
66	#
67	#	ad0s1a	256m		This will be your /
68	#	ad0s1b	1024m		This will be your swap
69	#	ad0s1c			(leave alone)
70	#	ad0s1d	256m		This will be your /var
71	#	ad0s1e	256m		This will be your /tmp
72	#	ad0s1f	8192m		This will be your /usr (min 4096m)
73	#	ad0s1g	*		All remaining space to your /home
74	#
75	#  An example disklabel can be found in /etc/disklabel.ad0s1
76	#
77	disklabel -e ad0s1
78
79	# Newfs (format) the various filesystems.  Softupdates is not
80	# normally enabled on the root filesystem because large kernel or
81	# world installs/upgrades can run it out of space due to softupdate's
82	# delayed bitmap freeing code.
83	#
84	newfs /dev/ad0s1a
85	newfs -U /dev/ad0s1d
86	newfs -U /dev/ad0s1e
87	newfs -U /dev/ad0s1f
88	newfs -U /dev/ad0s1g
89
90	# Mount the filesystems
91	#
92	mount /dev/ad0s1a /mnt
93	mkdir /mnt/var
94	mkdir /mnt/tmp
95	mkdir /mnt/usr
96	mkdir /mnt/home
97	mount /dev/ad0s1d /mnt/var
98	mount /dev/ad0s1e /mnt/tmp
99	mount /dev/ad0s1f /mnt/usr
100	mount /dev/ad0s1g /mnt/home
101
102	# Copy the CDRom onto the target.  cpdup won't cross mount boundaries
103	# on the source (e.g. the MFS remounts) so it takes a few commands.
104	cpdup / /mnt
105	cpdup /var /mnt/var
106	cpdup /etc /mnt/etc
107	cpdup /dev /mnt/dev
108	cpdup /usr /mnt/usr
109
110	# Cleanup.  Also, with /tmp a partition it is usually reasonable
111	# to make /var/tmp a softlink to /tmp
112	#
113	chmod 1777 /mnt/tmp
114	rm -rf /mnt/var/tmp
115	ln -s /tmp /mnt/var/tmp
116
117	# Edit /mnt/etc/fstab to reflect the new mounts.  An example fstab
118	# file based on the above parameters exists as /mnt/etc/fstab.example
119	# which you can rename to /mnt/etc/fstab.
120	#
121	mv /mnt/etc/fstab.example /mnt/etc/fstab
122	vi /mnt/etc/fstab
123
124	# save out your disklabel just in case.  It's a good idea to save
125	# it to /etc so you can get at it from your backups.  You do intend
126	# to backup your system, yah? :-)  (this isn't critical but it's a
127	# good idea).
128	#
129	disklabel ad0s1 > /mnt/etc/disklabel.ad0s1
130
131    Once you've duplicated the CD onto your HD you have to make some edits
132    so the system boots properly from your HD.  Primarily you must remove
133    or edit /mnt/boot/loader.conf, which exists on the CD to tell the kernel
134    to mount the CD's root partition.
135
136	# Remove /mnt/boot/loader.conf so the kernel does not try to
137	# obtain the root filesystem from the CD, and remove the other
138	# cruft that was sitting on the CD that you don't need on the HD.
139	#
140	rm /mnt/boot/loader.conf
141	rm /mnt/README
142	rm /mnt/boot.catalog
143	rm -r /mnt/rr_moved
144
145    At this point it should be possible to reboot.  The CD may be locked
146    since it is currently mounted.  Be careful of the CD drawer closing
147    on you when you open it during the reboot.  Remove the CD and allow
148    the system to boot from the HD.
149
150    WARNING do not just hit reset, the kernel may not have written out
151    all the pending data to your HD.  Either unmount the HD partitions
152    or type reboot.
153
154	# reboot
155	reboot
156	(remove CD when convenient, be careful of the CD drawer closing on you)
157
158    WHAT TO TRY IF THE SYSTEM WILL NOT BOOT FROM YOUR HD.  There are a
159    couple of things to try.  If you can select CHS or LBA mode in your BIOS,
160    try changing the mode to LBA.  If that doesn't work boot from the CD
161    again and use boot0cfg to turn on packet mode (boot0cfg -o packet ad0).
162
163    Once you have a working HD based system you can clean up /etc/rc.conf
164    to enable things like cron, sendmail, setup your networking, and so
165    forth.  If 'ifconfig' does not show your networking device you could
166    try to kldload it from /modules.  With a recognized network device
167    you can ifconfig its IP address or, if you have a DHCP server on your
168    network, use 'dhclient <interfacename>' to obtain an IP address from
169    the netweork.
170
171	    USING CVSUP TO OBTAIN A CVS TREE, PORTS, AND DOING BUILDWORLDS
172
173    cvsup can be used to obtain the DragonFly cvs repository, the FreeBSD
174    ports tree, and so on and so forth.  'man cvsup' for more information on
175    its capabilities.  cvsup is a port (not part of the base system), but
176    it IS included on the CD.  The cvsup example files are in
177    /usr/share/examples/cvsup.  You will primarily be interested in the
178    DragonFly CVS repository, DragonFly-supfile, and the FreeBSD ports,
179    FreeBSD-ports-supfile.  Once you have done the initial cvsup of the
180    blocks of data that you want you may wish to create a cron job to
181    keep it all up to date.  However, please do not run an unattended cvsup
182    more then once a day.
183
184    # get the CVS pository (it is placed in /home/dcvs)
185    cvsup /usr/share/examples/cvsup/DragonFly-supfile
186    # install the source from the CVS hierarchy
187    cd /usr
188    cvs -R -d /home/dcvs checkout src
189    cvs -R -d /home/dcvs checkout dfports
190
191    # get the FreeBSD ports tree (it is directly broken out into /usr/ports)
192    cvsup -h cvsup.freebsd.org /usr/share/examples/cvsup/FreeBSD-ports-supfile
193
194    # buildworld and installworld examples
195    #
196    cd /usr/src
197    make buildworld
198    make installworld
199
200    # buildkernel and installkernel examples.  Create your own custom kernel
201    # config in /usr/src/sys/i386/conf/<YOURKERNEL> and you can build and
202    # install custom kernels.
203    #
204    # WARNING!  Always keep a fully working backup kernel in / in case
205    # you blow it.  Remember that /kernel.old is overwritten when you
206    # make installkernel.  It is usually a good idea to maintain an emergency
207    # kernel as /kernel.GENERIC or /kernel.bak.  If all else fails you can
208    # still fall back to booting the CD.
209    #
210    cd /usr/src
211    make buildkernel KERNCONF=GENERIC
212    make installkernel KERNCONF=GENERIC
213
214			EMERGENCY RECOVERY FROM THE CD
215
216    Lets say you blew up your kernel or something else in / and you need to
217    boot the CD to fix it.  Remember that you have a fully operational
218    system when booting the CD, but that you have to fsck and mount your
219    hard drive (typically onto /mnt) to get at the contents of your HD.
220
221    Your HD is typically an IDE hard drive, so the device is typically
222    /dev/ad0.  DragonFly is typically on the first slice, which is
223    /dev/ad0s1, and the root partition is always in partition 'a',
224    which is /dev/ad0s1a.
225
226    # fsck root before trying to mount it.
227    fsck /dev/ad0s1a
228    # mount root read-write onto /mnt
229    mount /dev/ad0s1a /mnt
230    # copy files from the CD as appropriate to make it possible to boot
231    # from your HD again.  Note that /mnt/kernel may be flags-protected.
232    chflags noschg /mnt/kernel
233    cp /kernel /mnt/kernel
234    cp /modules/* /mnt/modules/
235
236    If you want to mount other partitions from your HD but have forgotten
237    what they are, simply cat /mnt/etc/fstab after mounting the root
238    partition.
239
240$DragonFly: src/nrelease/root/README,v 1.10 2004/03/10 06:35:22 dillon Exp $
241
242