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