I just built a new computer and it has two hard drives in it. I was originally going to put them into RAID1, but since the onboard controller turned out to basically be a software controller and not a true hardware one, it was too much of a headache to configure right now. What I now want to do is use the second disk (partially) as a /home that I can maintain during upgrades, etc. I have one setup like this for Slackware already, but I'm trying to get this accomplished in NetBSD. Here is the setup:

I need to format it (I assume that will be done using fdisk), and then configure NetBSD on sda3 to mount it as /home (edit fstab?).

fdisk(8) is only used to create MBR partitions. If the second disk was only going to be used for NetBSD, use of fdisk(8) would not be required at all. MBR partitions are only required because two separate filesystems will reside on the same disk.

Most likely, the second disk will be /dev/wd1 which can be confirmed in the output of dmesg(8). By the time you see dmesg(8) output, you will have already resolved the problem of ensuring that the BIOS is booting the correct drive. If you end up fighting this battle, there will either be a BIOS setting that controls which drive is used for booting, or else you will have to determine which IDE channel is for the boot device by swapping cables.

Once the second drive is partitioned in the MBR sense, you will need to create any NetBSD slice needed (outside of slice d which is defined by default...) through disklabel(8). Once all NetBSD slices needed have been defined, each NetBSD filesystem will need to be initialize via newfs(8)(excluding slice d or b if defined...). Note that slices will not be able to be mounted until newfs(8) has been used to initialize them. You will need to boot NetBSD with the second drive attached & initialize each slice before mounting either manually or entering into fstab(5).

Note that the installation program performs the very same steps:

Identify what disks will be used by NetBSD.

Run fdisk(8) as needed.

Run disklabel(8) to define slices.

Run newfs(8) on each slice (excluding b or d...) to initialize each filesystem.

Construct /etc/fstab.

Quote:

What I figure is format it with fdisk (not certain of the correct format and sequence of the switches) and then edit fstab to have it mount.

/dev/wd1b /home ffs rw 1 2

Is that the correct fstab entry?

As you become more familiar with NetBSD, you will memorize the following topology:

...which diagrammatically describes how NetBSD slices relate to the overall disk. Slice b is always used for swap if any swap space is allocated, & slice dalways represents the entire disk. Any other slice can be used for any other use, however by convention, a is considered to contain a bootable kernel.

Yes, it is unfortunate that the term "partition" in the Intel world contradicts what is meant in the *BSD world, but that is the way it is. The *BSD concept transcends platforms, so the terminology comes from a different focus.