From owner-freebsd-questions Fri Oct 25 03:53:19 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA08521 for questions-outgoing; Fri, 25 Oct 1996 03:53:19 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id DAA08491 for ; Fri, 25 Oct 1996 03:53:09 -0700 (PDT) Received: from hp.com (hp.com [15.255.152.4]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id AAA15588 for ; Fri, 25 Oct 1996 00:54:22 -0700 (PDT) Received: from srmail.sr.hp.com by hp.com with ESMTP (1.37.109.16/15.5+ECS 3.3) id AA001020050; Fri, 25 Oct 1996 00:54:10 -0700 Received: from hpnmhjw.sr.hp.com by srmail.sr.hp.com with ESMTP (1.37.109.16/15.5+ECS 3.3) id AA132540049; Fri, 25 Oct 1996 00:54:09 -0700 Received: from mina.sr.hp.com by hpnmhjw.sr.hp.com with SMTP (1.37.109.16/15.5+ECS 3.3) id AA183900048; Fri, 25 Oct 1996 00:54:08 -0700 Message-Id: <199610250754.AA183900048@hpnmhjw.sr.hp.com> To: Doug White Cc: "S(pork)" , questions@freefall.freebsd.org Subject: Re: installation of 4gig SCSI HD under 2.1.5 Reply-To: darrylo@sr.hp.com Date: Fri, 25 Oct 1996 00:54:08 -0700 From: Darryl Okahata Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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.