netbsd 3 + sparc64 + new disk

Categories: NetBSD

straight from the bsd forums – so stop asking me how to do it

bsd forum link

Step 1: backup disktab, add autogenerated disk geometry to disktab (or use a seperate file for your disktab entry, see disklabel man page for info on doing this)

# cd /etc
# cp disktab disktab.bak
# disklabel -t sd0 >>/etc/disktab

Step 2: edit new disktab entry

#pico disktab
(yeah, yeah, should use vi, emacs…)

All fields are colon delimited. The first field is the label, this field can contain as many labels as you want, (eg, disk3, seagate, etc) delimited by “|” It makes no difference what the label is, just remember it. The next several fields are hard geometries, if some fields are missing, that’s because they use the default value. Next up are your partitions, this is the part I was most worried about screwing up, and I’m not sure if I did it the ‘proper’ way, but it worked. ‘pa’ ‘pb’ ‘pc’ etc are the size of the partitions, and ‘oa’ ‘ob’ etc are the offsets of each partition (which block the partition starts at). I wanted one big partition, and the auto generated disktab entry had 8 partions, all setup with their respective offsets and sizes; so I added up the sizes of all the partitions to get the size for my one partition, and set the offset to 0 (the begginiing of the disk). The remaining field specify file system tvpe (should be 4.2BSD) block size, and so on, and should be left alone.

Step 3: disklabel

#disklabel -w sd0 foobar

where foobar is the label you put in your disktab entry.

note: don’t use -r on sparc. See man disklabel for more on why.

Step 4: newfs

# newfs /dev/sd0a

-just sd0a should work as well
-a is my partition, you may have more partitions, up to a-h

Step 5: mount (you can skip this, it is only for testing purposes)

# mount /dev/sd0a /mnt

/mnt or any other empty directory can be used for to mount the volume

when you are done with the volume

# umount /mnt

Step 6: make disk mount at boot

# mkdir /disk2
# cd /etc
# pico fstab

add somthing like this:
/dev/sd0a /disk2 ffs rw 1 2

note: /disk2 can be replaced with any empty directory


    Leave a Reply

    Your email address will not be published. Required fields are marked *