Partitioning a Drive Under NetBSD


So you're ready to put together a NetBSD machine! You've got your hardware and some method of getting all of the binary pieces, now you just need to get that drive ready to accept files.

Gulp, what do I do now?

You have several tasks ahead of you, regardless of whether you are using the install disks or boot strapping a new disk by hand.

  1. Obtain the physical parameters of your drive.
  2. Determine the layout of your drive.
  3. Create an /etc/disktab entry for the drive.
  4. Burn the disktab into the drive with disklabel.
  5. Newfs the drive's filesystems.
  6. Fsck the drive's filesystems.
  7. Modify /etc/fstab to use the filesystems.
  8. Install or whatever.....

This page is under construction

Discuss reasonable sizes for partitions: / = ~10meg with no /var, /var/mail being isolated or quota enforced, seperate /tmp, ~90 meg in /usr with X installed, ~80 meg in /usr/obj, ~120 in /usr/src

Example Disktab Entry

#ncr0 targ 0 lun 0:  SCSI2 0/direct fixed
#sd0 at scsibus0sd0(ncr0:0:0): FAST SCSI-2 100ns (10 Mb/sec) offset 8.
#: 1010MB, 2756 cyl, 8 head, 93 sec, 512 bytes/sec
Conner: \
        :dt=SCSI:ty=winchester:se#512:nt#8:ns#93:nc#2756:rm#5400: \
        :pa#40920:oa#0:ba#8192:fa#1024:ta=4.2BSD: \
        :pb#130944:ob#40920:tb=swap: \
        :pc#2050464:oc#0: \
        :pd#2050464:od#0: \
        :pe#245520:oe#171864:be#8192:fe#1024:te=4.2BSD: \
        :pf#614544:of#417384:bf#8192:ff#1024:tf=4.2BSD: \
        :pg#1018536:og#1031928:bg#8192:fg#1024:tg=4.2BSD: 

Using disklabel

disklabel -w -r sd? Conner
Do you need to boot from the drive? disklabel -w -B sd? Conner

Using newfs and fsck

newfs /dev/rsd?a..N

fsck /dev/rsd?a..N

Modifying /etc/fstab

/dev/sd0a /             ffs     rw      1 1
/dev/sd1a /altroot      ffs     rw      1 2
kernfs  /kern           kernfs  rw      0 0
procfs  /proc           procfs  rw      0 0
/dev/sd1b none          swap    sw      0 0
/dev/sd1b /tmp          mfs     rw,-s=16000 0 0
/dev/sd1e /usr          ffs     rw      1 2
/dev/sd0e /usr/local    ffs     rw      1 2
/dev/sd1g /usr/people   ffs     rw      1 2
#atrium:/usr/people /home/atrium.people nfs rw,-bisqTkl,-r4096,-w4096 0 0
/dev/sd0f /usr/obj      ffs     rw      1 2
/dev/sd1f /usr/src      ffs     rw      1 2
/dev/sd0g /mnt          ffs     rw      1 2