*BSD News Article 52868


Return to BSD News archive

#! rnews 3311 bsd
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!Germany.EU.net!nntp.gmd.de!stern.fokus.gmd.de!zib-berlin.de!irz401!uriah.heep!not-for-mail
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: formatting under freebsd?
Date: 11 Oct 1995 08:51:21 +0100
Organization: Private FreeBSD site, Dresden.
Lines: 61
Message-ID: <45ft1p$7qv@uriah.heep.sax.de>
References: <45bcdn$83l@mips.infocom.com>
NNTP-Posting-Host: uriah.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Josh Albertson <josh@infocom.com> wrote:
>I have had little success in formatting drives for freebsd.  It is always a 
>pain.  I have been told that for large drives that freebsd wants a small dos
>partition.  Even then it isn't necessarily smooth.  Is there some neat set of 
>rules that I can follow in formatting a drive.  If I could do this without 
>bringing down my system that would be wonderful.  Your help is greatly    
>appreciated by this naive freebsd user.

You could build a program called "tst01" in /usr/src/release/libdisk/.
In very recent pre-2.1 SNAPs, you can also use this program to create
a truly dedicated (for FreeBSD) disk that doesn't care about BIOS
parameters in any way.

If you wanna do it manually, get the parameters for your disk.  Most
interesting is the total number of sectors for a SCSI disk; it's being
announced at boot time:

(bt0:1:0): "QUANTUM PD1800S 3162" type 0 fixed SCSI 2
sd1(bt0:1:0): Direct-Access 1717MB (3517856 512 byte sectors)
                                    ^^^^^^^

and construct an entry for /etc/disktab out of it.  Mine looks like:

pd1800s|Quantum ProDrive 1800S|\
        :ty=winchester:dt=SCSI:nt#32:ns#64:nc#1717:rm#6000:\
        :su#3517856:\
        :pc#3517856:oc#0:\
        :pa#1916416:oa#0:ta=4.2BSD:ba#8192:fa#1024:\
        :pb#200000:ob#2916416:tb=swap:\
        :pg#1000000:og#1916416:tg=4.2BSD:bg#8192:fg#1024:\
        :ph#401439:oh#3116416:th=4.2BSD:bh#8192:fa#1024:

Note that as long as you've got the proper value for su# there, you
can cheat about all that nt#, ns#, and nc# crap.  It's not actually
being used, SCSI disks are accessed on a per-block basis.

Partition `c' needs to cover the entire drive (in this case), or the
entire FreeBSD slice, and shall always have oc#0.  (Even for a sliced
disk.)

What i've been doing then was:

	o  don't care for fdisk
	o  disklabel -r -w -B sd1 pd1800s
	   (Expect one "invalid partition table: no magic" warning here)
	o  newfs -d0 /dev/rsd1a
	o  newfs -d0 /dev/rsd1g
	o  newfs -d0 /dev/rsd1h
	   (Expect "calculated cylinder size does not match disklabel"
	   warnings unless you're using a fairly recent newfs command.)

This way, i've been creating a drive truly dedicated to FreeBSD, with
no useful fdisk table and a BSD bootstrap starting at sector 0.  Note
that this drive would even actually be bootable despite of it lacking
any useful BIOS information.  (I don't boot off it since it's the
second drive.)
-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)