1

I have an (MBR) external hard drive with the following partitions:

250GB xfs, 600GB swap, 81GB vfat

The swap partition is actually a placeholder for a single OpenBSD filesystem.

I've tried using fdisk to change the partition type to OpenBSD (A6) but disklabel only recognises the other two. Using disklabel without fdisk does not let me change the partition type to 4.2BSD.

I gather from documentation that I should use fdisk to create a MBR partition in which to then use disklabel to create filesystems.

I would rather ask than lose data. What is the correct way to accomplish this?

LSD
  • 21

1 Answers1

1

disklabel doesn't show the OpenBSD partition because you are using disklabel to edit the structure of it. If you execute p g in the prompt of disklabel, it will show something like this:

OpenBSD area: 64-1234567890; size: 0.0G; free: 600.0G

You can add the partitions with the command a. To add the first partition use a a, for the swap a b, for the third partition a d. The partition b is used for the swap and c is the hard disk. It's the convention used traditionally by the BSD OS.

disklabel will not destroy the data in the Linux/Windows partitions, it only works within the limits of the OpenBSD partition. fdisk can destroy everything.

If you want something easy, use A in the disklabel prompt. It creates a structure with different partitions. With c letterofpartition, you can change the partition sizes. h shows the different commands.