Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 1996 00:54:08 -0700
From:      Darryl Okahata <darrylo@hpnmhjw.sr.hp.com>
To:        Doug White <dwhite@gdi.uoregon.edu>
Cc:        "S(pork)" <spork@super-g.com>, questions@freefall.freebsd.org
Subject:   Re: installation of 4gig SCSI HD under 2.1.5
Message-ID:  <199610250754.AA183900048@hpnmhjw.sr.hp.com>

next in thread | raw e-mail | index | archive | help
> The easiest way (esp. with SCSI) is to not mess with them at all and use
> the 'auto' disktype.

     If and only if all of the following are true:

* You're an intermediate- to expert-level user.  (DON'T EVEN THINK ABOUT
  DOING THE FOLLOWING IF YOU'RE A NOVICE USER!)

* You have a SCSI disk (IDE drives may work in the following, but I
  don't know).

* You want to dedicate the *ENTIRE* disk to FreeBSD.  This is
  *IMPORTANT*, as the following assumes that you really do want to
  dedicate the entire disk to FreeBSD (yes, *all* of it).  If you want
  to use even a teensy, tiny part of the disk for something else like
  MSDOS or Windows, you CANNOT use the following instructions.  Period.

* You have no data on the disk that you want to keep.

* You don't mind losing ALL DATA that is currently on the disk.

* You don't mind destroying any and all MSDOS or Windows 3.1/95/NT or
  any other information that is on the disk.

* You don't plan on using or sharing the disk with other operating
  systems (e.g., MSDOS or Windows).

* You want to partition the *ENTIRE* FreeBSD slice into a single FreeBSD
  filesystem.  (If this isn't true, you have to change the "newfs"
  command below.)

Then, the easiest way to add a dedicated disk is the following:

* First, determine the base disk name of the disk you want to
  add/dedicate (e.g., "sd1").

* Assuming that "sd1" really is correct, do the following (assuming
  Bourne shell /bin/sh syntax):

	# This won't work if you're using /bin/csh:
	d=sd1
	dd if=/dev/zero of=/dev/r$d count=2
	disklabel /dev/r$d | disklabel -B -R -r $d /dev/stdin
	# We only want one partition, so using slice 'c' should be fine:
	newfs /dev/r${d}c

  (Thanks to Bruce Evans for the procedure.)

You can then mount the drive via a command like:

	mount /dev/${d}c /mnt

Expert users can partition the FreeBSD slice into multiple filesystems
using a slightly different procedure:

	# This won't work if you're using /bin/csh:
	d=sd1
	dd if=/dev/zero of=/dev/r$d count=2
	TMP=/tmp/label$$
	disklabel /dev/r$d > $TMP
	# Edit disklabel to add partitions:
	vi $TMP
	disklabel -B -R -r $d $TMP
	# newfs partitions appropriately

     To comment on the earlier message: you don't need entries in
/etc/disktab to add new disks (this file is probably obsolete).  All you
might need to know is the disk geometry used at boot time (unnecessary
in certain cases, like dedicated disks), and, maybe, the size of the
disk in blocks (this is automatically determined for SCSI disks, and
probably also for IDE ones).

> In response to the shiny automatic way to add disks, I saw an announcement
> some time ago for a perl script which automates this somewhat.  I wish I
> had the reference, you might check the -current and possibly -announce
> archives for that one.

     I uploaded such a perl script to freefall, but it turns out that it
works only with 2.2-snap-960801, and maybe versions up to 2.2-current
(it depends on an undocumented ioctl() -- DIOCGCSLICEINFO).  I hope to
fix this, and upload a new version in the next week or so.

     For those of you who missed the earlier announcement, this perl
script provides an easy way to create a Bourne shell script that
initializes a disk using fdisk, disklabel, and newfs.  A Bourne shell
script is created because it's very useful for (1) disaster recovery
(you don't need perl on a fixit disk), and (2) a production environment
where you want to create lots of identical systems (just run the script
to initialize disks).  It's also aimed at intermediate- to expert-level
users, as it doesn't mount the new filesystems or edit /etc/fstab (which
are trivial for these users).

     -- Darryl Okahata
	Internet: darrylo@sr.hp.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610250754.AA183900048>