*BSD News Article 75110


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.eng.convex.com!newshost.convex.com!newsgate.duke.edu!news.mathworks.com!news.kei.com!nntp.coast.net!dispatch.news.demon.net!demon!jraynard.demon.co.uk!not-for-mail
From: james@jraynard.demon.co.uk (James Raynard)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: adding disk/filesystems
Date: 31 Jul 1996 01:33:50 -0000
Organization: A FreeBSD Box
Lines: 85
Message-ID: <4tmd5u$f6j@jraynard.demon.co.uk>
References: <4tlgip$kc1@news.cc.utah.edu>
NNTP-Posting-Host: localhost
Keywords: new file systems
X-NNTP-Posting-Host: jraynard.demon.co.uk

In article <4tlgip$kc1@news.cc.utah.edu>,
Lloyd M Caldwell <lmc@no.such.domain> wrote:
>
>  I've spent 3 days studing: faq (local and net), handbook,
>  (local and net) man pages.  I have experimented and read
>  code for disklabel, disktab, newfs, fdisk, and sysinstall
>  hoping to see what sysinstall did.
>
>  I still have no idea how to create a file system on a new disk
>  added to my system.

Was this the latest version of the FAQ (the one on 
http://www.freebsd.org)?  I put a simple way to add a disk
in there using sysinstall.

>  I added a quantum fireball 1280 (scsi id=2, 1222mb), /dev/sd2.
>  The kernel recognizes the device, truncated output of dmseg:
[...]
>  How does one make a new file system on FreeBSD?  I plan on dedicating
>  the entire disk to one FreeBSD filesystem.
>
>  The steps I think I need to perform are:

(Disclaimer - my comments are from memory)

>	MAKEDEV ???

I'm not sure this is necessary - 2.1.0 seemed to create all the
necessary devices for sd2 on my system.

>	fdisk ??? /dev/sd2

fdisk -i -u sd2

Note that the sysid for FreeBSD is 165, and that sectors are numbered
from 1 to n instead of 0 to n-1 (everything else is numbered from 0 to
n-1, though).

>	disklabel  ??? /dev/sd2

disklabel -e -r sd2

Check the numbers are correct and change the "fstype" field for the
'a' partition from "Unused" to "4.2BSD".

>	newfs  ????  /dev/rsd2???

newfs /dev/rsd2

At last, one that doesn't require any tricky editing (it will even
make sensible guesses at the necessary parameters!)

>	vi /etc/fstab  # add the entry for mounting the disk at boot time

Yup.  And now for the easy way:-

1. Start up /stand/sysinstall.  If it won't run, either re-configure
   the kernel with 'device gzip', or boot from the install floppy.

2. Go into the "express mode for impatient experts", or whatever it's
   called.  (If you like, you can stop and re-read the docco on how
   to divide up disks first).

3. Select sd2 as the disk to work on and, in the fdisk editor, create 
   a single 'slice' to cover the entire disk.  Press 'w' to tell it
   to write this to disk and confirm that, yes, you really do know
   what you're doing.  In your case, (SCSI disk that will be dedicated
   to FreeBSD), say "Yes" when asked if you want to make it incompatible
   with lesser operating systems.

4. Select the "don't touch my MBR" option.

5. In the partition editor, divide the disk up as you wish (not necessary,
   but a useful precaution in case anything goes wrong).  Again, type 'w'
   to write the changes to disk.

6. At this point, according to reports I've seen, 2.1.5's sysinstall will
   dump core, leaving you with a half-written disklabel that you will have
   to clean up by hand.  Fortunately, you said you were using 2.1.0, so you 
   can gracefully exit sysinstall, run newfs and mount your new disk. :-)

-- 
James Raynard, Edinburgh, Scotland
james@jraynard.demon.co.uk
http://www.freebsd.org/~jraynard/