Computerglitch

An ongoing adventure

Adding a New Hard Drive to OpenBSD

This tip assumes the ENTIRE disk will be used for OpenBSD.


First initialize the MBR, and overwrite using the default template:

# fdisk -i sd1

Note: Substitue sd1 for your disk


Next use disklabel to modify the current partition layout:

# disklabel -E sd1
> p m

Note: p m will display the current partitions on the disk


Delete all partitions except c:

> d a
> d b
> d d

Note: The “d” deletes the specified partition. “d a” deleted partiton “a”


Create the new OpenBSD partition on the disk:

> a a
offset: [63] <enter>
size: [53464257] 34700m
FS type: [4.2BSD] <enter>

Note: Change the 34700m to the full size of the disk you have. The disk in this example was 34.7Gb in size.


Now build a new file system on the disk using the following command:

# newfs sd1a

Finally, make a directory where you would like to mount the disk.

# mkdir /files

Mount the disk.

# mount /dev/sd1a /files

Comments