Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 1996 14:42:50 +0200 (EET)
From:      "Andrew V. Stesin" <stesin@elvisti.kiev.ua>
To:        lehey.pad@sni.de (Greg Lehey)
Cc:        jfieber@indiana.edu, doc@freebsd.org
Subject:   Re: Frustrated....doc@freebsd.org
Message-ID:  <199601221242.OAA15406@office.elvisti.kiev.ua>
In-Reply-To: <199601181707.SAA22673@nixpbe.pdb.sni.de> from "Greg Lehey" at Jan 18, 96 06:03:14 pm

next in thread | previous in thread | raw e-mail | index | archive | help
# > I formatted a new hard drive once, but I don't think I would be able to
# > duplicate, much less describe, the experience.
# 
# Of course not.  It's indescribable :-)
# 
# Greg
# 
Please, here is the description of how I'm doing this.

Disclaimer: worked for me on SCSI disks, maybe IDE has some
differences? At least some variations of "BIOS LBA mode"
and especially "PIO mode >= 2" didn't work for some of my
friends.

Disclaimer 2: I have a strong opinion that in case you do want
to have more than one OS on your machine, for example 3 ones,
you'd better have 3 boot partitions on your boot HDD,
inside "whatever BIOS thinks to be the first 1024 cyls" area,
and it's better to have FreeBSD
to be installed _after_ all messydoses, os-half's or whatever.
Generally this way of setting things up saves the time, though
some people are doing another, more complex things too.

Disclaimer 3: Last time I was adding a new disk was two days ago,
when I was installing an IBM DPES 31080S   1.08Gb SCSI disk
instead of a Conner CFP 1060S, which died. Just now I don't
have a sacrificial disk to play with, I'm describing the procedure
from memory. All errors and typos are mine.

1. 2.1 and later FreeBSD systems do have a copy of sysinstall program
   in /stand. You need to have 'gzipped executables' enabled in your
   kernel, though (GENERIC kernel has).

2. Add a new HDD and make the system recognize it correctly during
   the boot probe. I even do a low-level format of the disk with
   a DOS scsifmt utility, to be sure that the disk is virgin clean,
   no old bootloaders, partition tables, etc.

3. Launch /stand/sysinstall. Select "Custom" install, than "Partition"
   the disk. I presume you aren't adding a new boot disk :)
   For example you have sd0 and sd1 already here, so switch "on" only
   a checkbox for your new disk (i.e. sd2).

4. You get to a b/w screen of visual fdisk. Ok, you see an empty disk;
   I usually press "A" (this means "use All disk") here. YMMV,
   of course. For SCSI disks, after "A" command, when it asks about cooperation
   with other OSes, I answer  "No", and than "Yes" ("Yes, I insist").
   Geometry warnings are to be ignored for SCSI disks.

   Anyway, at this step you must perform all the actions similarly
   to those you do in DOS with it's fdisk -- to create a partition
   table which suit your needs.  If you want to have not only a FreeBSD
   slice on this disk, but someone's else, I'd suggest booting DOS
   and create that "other" partition with dos' fdisk first.

   [... maybe a screen shapshots of visual fdisk must be added here? ...]

   For example, assume you have created a slice which is called
   sd2s3 with the above procedure (why "s3"? simply for example,
   if the disk is FreeBSD only, that will be sd2s1).

 5. Than press "W" ("Write the partition table") here. Than "Yes",
    you really want it to be written now. Ok, your'e done with
    "partitions", or "slices" as they are called in UNIX world.
    Pressing "Q" will return you to the upper menu now.

    Note. Yes, there is another fdisk around, it is command-line
    oriented. You may use it, of course. But I found visual fdisk
    from sysinstall to be more convenient and less headache to use;
    and you don't need a 'bc' calculator handy to count sectors,
    cylinders and other mistery. :)   BTW it seems to me that
    vizual fdisk has some useful buit-in deep magic in it. ;)

6. Now you'd like to sub-divide the fresh partition (slice) into
   pieces, let's call them "subslices" -- each one has
   it's own file system in it. Their names are derived from the
   slice name with adding a single letter to it. Some of the letters
   do have a "reserved" meaning:

   'a' is for bootable filesystem, usually only a boot drive has one
       (sd0s1a, or sd0a);
   'b' is for swap area (it won't have a filesystem on it);
   'c' subslice is used for the purpose of accessing the whole
       FreeBSD slice, in our case it will be sd2s3c; DON'T TOUCH IT.
   'd' [... I didn't see one since 2.1, is it still used? ...]

   The letters 'e' and further are to mark subslices which contain
   filesystems. So assume we have 1000000 sectors (500Mb) in our
   sd2s3 slice, and want to have 100Mb of swap area and 2 filesystems
   inside it, one is 300Mb and one is 100Mb. The first 123456 sectors
   of the disk are used by other OSes, we don't care.

   The program which is called "disklabel" is used for this purpose.
   /stand/sysinstall has a "visual disklabel" built-in, but I
   always was afraid that it will do something with my existing
   filesystems (it shows them all in it's menu, and I'm not brave enough
   to check what will it do :)  So I'm using another, standalone disklabel
   program.

   So, after doing fdisk I quit from visual sysinstall and do

   disklabel -r -e sd2

7. disklabel will call your ${EDITOR} on a formatted disk label
   of a new slice (there's a single FreeBSD slice on sd2, our sd2s3,
   you remember?)  The only line which you need to pay attention at
   is the following one starts with "c:"

#          size:   offset:  fstype:  [ .... ]

[... whatever is written here ...]

   c:    1000000   123456   unused   0  0 


   Those 1000000 sectors are those you will divide into parts.
   The next few minutes you'll fight with your ${EDITOR} and
   bc calculator, calculating offsets/sectors; at least, you'd
   get the following after your "c:" slice description:

#          size:   offset:  fstype:  [ .... ]

   c:    1000000   123456   unused   0  0 
   b:     200000   123456   swap
   e:     600000   323456   4.2BSD   0  0  0
   f:     200000   923456   4.2BSD   0  0  0

   Make sure your b: e: f: subslices are not overlapping each other,
   and the last subslice (f:) doesn't go anywhere _after the last
   available disk sector_.

   Exit from your editor, saving the file;
   disklabel will write an edited label to disk.

8. Subslices are created; now create file systems inside them:

	newfs /dev/rsd2s3e
	newfs /dev/rsd2s3f

   Reading newfs manpage will be Ok before using it :)

9. Check are they Ok:

	fsck /dev/rsd2s3e
	fsck /dev/rsd2s3f

10. You are done. Auto mounting new filesystems on reboot?
    Edit /etc/fstab accordingly.

-- 

	With best regards -- Andrew Stesin.

	+380 (44) 2760188	+380 (44) 2713457	+380 (44) 2713560

	An undocumented feature is a coding error.



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