Table of Contents

fdisk

Linux and NetBSD Partitioning

Partitioning drives in NetBSD is different than Linux. In Linux, there is one MBR table with partitions for as many filesystems as you would like.

In NetBSD, one partition is created from the original four that are found with an MBR table, then disklabel is used to create it's own form of partitions called slices within the MBR partition.

In other words, running fdisk in Linux on a hard drive with NetBSD installed, would show only one partition created.

netbsd-vm Example

Linux

The drives here are IDE drives, so they show up as wdX instead of sdX in NetBSD.

Here's what fdisk -l /dev/sda would return in Linux, for the MBR partitions:

Disk /dev/sda: 12.9 GB, 12884901888 bytes, 25165824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    25165823    12581888   a9  NetBSD
NetBSD

fdisk wd0 will also show the MBR partitions:

Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 24966, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 25165824

BIOS disk geometry:
cylinders: 1024, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 25165824

Partitions aligned to 2048 sector boundaries, offset 2048

Partition table:
0: NetBSD (sysid 169)
    start 2048, size 25163776 (12287 MB, Cyls 0-1566/127/33), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
First active partition: 0