Update installer to 1.1.2.
[dragonfly.git] / nrelease / root / README
CommitLineData
b816f770
MD
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
b6a0a5cf
MD
8 NOTE!!! DRAGONFLY IS UNDERGOING DEVELOPMENT AND IS CONSIDERED
9 EXPERIMENTAL! BSD RELATED EXPERIENCE IS RECOMMENDED WHEN USING
10 THIS CDROM.
b816f770
MD
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.
87c240fe
MD
15 It is a good idea to test your hardware for compatibility from a CD boot
16 before spending time installing the dist on your hard disk.
17
b816f770
MD
18
19 AUTOMATIC INSTALLATION
20
89e4f808
MD
21 There are currently two installation tools available. We haven't quite
22 finished the USB/floppy key'd headless installation but what is available
23 is the installer (login as 'installer') and rconfig.
24
25 The installer can be run from the serial console or a VTY and provides
26 a straightforward UI to install DragonFly on your HD.
27
28 rconfig is a client/server protocol which requires a server (typically on
29 the same network). An example server setup can be found in
87c240fe
MD
30 /usr/share/examples/rconfig. If you have multiple machines you can setup
31 an installation script and run rconfig on a server and then install the
32 clients from CD boot with network connectivity (e.g. dhclient <blah>)
89e4f808 33 and then, typically, 'rconfig -a'.
87c240fe 34
89e4f808
MD
35 You can also just boot from the CD, login as 'root' to get a shell
36 prompt, copy the sample script to /tmp, edit, and run it directly
37 (assuming that blowing away your existing disk is ok).
87c240fe
MD
38
39
40 CONSOLE OPERATION
b816f770 41
87c240fe 42 The second stage boot (boot2) and third stage boot (loader) default
89e4f808
MD
43 to dual serial & video console I/O. The system will also throw a login
44 prompt up on ttyd0 by default. You can direct the boot output
87c240fe
MD
45 to just the serial port by creating the file /boot.config with the
46 line '-h', or to just the screen using '-V'. If you wish to leave
47 boot2 in dual I/O mode but want the third stage to use just one or the
48 other, you can set the 'console' environment variable in /boot/loader.conf
49 to either 'console=vidconsole' or 'console=comconsole'.
b816f770 50
87c240fe
MD
51 The dual serial port operation might have to be disabled if you use
52 the serial port for things like UPSs. Also note that by default
53 the CD will run a login prompt on the serial port after booting is
54 complete. This can be disabled by editing the 'ttyd0' line in /etc/ttys
55 after installation is complete.
56
57 Note that the kernel itself currently only supports one console or the
58 other. If both are enabled, the kernel will use the video console or
59 the last one for which input was received.
60
61 MANUAL INSTALLATION
62
63 Manual installation of DragonFly onto an HD involves the following sequence
b816f770
MD
64 of commands. You must be familiar with BSD style UNIX systems to do
65 installations manually. The primary IDE hard drive is typically 'ad0'
dae36ee2
MD
66 and DragonFly is typically installed onto the first free slice
67 (ad0s1 if disk is empty, ad0s2 if your first slice contains
68 another OS, etc). Be careful to substitute the correct partition name
69 in the steps below.
70
71 # OPTIONAL STEP: If your disk is already partitioned and you
72 # have a spare primary partition on which you want to install
73 # Dragonfly, skip this step. However, sometimes old boot
74 # blocks or cruft in the boot area can interfere with the
75 # initialization process. A cure is to zero out the start of
76 # the disk before running fdisk.
77 #
78 # WARNING: This COMPLETELY WIPES and repartitions your hard drive.
572e6852
MD
79 #
80 dd if=/dev/zero of=/dev/ad0 bs=32k count=16
fb017d4e
CP
81 fdisk -I ad0
82 fdisk -B ad0
b816f770 83
dae36ee2
MD
84 # If you didn't zero the disk as above, but have a spare slice
85 # whose partition type you want to change to UFS, use fdisk(8)
86
87
b816f770 88 # This installs boot blocks onto the HD and verifies their
b6a0a5cf 89 # installation. See note just above the 'reboot' below for
dae36ee2
MD
90 # things to try if it does not boot from your HD. If you
91 # already have a multi-OS bootloader installed you can skip
92 # this step.
b6a0a5cf 93 #
b816f770
MD
94 boot0cfg -B ad0
95 boot0cfg -v ad0
96
dae36ee2 97 # This creates an initial label on the chosen slice of the HD. If
b816f770 98 # you have problems booting you could try wiping the first 32 blocks
dae36ee2
MD
99 # of the slice with dd and then reinstalling the label. Replace
100 # 'ad0s1' with the chosen slice.
b816f770
MD
101 #
102 # dd if=/dev/zero of=/dev/ad0s1 bs=32k count=16
103 disklabel -B -r -w ad0s1 auto
104
105 # Edit the label. Create various standard partitions. The typical
106 # configurations is:
107 #
108 # ad0s1a 256m This will be your /
109 # ad0s1b 1024m This will be your swap
110 # ad0s1c (leave alone)
111 # ad0s1d 256m This will be your /var
112 # ad0s1e 256m This will be your /tmp
113 # ad0s1f 8192m This will be your /usr (min 4096m)
0dab2a93 114 # ad0s1g * All remaining space to your /home
b816f770 115 #
4e04bc29
MD
116 # An example disklabel can be found in /etc/disklabel.ad0s1
117 #
b816f770
MD
118 disklabel -e ad0s1
119
ed029207
JS
120 # If you are not using ad0s1 as in the previous commands, you will
121 # need to create the device nodes for that slice. Change the
122 # slice number (ad0s2a) to match the disk slice you are using.
123 #
124 # The device nodes are automatically created for ad0s1, so you can
125 # safely skip this step if you are using that disk slice.
126 #
127 cd /dev && MAKEDEV ad0s2a
128
129 # Newfs (format) the various filesystems. Softupdates is not
dae36ee2
MD
130 # normally enabled on the root filesystem because large kernel or
131 # world installs/upgrades can run it out of space due to softupdate's
132 # delayed bitmap freeing code.
b816f770
MD
133 #
134 newfs /dev/ad0s1a
135 newfs -U /dev/ad0s1d
136 newfs -U /dev/ad0s1e
137 newfs -U /dev/ad0s1f
138 newfs -U /dev/ad0s1g
139
140 # Mount the filesystems
141 #
142 mount /dev/ad0s1a /mnt
143 mkdir /mnt/var
144 mkdir /mnt/tmp
145 mkdir /mnt/usr
146 mkdir /mnt/home
147 mount /dev/ad0s1d /mnt/var
148 mount /dev/ad0s1e /mnt/tmp
149 mount /dev/ad0s1f /mnt/usr
150 mount /dev/ad0s1g /mnt/home
151
152 # Copy the CDRom onto the target. cpdup won't cross mount boundaries
153 # on the source (e.g. the MFS remounts) so it takes a few commands.
21aa02d0
CP
154 #
155 # Note that /etc contains the config files used for booting from the
156 # CDROM itself, and /etc.hdd contains those for booting off a
157 # hard disk. So it's the latter that you want to copy to /mnt/etc.
158 #
b816f770
MD
159 cpdup / /mnt
160 cpdup /var /mnt/var
21aa02d0 161 cpdup /etc.hdd /mnt/etc
b816f770 162 cpdup /dev /mnt/dev
a3e78356 163 cpdup /usr /mnt/usr
b816f770 164
7bd4a647
MD
165 # Cleanup. Also, with /tmp a partition it is usually reasonable
166 # to make /var/tmp a softlink to /tmp
167 #
168 chmod 1777 /mnt/tmp
169 rm -rf /mnt/var/tmp
170 ln -s /tmp /mnt/var/tmp
171
b816f770
MD
172 # Edit /mnt/etc/fstab to reflect the new mounts. An example fstab
173 # file based on the above parameters exists as /mnt/etc/fstab.example
174 # which you can rename to /mnt/etc/fstab.
175 #
176 mv /mnt/etc/fstab.example /mnt/etc/fstab
177 vi /mnt/etc/fstab
178
4e04bc29
MD
179 # save out your disklabel just in case. It's a good idea to save
180 # it to /etc so you can get at it from your backups. You do intend
181 # to backup your system, yah? :-) (this isn't critical but it's a
182 # good idea).
183 #
184 disklabel ad0s1 > /mnt/etc/disklabel.ad0s1
185
87c240fe
MD
186
187 MISC CLEANUPS BEFORE REBOOTING
188
b816f770
MD
189 Once you've duplicated the CD onto your HD you have to make some edits
190 so the system boots properly from your HD. Primarily you must remove
dae36ee2
MD
191 or edit /mnt/boot/loader.conf, which exists on the CD to tell the kernel
192 to mount the CD's root partition.
b816f770 193
87c240fe
MD
194 # Remove or edit /mnt/boot/loader.conf so the kernel does not try
195 # to obtain the root filesystem from the CD, and remove the other
4e04bc29 196 # cruft that was sitting on the CD that you don't need on the HD.
b816f770
MD
197 #
198 rm /mnt/boot/loader.conf
d4cdca3f 199 rm /mnt/README*
0dab2a93
MD
200 rm /mnt/boot.catalog
201 rm -r /mnt/rr_moved
b816f770
MD
202
203 At this point it should be possible to reboot. The CD may be locked
87c240fe
MD
204 since it is currently mounted. To remove the CD, type 'halt' instead
205 of 'reboot', wait for the machine to halt, then the CD door should be
206 unlocked. Remove the CD and hit any key to reboot.
207
208 Be careful of the CD drawer closing on you if you try to remove the CD
209 while the machine is undergoing a reboot or reset.
b816f770 210
a3e78356
MD
211 WARNING do not just hit reset, the kernel may not have written out
212 all the pending data to your HD. Either unmount the HD partitions
87c240fe 213 or type halt or reboot.
a3e78356 214
87c240fe
MD
215 # halt
216 (let the machine halt)
b816f770 217 (remove CD when convenient, be careful of the CD drawer closing on you)
87c240fe
MD
218 (hit any key to reboot)
219
220
221 THE ACPI ISSUE
222
223 You will notice in the boot menu that you can choose to boot with or
224 without ACPI. ACPI is an infrastructure designed to allow an operating
225 to configure hardware devices associated with the system. Unfortunately,
226 as usual, PC BIOS makers have royally screwed up the standard and ACPI
227 is as likely to hurt as it is to help. Worse, some PCs cannot be booted
228 without it, so there is no good 'default' choice.
229
230 The system will use ACPI by default. You can disable it in the default
231 boot by adding the line 'hint.acpi.0.disabled=1' in /boot/loader.conf.
232 If you boot without hitting any menu options the system will boot without
233 ACPI. To boot without ACPI no matter what, place 'unset acpi_load' in
234 our /boot/loader.conf instead. This is not recommended.
235
236
237 IF YOU HAVE PROBLEMS BOOTING FROM HD
b816f770 238
87c240fe
MD
239 There are a couple of things to try. If you can select CHS or LBA mode
240 in your BIOS, try changing the mode to LBA. If that doesn't work boot
241 from the CD again and use boot0cfg to turn on packet mode (boot0cfg -o
242 packet ad0). Also try booting with and without ACPI (option 1 or 2 in
243 the boot menu).
dae36ee2 244
b816f770
MD
245 Once you have a working HD based system you can clean up /etc/rc.conf
246 to enable things like cron, sendmail, setup your networking, and so
247 forth. If 'ifconfig' does not show your networking device you could
248 try to kldload it from /modules. With a recognized network device
249 you can ifconfig its IP address or, if you have a DHCP server on your
250 network, use 'dhclient <interfacename>' to obtain an IP address from
513aa0c6 251 the network.
b816f770 252
9c13f47c
MD
253 USING CVSUP TO OBTAIN A CVS TREE, PORTS, AND DOING BUILDWORLDS
254
255 cvsup can be used to obtain the DragonFly cvs repository, the FreeBSD
256 ports tree, and so on and so forth. 'man cvsup' for more information on
257 its capabilities. cvsup is a port (not part of the base system), but
258 it IS included on the CD. The cvsup example files are in
259 /usr/share/examples/cvsup. You will primarily be interested in the
260 DragonFly CVS repository, DragonFly-supfile, and the FreeBSD ports,
261 FreeBSD-ports-supfile. Once you have done the initial cvsup of the
262 blocks of data that you want you may wish to create a cron job to
263 keep it all up to date. However, please do not run an unattended cvsup
264 more then once a day.
265
266 # get the CVS pository (it is placed in /home/dcvs)
eda86301 267 cvsup /usr/share/examples/cvsup/DragonFly-supfile
9c13f47c
MD
268 # install the source from the CVS hierarchy
269 cd /usr
270 cvs -R -d /home/dcvs checkout src
271 cvs -R -d /home/dcvs checkout dfports
272
273 # get the FreeBSD ports tree (it is directly broken out into /usr/ports)
eda86301 274 cvsup -h cvsup.freebsd.org /usr/share/examples/cvsup/FreeBSD-ports-supfile
9c13f47c
MD
275
276 # buildworld and installworld examples
277 #
278 cd /usr/src
279 make buildworld
280 make installworld
281
282 # buildkernel and installkernel examples. Create your own custom kernel
283 # config in /usr/src/sys/i386/conf/<YOURKERNEL> and you can build and
284 # install custom kernels.
285 #
286 # WARNING! Always keep a fully working backup kernel in / in case
287 # you blow it. Remember that /kernel.old is overwritten when you
288 # make installkernel. It is usually a good idea to maintain an emergency
289 # kernel as /kernel.GENERIC or /kernel.bak. If all else fails you can
290 # still fall back to booting the CD.
291 #
292 cd /usr/src
293 make buildkernel KERNCONF=GENERIC
294 make installkernel KERNCONF=GENERIC
295
296 EMERGENCY RECOVERY FROM THE CD
297
298 Lets say you blew up your kernel or something else in / and you need to
299 boot the CD to fix it. Remember that you have a fully operational
300 system when booting the CD, but that you have to fsck and mount your
301 hard drive (typically onto /mnt) to get at the contents of your HD.
302
303 Your HD is typically an IDE hard drive, so the device is typically
304 /dev/ad0. DragonFly is typically on the first slice, which is
305 /dev/ad0s1, and the root partition is always in partition 'a',
306 which is /dev/ad0s1a.
307
308 # fsck root before trying to mount it.
309 fsck /dev/ad0s1a
310 # mount root read-write onto /mnt
311 mount /dev/ad0s1a /mnt
312 # copy files from the CD as appropriate to make it possible to boot
313 # from your HD again. Note that /mnt/kernel may be flags-protected.
314 chflags noschg /mnt/kernel
315 cp /kernel /mnt/kernel
316 cp /modules/* /mnt/modules/
317
318 If you want to mount other partitions from your HD but have forgotten
319 what they are, simply cat /mnt/etc/fstab after mounting the root
320 partition.
321
21aa02d0 322$DragonFly: src/nrelease/root/README,v 1.17 2004/11/11 19:45:19 cpressey Exp $
9c13f47c 323