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