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