summaryrefslogtreecommitdiffstats
path: root/tests/expected/fdisk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:14:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:14:44 +0000
commit30ff6afe596eddafacf22b1a5b2d1a3d6254ea15 (patch)
tree9b788335f92174baf7ee18f03ca8330b8c19ce2b /tests/expected/fdisk
parentInitial commit. (diff)
downloadutil-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.tar.xz
util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.zip
Adding upstream version 2.36.1.upstream/2.36.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/expected/fdisk')
-rw-r--r--tests/expected/fdisk/align-512-4K80
-rw-r--r--tests/expected/fdisk/align-512-4K-6381
-rw-r--r--tests/expected/fdisk/align-512-4K-md80
-rw-r--r--tests/expected/fdisk/align-512-51268
-rw-r--r--tests/expected/fdisk/align-512-512-topology80
-rw-r--r--tests/expected/fdisk/bsd_0_64.BE213
-rw-r--r--tests/expected/fdisk/bsd_0_64.LE213
-rw-r--r--tests/expected/fdisk/bsd_0_64_alpha.LE217
-rw-r--r--tests/expected/fdisk/bsd_1_0.BE213
-rw-r--r--tests/expected/fdisk/bsd_1_0.LE213
-rw-r--r--tests/expected/fdisk/gpt138
-rw-r--r--tests/expected/fdisk/gpt-resize43
-rw-r--r--tests/expected/fdisk/gpt-resize.err4
-rw-r--r--tests/expected/fdisk/id5
-rw-r--r--tests/expected/fdisk/id.sparc3
-rw-r--r--tests/expected/fdisk/mbr-dos-mode189
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-1nd-primary-delete19
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-1st-active15
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-1st-primary15
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-1st-primary-delete20
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-1st-primary-recreate15
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-2nd-primary16
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-empty-pt14
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-extended17
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-extended-delete12
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-first-sector-at-end47
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-logical21
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-logical-delete18
-rw-r--r--tests/expected/fdisk/mbr-nondos-mode-logical-recreate21
-rw-r--r--tests/expected/fdisk/mbr-sort75
-rw-r--r--tests/expected/fdisk/oddinput7
-rw-r--r--tests/expected/fdisk/oddinput.err4
-rw-r--r--tests/expected/fdisk/oddinput.toosmall1
-rw-r--r--tests/expected/fdisk/sunlabel80
34 files changed, 2257 insertions, 0 deletions
diff --git a/tests/expected/fdisk/align-512-4K b/tests/expected/fdisk/align-512-4K
new file mode 100644
index 0000000..ec06613
--- /dev/null
+++ b/tests/expected/fdisk/align-512-4K
@@ -0,0 +1,80 @@
+Create partitions
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+
+Command (m for help): Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +/-sectors or +/-size{K,M,G,T,P} (22528-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (2 primary, 0 extended, 2 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +/-sectors or +/-size{K,M,G,T,P} (43008-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (3 primary, 0 extended, 1 free)
+ e extended (container for logical partitions)
+Select (default e):
+Selected partition 4
+First sector (63488-102399, default 63488): Last sector, +/-sectors or +/-size{K,M,G,T,P} (63488-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 5
+First sector (65536-102399, default 65536): Last sector, +/-sectors or +/-size{K,M,G,T,P} (65536-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 6
+First sector (77824-102399, default 77824): Last sector, +/-sectors or +/-size{K,M,G,T,P} (77824-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 7
+First sector (90112-102399, default 90112): Last sector, +/-sectors or +/-size{K,M,G,T,P} (90112-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+<removed>2 22528 43007 20480 10M 83 Linux
+<removed>3 43008 63487 20480 10M 83 Linux
+<removed>4 63488 102399 38912 19M 5 Extended
+<removed>5 65536 75775 10240 5M 83 Linux
+<removed>6 77824 88063 10240 5M 83 Linux
+<removed>7 90112 102399 12288 6M 83 Linux
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+Alignment offsets:
+0
+0
+0
+0
+0
+0
+0
diff --git a/tests/expected/fdisk/align-512-4K-63 b/tests/expected/fdisk/align-512-4K-63
new file mode 100644
index 0000000..f7a0c9f
--- /dev/null
+++ b/tests/expected/fdisk/align-512-4K-63
@@ -0,0 +1,81 @@
+Create partitions
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+
+Command (m for help): Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (7-102399, default 7): Last sector, +/-sectors or +/-size{K,M,G,T,P} (7-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (20487-102399, default 20487): Last sector, +/-sectors or +/-size{K,M,G,T,P} (20487-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (2 primary, 0 extended, 2 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (3,4, default 3): First sector (40967-102399, default 40967): Last sector, +/-sectors or +/-size{K,M,G,T,P} (40967-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (3 primary, 0 extended, 1 free)
+ e extended (container for logical partitions)
+Select (default e):
+Selected partition 4
+First sector (61447-102399, default 61447): Last sector, +/-sectors or +/-size{K,M,G,T,P} (61447-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 5
+First sector (61454-102399, default 63487): Last sector, +/-sectors or +/-size{K,M,G,T,P} (63487-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 6
+First sector (61454-102399, default 75775): Last sector, +/-sectors or +/-size{K,M,G,T,P} (75775-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 7
+First sector (61454-102399, default 88063): Last sector, +/-sectors or +/-size{K,M,G,T,P} (88063-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Alignment offset: 3584 bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 7 20486 20480 10M 83 Linux
+<removed>2 20487 40966 20480 10M 83 Linux
+<removed>3 40967 61446 20480 10M 83 Linux
+<removed>4 61447 102399 40953 20M 5 Extended
+<removed>5 63487 73726 10240 5M 83 Linux
+<removed>6 75775 86014 10240 5M 83 Linux
+<removed>7 88063 102399 14337 7M 83 Linux
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+Alignment offsets:
+0
+0
+0
+0
+0
+0
+0
diff --git a/tests/expected/fdisk/align-512-4K-md b/tests/expected/fdisk/align-512-4K-md
new file mode 100644
index 0000000..d8ca0d7
--- /dev/null
+++ b/tests/expected/fdisk/align-512-4K-md
@@ -0,0 +1,80 @@
+Create partitions
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+
+Command (m for help): Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (51199-102399, default 51200): Last sector, +/-sectors or +/-size{K,M,G,T,P} (51200-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 51198 49151 24M 83 Linux
+<removed>2 51200 100350 49151 24M 83 Linux
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+Alignment offsets:
+0
+0
+Create partitions (MD)
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (2048-97791, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-97791, default 97791):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (22528-97791, default 22528): Last sector, +/-sectors or +/-size{K,M,G,T,P} (22528-97791, default 97791):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 47.75 MiB, 50069504 bytes, 97792 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 65536 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>p1 2048 22527 20480 10M 83 Linux
+<removed>p2 22528 43007 20480 10M 83 Linux
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+Alignment offsets (MD):
+0
+0
diff --git a/tests/expected/fdisk/align-512-512 b/tests/expected/fdisk/align-512-512
new file mode 100644
index 0000000..782beca
--- /dev/null
+++ b/tests/expected/fdisk/align-512-512
@@ -0,0 +1,68 @@
+Create partitions
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+
+Command (m for help): Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +/-sectors or +/-size{K,M,G,T,P} (22528-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (2 primary, 0 extended, 2 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +/-sectors or +/-size{K,M,G,T,P} (43008-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (3 primary, 0 extended, 1 free)
+ e extended (container for logical partitions)
+Select (default e):
+Selected partition 4
+First sector (63488-102399, default 63488): Last sector, +/-sectors or +/-size{K,M,G,T,P} (63488-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 5
+First sector (65536-102399, default 65536): Last sector, +/-sectors or +/-size{K,M,G,T,P} (65536-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 6
+First sector (77824-102399, default 77824): Last sector, +/-sectors or +/-size{K,M,G,T,P} (77824-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 7
+First sector (90112-102399, default 90112): Last sector, +/-sectors or +/-size{K,M,G,T,P} (90112-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>p1 2048 22527 20480 10M 83 Linux
+<removed>p2 22528 43007 20480 10M 83 Linux
+<removed>p3 43008 63487 20480 10M 83 Linux
+<removed>p4 63488 102399 38912 19M 5 Extended
+<removed>p5 65536 75775 10240 5M 83 Linux
+<removed>p6 77824 88063 10240 5M 83 Linux
+<removed>p7 90112 102399 12288 6M 83 Linux
+
+Command (m for help):
diff --git a/tests/expected/fdisk/align-512-512-topology b/tests/expected/fdisk/align-512-512-topology
new file mode 100644
index 0000000..2ca9893
--- /dev/null
+++ b/tests/expected/fdisk/align-512-512-topology
@@ -0,0 +1,80 @@
+Create partitions
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+Device does not contain a recognized partition table.
+
+Command (m for help): Created a new disklabel.
+
+Command (m for help): Partition type
+ p primary (0 primary, 0 extended, 4 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (1-4, default 1): First sector (2048-102399, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (22528-102399, default 22528): Last sector, +/-sectors or +/-size{K,M,G,T,P} (22528-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (2 primary, 0 extended, 2 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (3,4, default 3): First sector (43008-102399, default 43008): Last sector, +/-sectors or +/-size{K,M,G,T,P} (43008-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Partition type
+ p primary (3 primary, 0 extended, 1 free)
+ e extended (container for logical partitions)
+Select (default e):
+Selected partition 4
+First sector (63488-102399, default 63488): Last sector, +/-sectors or +/-size{K,M,G,T,P} (63488-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 5
+First sector (65536-102399, default 65536): Last sector, +/-sectors or +/-size{K,M,G,T,P} (65536-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 6
+First sector (77824-102399, default 77824): Last sector, +/-sectors or +/-size{K,M,G,T,P} (77824-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): All primary partitions are in use.
+Adding logical partition 7
+First sector (90112-102399, default 90112): Last sector, +/-sectors or +/-size{K,M,G,T,P} (90112-102399, default 102399):
+Created a new partition <removed>.
+
+Command (m for help): Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Disk model: scsi_debug
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 22527 20480 10M 83 Linux
+<removed>2 22528 43007 20480 10M 83 Linux
+<removed>3 43008 63487 20480 10M 83 Linux
+<removed>4 63488 102399 38912 19M 5 Extended
+<removed>5 65536 75775 10240 5M 83 Linux
+<removed>6 77824 88063 10240 5M 83 Linux
+<removed>7 90112 102399 12288 6M 83 Linux
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
+
+Alignment offsets:
+0
+0
+0
+0
+0
+0
+0
diff --git a/tests/expected/fdisk/bsd_0_64.BE b/tests/expected/fdisk/bsd_0_64.BE
new file mode 100644
index 0000000..b502d0d
--- /dev/null
+++ b/tests/expected/fdisk/bsd_0_64.BE
@@ -0,0 +1,213 @@
+BSD_LABELSECTOR=0
+BSD_LABELOFFSET=64
+BSD_EXTRA=
+BYTE_ORDER=BE
+
+Initialize empty image
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Create new DOS partition table
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create 1st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 00 |!..A............|
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+-------------------
+
+Create 2st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e 83 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Set 2nd partition type
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 20479 16384 8M a5 FreeBSD
+-------------------
+
+Create default BSD
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 82 56 45 57 00 06 00 00 00 00 00 00 00 00 00 00 |.VEW............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 3f |...............?|
+00200070 00 00 00 ff 00 00 00 01 00 00 3e c1 00 00 3e c1 |..........>...>.|
+00200080 00 00 00 00 00 00 00 00 0e 10 00 01 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....|
+002000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 82 56 45 57 62 33 00 04 00 00 20 00 |.....VEWb3.... .|
+002000d0 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 |.. .............|
+002000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 |......@.........|
+00200100 00 00 00 00 00 00 3e c1 00 00 00 00 00 00 00 00 |......>.........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 82 56 45 57 00 06 00 00 00 00 00 00 00 00 00 00 |.VEW............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 3f |...............?|
+00200070 00 00 00 ff 00 00 00 01 00 00 3e c1 00 00 3e c1 |..........>...>.|
+00200080 00 00 00 00 00 00 00 00 0e 10 00 01 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....|
+002000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 82 56 45 57 7d 32 00 04 00 00 20 00 |.....VEW}2.... .|
+002000d0 00 00 20 00 00 00 08 01 00 00 10 00 00 00 00 00 |.. .............|
+002000e0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 |......@.........|
+00200100 00 00 00 00 00 00 3e c1 00 00 00 00 00 00 00 00 |......>.........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+a 4096 6144 2049 1M 4.2BSD 0 0 0
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+
+
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help):
+00 unused 05 4.1BSD 09 4.4LFS 0d boot
+01 swap 06 Eighth Edition 0a unknown 0e ADOS
+02 Version 6 07 4.2BSD 0b HPFS 0f HFS
+03 Version 7 08 MS-DOS 0c ISO-9660 10 AdvFS
+04 System V
+
+Command (m for help):
diff --git a/tests/expected/fdisk/bsd_0_64.LE b/tests/expected/fdisk/bsd_0_64.LE
new file mode 100644
index 0000000..8b9897c
--- /dev/null
+++ b/tests/expected/fdisk/bsd_0_64.LE
@@ -0,0 +1,213 @@
+BSD_LABELSECTOR=0
+BSD_LABELOFFSET=64
+BSD_EXTRA=
+BYTE_ORDER=LE
+
+Initialize empty image
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Create new DOS partition table
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create 1st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 00 |!..A............|
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+-------------------
+
+Create 2st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e 83 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Set 2nd partition type
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 20479 16384 8M a5 FreeBSD
+-------------------
+
+Create default BSD
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200070 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200080 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
+002000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 57 45 56 82 33 62 04 00 00 20 00 00 |....WEV.3b... ..|
+002000d0 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |. ..............|
+002000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+00200100 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200070 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200080 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
+002000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 57 45 56 82 35 7a 04 00 00 20 00 00 |....WEV.5z... ..|
+002000d0 00 20 00 00 01 08 00 00 00 10 00 00 00 00 00 00 |. ..............|
+002000e0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+00200100 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+a 4096 6144 2049 1M 4.2BSD 0 0 0
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+
+
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help):
+00 unused 05 4.1BSD 09 4.4LFS 0d boot
+01 swap 06 Eighth Edition 0a unknown 0e ADOS
+02 Version 6 07 4.2BSD 0b HPFS 0f HFS
+03 Version 7 08 MS-DOS 0c ISO-9660 10 AdvFS
+04 System V
+
+Command (m for help):
diff --git a/tests/expected/fdisk/bsd_0_64_alpha.LE b/tests/expected/fdisk/bsd_0_64_alpha.LE
new file mode 100644
index 0000000..ae7dabd
--- /dev/null
+++ b/tests/expected/fdisk/bsd_0_64_alpha.LE
@@ -0,0 +1,217 @@
+BSD_LABELSECTOR=0
+BSD_LABELOFFSET=64
+BSD_EXTRA=_alpha
+BYTE_ORDER=LE
+
+Initialize empty image
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Create new DOS partition table
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create 1st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 00 |!..A............|
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+-------------------
+
+Create 2st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e 83 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Set 2nd partition type
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 20479 16384 8M a5 FreeBSD
+-------------------
+
+Create default BSD
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200070 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200080 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 57 45 56 82 13 62 04 00 00 20 00 00 |....WEV..b... ..|
+002000d0 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |. ..............|
+002000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+00200100 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002001f0 00 00 00 00 00 00 00 00 3a 27 5c 82 1f 23 57 82 |........:'\..#W.|
+00200200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200040 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200060 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200070 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200080 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002000c0 00 00 00 00 57 45 56 82 15 7a 04 00 00 20 00 00 |....WEV..z... ..|
+002000d0 00 20 00 00 01 08 00 00 00 10 00 00 00 00 00 00 |. ..............|
+002000e0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002000f0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+00200100 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+00200110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+002001f0 00 00 00 00 00 00 00 00 43 4f 5c 82 20 2b 57 82 |........CO\. +W.|
+00200200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+a 4096 6144 2049 1M 4.2BSD 0 0 0
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+
+
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help):
+00 unused 05 4.1BSD 09 4.4LFS 0d boot
+01 swap 06 Eighth Edition 0a unknown 0e ADOS
+02 Version 6 07 4.2BSD 0b HPFS 0f HFS
+03 Version 7 08 ext2 0c ISO-9660 10 AdvFS
+04 System V
+
+Command (m for help):
diff --git a/tests/expected/fdisk/bsd_1_0.BE b/tests/expected/fdisk/bsd_1_0.BE
new file mode 100644
index 0000000..56dd69b
--- /dev/null
+++ b/tests/expected/fdisk/bsd_1_0.BE
@@ -0,0 +1,213 @@
+BSD_LABELSECTOR=1
+BSD_LABELOFFSET=0
+BSD_EXTRA=
+BYTE_ORDER=BE
+
+Initialize empty image
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Create new DOS partition table
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create 1st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 00 |!..A............|
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+-------------------
+
+Create 2st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e 83 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Set 2nd partition type
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 20479 16384 8M a5 FreeBSD
+-------------------
+
+Create default BSD
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200200 82 56 45 57 00 06 00 00 00 00 00 00 00 00 00 00 |.VEW............|
+00200210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200220 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 3f |...............?|
+00200230 00 00 00 ff 00 00 00 01 00 00 3e c1 00 00 3e c1 |..........>...>.|
+00200240 00 00 00 00 00 00 00 00 0e 10 00 01 00 00 00 00 |................|
+00200250 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....|
+00200260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200280 00 00 00 00 82 56 45 57 62 33 00 04 00 00 20 00 |.....VEWb3.... .|
+00200290 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 |.. .............|
+002002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002002b0 00 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 |......@.........|
+002002c0 00 00 00 00 00 00 3e c1 00 00 00 00 00 00 00 00 |......>.........|
+002002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200200 82 56 45 57 00 06 00 00 00 00 00 00 00 00 00 00 |.VEW............|
+00200210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200220 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 3f |...............?|
+00200230 00 00 00 ff 00 00 00 01 00 00 3e c1 00 00 3e c1 |..........>...>.|
+00200240 00 00 00 00 00 00 00 00 0e 10 00 01 00 00 00 00 |................|
+00200250 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....|
+00200260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200280 00 00 00 00 82 56 45 57 7d 32 00 04 00 00 20 00 |.....VEW}2.... .|
+00200290 00 00 20 00 00 00 08 01 00 00 10 00 00 00 00 00 |.. .............|
+002002a0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002002b0 00 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 |......@.........|
+002002c0 00 00 00 00 00 00 3e c1 00 00 00 00 00 00 00 00 |......>.........|
+002002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+a 4096 6144 2049 1M 4.2BSD 0 0 0
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+
+
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help):
+00 unused 05 4.1BSD 09 4.4LFS 0d boot
+01 swap 06 Eighth Edition 0a unknown 0e ADOS
+02 Version 6 07 4.2BSD 0b HPFS 0f HFS
+03 Version 7 08 MS-DOS 0c ISO-9660 10 AdvFS
+04 System V
+
+Command (m for help):
diff --git a/tests/expected/fdisk/bsd_1_0.LE b/tests/expected/fdisk/bsd_1_0.LE
new file mode 100644
index 0000000..492e2a6
--- /dev/null
+++ b/tests/expected/fdisk/bsd_1_0.LE
@@ -0,0 +1,213 @@
+BSD_LABELSECTOR=1
+BSD_LABELOFFSET=0
+BSD_EXTRA=
+BYTE_ORDER=LE
+
+Initialize empty image
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Create new DOS partition table
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
+000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create 1st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 00 |!..A............|
+000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+-------------------
+
+Create 2st primary partition
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e 83 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+Set 2nd partition type
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 20479 16384 8M a5 FreeBSD
+-------------------
+
+Create default BSD
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200200 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200220 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200230 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200240 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200250 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
+00200260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200280 00 00 00 00 57 45 56 82 33 62 04 00 00 20 00 00 |....WEV.3b... ..|
+00200290 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |. ..............|
+002002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002002b0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+002002c0 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+002002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+000001b0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 20 |............... |
+000001c0 21 00 83 41 01 00 00 08 00 00 00 08 00 00 00 04 |!..A............|
+000001d0 01 3e a5 13 41 36 00 10 00 00 00 40 00 00 00 00 |.>..A6.....@....|
+000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
+00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200200 57 45 56 82 06 00 00 00 00 00 00 00 00 00 00 00 |WEV.............|
+00200210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00200220 00 00 00 00 00 00 00 00 00 02 00 00 3f 00 00 00 |............?...|
+00200230 ff 00 00 00 01 00 00 00 c1 3e 00 00 c1 3e 00 00 |.........>...>..|
+00200240 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00 |................|
+00200250 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 |........ .......|
+00200260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00200280 00 00 00 00 57 45 56 82 35 7a 04 00 00 20 00 00 |....WEV.5z... ..|
+00200290 00 20 00 00 01 08 00 00 00 10 00 00 00 00 00 00 |. ..............|
+002002a0 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+002002b0 00 00 00 00 00 40 00 00 00 10 00 00 00 00 00 00 |.....@..........|
+002002c0 00 00 00 00 c1 3e 00 00 00 00 00 00 00 00 00 00 |.....>..........|
+002002d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+*
+00a00000
+
+---layout----------
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help): Disk <removed>2: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1 cylinders
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: bsd
+
+Slice Start End Sectors Size Type Fsize Bsize Cpg
+a 4096 6144 2049 1M 4.2BSD 0 0 0
+c 4096 20479 16384 8M unused 0 0 0
+d 0 16064 16065 7.8M unused 0 0 0
+
+Partition table entries are not in disk order.
+
+Command (m for help): Leaving nested disklabel.
+
+Command (m for help):
+-------------------
+
+
+
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Entering nested BSD disklabel.
+
+Command (m for help):
+00 unused 05 4.1BSD 09 4.4LFS 0d boot
+01 swap 06 Eighth Edition 0a unknown 0e ADOS
+02 Version 6 07 4.2BSD 0b HPFS 0f HFS
+03 Version 7 08 MS-DOS 0c ISO-9660 10 AdvFS
+04 System V
+
+Command (m for help):
diff --git a/tests/expected/fdisk/gpt b/tests/expected/fdisk/gpt
new file mode 100644
index 0000000..3244874
--- /dev/null
+++ b/tests/expected/fdisk/gpt
@@ -0,0 +1,138 @@
+Initialize empty image
+Create new GPT partition table
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+-------------------
+
+Create partitions
+Change partition type by number
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>2 4096 6143 2048 1M Linux filesystem
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux filesystem
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
+Change partition type by UUID
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>2 4096 6143 2048 1M Linux filesystem
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux swap
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
+Delete partition
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux swap
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
+Create again partition
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>2 4096 6143 2048 1M Linux filesystem
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux swap
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
+Corrupt primary table
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>2 4096 6143 2048 1M Linux filesystem
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux swap
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
+Corrupt backup table
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>1 2048 4095 2048 1M EFI System
+<removed>2 4096 6143 2048 1M Linux filesystem
+<removed>3 6144 8191 2048 1M Linux filesystem
+<removed>4 8192 10239 2048 1M Linux filesystem
+<removed>5 10240 12287 2048 1M Linux swap
+<removed>6 12288 14335 2048 1M Linux filesystem
+<removed>7 14336 16383 2048 1M Linux filesystem
+<removed>8 16384 18431 2048 1M Linux filesystem
+-------------------
+
diff --git a/tests/expected/fdisk/gpt-resize b/tests/expected/fdisk/gpt-resize
new file mode 100644
index 0000000..64b6c43
--- /dev/null
+++ b/tests/expected/fdisk/gpt-resize
@@ -0,0 +1,43 @@
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+
+>>> Created a new disklabel.
+<removed>p1: Created a new partition <removed>.
+<removed>p2: Done.
+
+New situation:
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>p1 2048 20446 18399 9M Linux filesystem
+
+The partition table has been altered.
+----- fixing after resize: -----
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Partition number (2-128, default 2): First sector (20447-40926, default 20480): Last sector, +/-sectors or +/-size{K,M,G,T,P} (20480-40926, default 40926):
+Created a new partition <removed>.
+
+Command (m for help): The partition table has been altered.
+Calling ioctl() to re-read partition table.
+
+The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
+
+----- list result: -----
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Sectors Size Type
+<removed>p1 2048 20446 18399 9M Linux filesystem
+<removed>p2 20480 40926 20447 10M Linux filesystem
diff --git a/tests/expected/fdisk/gpt-resize.err b/tests/expected/fdisk/gpt-resize.err
new file mode 100644
index 0000000..8c89224
--- /dev/null
+++ b/tests/expected/fdisk/gpt-resize.err
@@ -0,0 +1,4 @@
+----- fixing after resize: -----
+GPT PMBR size mismatch (20479 != 40959) will be corrected by write.
+The backup GPT table is not on the end of the device. This problem will be corrected by write.
+Re-reading the partition table failed.: Invalid argument
diff --git a/tests/expected/fdisk/id b/tests/expected/fdisk/id
new file mode 100644
index 0000000..4801f81
--- /dev/null
+++ b/tests/expected/fdisk/id
@@ -0,0 +1,5 @@
+Initialize empty image
+Create MBR with ID=0x1
+Disk identifier: 0x00000001
+Create MBR with ID=0x2
+Disk identifier: 0x00000002
diff --git a/tests/expected/fdisk/id.sparc b/tests/expected/fdisk/id.sparc
new file mode 100644
index 0000000..aa3f407
--- /dev/null
+++ b/tests/expected/fdisk/id.sparc
@@ -0,0 +1,3 @@
+Initialize empty image
+Create MBR with ID=0x1
+Create MBR with ID=0x2
diff --git a/tests/expected/fdisk/mbr-dos-mode b/tests/expected/fdisk/mbr-dos-mode
new file mode 100644
index 0000000..5bc1fbf
--- /dev/null
+++ b/tests/expected/fdisk/mbr-dos-mode
@@ -0,0 +1,189 @@
+Initialize empty image
+f1c9645dbc14efddc7d8a322685f26eb mbr-dos-mode.img
+Create new DOS partition table
+57e721e38d1266c2df055067c18f2cf9 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create primary partition
+ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+-------------------
+
+Set partition type
+4a5dba818f9962a82a086d8b99b89a17 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M bf Solaris
+-------------------
+
+Set primary partition active
+c30e9c761b71cf95c67e758b93706ac5 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 * 1 1 1 7.8M bf Solaris
+-------------------
+
+Re-create primary partition
+ae4f9b12f4a768849f72ea36938c30c7 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+-------------------
+
+Create extended partition
+76987a00b353687cd1dba3ddea9d66f9 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+<removed>2 2 12 12 86.3M 5 Extended
+-------------------
+
+Create logical partitions
+a1cd6708e4a6d2e5f6bc9d5c0da0cf3b mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 54.91 MiB, 57577472 bytes, 112456 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+<removed>2 2 12 12 86.3M 5 Extended
+<removed>5 2 3 2 15.7M 83 Linux
+<removed>6 4 5 2 15.7M 83 Linux
+<removed>7 6 7 2 15.7M 83 Linux
+<removed>8 8 9 2 15.7M 83 Linux
+-------------------
+
+Delete logical partitions
+4c6937d529ace5661fb82efb9394154a mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 54.91 MiB, 57577472 bytes, 112456 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+<removed>2 2 12 12 86.3M 5 Extended
+<removed>5 6 7 2 15.7M 83 Linux
+-------------------
+
+Create another logical partition
+9589eaaed698d2402945ab3e513c1eb4 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 54.91 MiB, 57577472 bytes, 112456 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>1 1 1 1 7.8M 83 Linux
+<removed>2 2 12 12 86.3M 5 Extended
+<removed>5 6 7 2 15.7M 83 Linux
+<removed>6 2 3 2 15.7M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
+Delete primary partition
+1e6d646e5df66a2664cfbbb13fa9a08a mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 54.91 MiB, 57577472 bytes, 112456 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Cylinders Size Id Type
+<removed>2 2 12 12 86.3M 5 Extended
+<removed>5 6 7 2 15.7M 83 Linux
+<removed>6 2 3 2 15.7M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
+Delete extended partition
+fc3cdb12326656d7996b09b6f76973e7 mbr-dos-mode.img
+
+---layout----------
+Disk <removed>: 54.91 MiB, 57577472 bytes, 112456 sectors
+Geometry: 255 heads, 63 sectors/track, 1024 cylinders
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-1nd-primary-delete b/tests/expected/fdisk/mbr-nondos-mode-1nd-primary-delete
new file mode 100644
index 0000000..cc5e1f0
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-1nd-primary-delete
@@ -0,0 +1,19 @@
+Delete primary partition
+7b29a3cda33e990e8a7877b81988b933 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>3 12288 40959 28672 14M 5 Extended
+<removed>5 26624 30719 4096 2M 83 Linux
+<removed>6 14336 18431 4096 2M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-1st-active b/tests/expected/fdisk/mbr-nondos-mode-1st-active
new file mode 100644
index 0000000..76b761a
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-1st-active
@@ -0,0 +1,15 @@
+Set primary partition active
+47f024f3b406598a0159400af7382e2c mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 * 2048 8191 6144 3M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-1st-primary b/tests/expected/fdisk/mbr-nondos-mode-1st-primary
new file mode 100644
index 0000000..df4bf2e
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-1st-primary
@@ -0,0 +1,15 @@
+Create 1st primary partition
+e21e16b7452d82e2a2810a1de8c3db05 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-1st-primary-delete b/tests/expected/fdisk/mbr-nondos-mode-1st-primary-delete
new file mode 100644
index 0000000..7fce4e4
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-1st-primary-delete
@@ -0,0 +1,20 @@
+Delete primary partition
+6f1b62718cf8d83602d51de8944cee51 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>2 8192 12287 4096 2M 83 Linux
+<removed>3 12288 40959 28672 14M 5 Extended
+<removed>5 26624 30719 4096 2M 83 Linux
+<removed>6 14336 18431 4096 2M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-1st-primary-recreate b/tests/expected/fdisk/mbr-nondos-mode-1st-primary-recreate
new file mode 100644
index 0000000..80e0079
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-1st-primary-recreate
@@ -0,0 +1,15 @@
+Re-create 1st primary partition
+a5543ee1e3d2cf79913a56bae893a0f0 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-2nd-primary b/tests/expected/fdisk/mbr-nondos-mode-2nd-primary
new file mode 100644
index 0000000..0b24808
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-2nd-primary
@@ -0,0 +1,16 @@
+Create 2nd primary partition
+9d31ee977e26e72ebce78e8e543cd4ce mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 12287 4096 2M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-empty-pt b/tests/expected/fdisk/mbr-nondos-mode-empty-pt
new file mode 100644
index 0000000..bc18a70
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-empty-pt
@@ -0,0 +1,14 @@
+Initialize empty image
+8f4e33f3dc3e414ff94e5fb6905cba8c mbr-nondos-mode.img
+Create new DOS partition table
+4e23561dcb81678bb1bd678722c7cbb7 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-extended b/tests/expected/fdisk/mbr-nondos-mode-extended
new file mode 100644
index 0000000..3b8c736
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-extended
@@ -0,0 +1,17 @@
+Create extended partition
+9528631b198e44564f67f8ca97fa51b8 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 12287 4096 2M 83 Linux
+<removed>3 12288 40959 28672 14M 5 Extended
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-extended-delete b/tests/expected/fdisk/mbr-nondos-mode-extended-delete
new file mode 100644
index 0000000..b467274
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-extended-delete
@@ -0,0 +1,12 @@
+Delete extended partition
+e1ef48d3d42f4ebcfd5bf4baf5e370e9 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-first-sector-at-end b/tests/expected/fdisk/mbr-nondos-mode-first-sector-at-end
new file mode 100644
index 0000000..d5c5f45
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-first-sector-at-end
@@ -0,0 +1,47 @@
+Create new DOS partition table (again)
+Create 1st primary at the end of device
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 20000 40959 20960 10.2M 83 Linux
+-------------------
+
+Create 2nd primary at the begin of device
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Partition type
+ p primary (1 primary, 0 extended, 3 free)
+ e extended (container for logical partitions)
+Select (default p): Partition number (2-4, default 2): First sector (2048-19999, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-19999, default 19999):
+Created a new partition <removed>.
+
+Command (m for help): The partition table has been altered.
+Syncing disks.
+
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 20000 40959 20960 10.2M 83 Linux
+<removed>2 2048 19999 17952 8.8M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-logical b/tests/expected/fdisk/mbr-nondos-mode-logical
new file mode 100644
index 0000000..ee98105
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-logical
@@ -0,0 +1,21 @@
+Create logical partitions
+db4406e7bc0773f234fd1db1b58b5997 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 12287 4096 2M 83 Linux
+<removed>3 12288 40959 28672 14M 5 Extended
+<removed>5 14336 18431 4096 2M 83 Linux
+<removed>6 20480 24575 4096 2M 83 Linux
+<removed>7 26624 30719 4096 2M 83 Linux
+<removed>8 32768 36863 4096 2M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-logical-delete b/tests/expected/fdisk/mbr-nondos-mode-logical-delete
new file mode 100644
index 0000000..ca9cd49
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-logical-delete
@@ -0,0 +1,18 @@
+Delete logical partitions
+de85b8d74f52f307b9467ea4c33438cb mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 12287 4096 2M 83 Linux
+<removed>3 12288 40959 28672 14M 5 Extended
+<removed>5 26624 30719 4096 2M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-nondos-mode-logical-recreate b/tests/expected/fdisk/mbr-nondos-mode-logical-recreate
new file mode 100644
index 0000000..3b16015
--- /dev/null
+++ b/tests/expected/fdisk/mbr-nondos-mode-logical-recreate
@@ -0,0 +1,21 @@
+Create another logical partition
+28d0cbe795535ee025dc7a4781516965 mbr-nondos-mode.img
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 8191 6144 3M 83 Linux
+<removed>2 8192 12287 4096 2M 83 Linux
+<removed>3 12288 40959 28672 14M 5 Extended
+<removed>5 26624 30719 4096 2M 83 Linux
+<removed>6 14336 18431 4096 2M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
diff --git a/tests/expected/fdisk/mbr-sort b/tests/expected/fdisk/mbr-sort
new file mode 100644
index 0000000..e97e3b4
--- /dev/null
+++ b/tests/expected/fdisk/mbr-sort
@@ -0,0 +1,75 @@
+Initialize empty image
+Create new DOS partition table
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+-------------------
+
+Create primary partitions
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 4096 6143 2048 1M 83 Linux
+<removed>2 2048 4095 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 40959 32768 16M 5 Extended
+
+Partition table entries are not in disk order.
+-------------------
+
+Create logical partitions
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 4096 6143 2048 1M 83 Linux
+<removed>2 2048 4095 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 40959 32768 16M 5 Extended
+<removed>5 14336 16383 2048 1M 83 Linux
+<removed>6 22528 24575 2048 1M 83 Linux
+<removed>7 18432 20479 2048 1M 83 Linux
+<removed>8 10240 12287 2048 1M 83 Linux
+
+Partition table entries are not in disk order.
+-------------------
+
+Fix order.
+
+---layout----------
+Disk <removed>: 20 MiB, 20971520 bytes, 40960 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: dos
+Disk identifier: <removed>
+
+Device Boot Start End Sectors Size Id Type
+<removed>1 2048 4095 2048 1M 83 Linux
+<removed>2 4096 6143 2048 1M 83 Linux
+<removed>3 6144 8191 2048 1M 83 Linux
+<removed>4 8192 40959 32768 16M 5 Extended
+<removed>5 10240 12287 2048 1M 83 Linux
+<removed>6 14336 16383 2048 1M 83 Linux
+<removed>7 18432 20479 2048 1M 83 Linux
+<removed>8 22528 24575 2048 1M 83 Linux
+-------------------
+
diff --git a/tests/expected/fdisk/oddinput b/tests/expected/fdisk/oddinput
new file mode 100644
index 0000000..3391422
--- /dev/null
+++ b/tests/expected/fdisk/oddinput
@@ -0,0 +1,7 @@
+---Initialize empty image
+f1c9645dbc14efddc7d8a322685f26eb oddinput.img
+---Empty image listing
+Disk testimage: 10 MiB, 10485760 bytes, 20480 sectors
+Units: cylinders of 16065 * 512 = 8225280 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
diff --git a/tests/expected/fdisk/oddinput.err b/tests/expected/fdisk/oddinput.err
new file mode 100644
index 0000000..041fc79
--- /dev/null
+++ b/tests/expected/fdisk/oddinput.err
@@ -0,0 +1,4 @@
+---Nonexistent file
+fdisk: cannot open _a_file_that_does_not_exist_: ENOENT
+---Too small file
+fdisk: cannot open oddinput.toosmall: ENOTTY
diff --git a/tests/expected/fdisk/oddinput.toosmall b/tests/expected/fdisk/oddinput.toosmall
new file mode 100644
index 0000000..06c75ed
--- /dev/null
+++ b/tests/expected/fdisk/oddinput.toosmall
@@ -0,0 +1 @@
+This file is too small
diff --git a/tests/expected/fdisk/sunlabel b/tests/expected/fdisk/sunlabel
new file mode 100644
index 0000000..5a24dd2
--- /dev/null
+++ b/tests/expected/fdisk/sunlabel
@@ -0,0 +1,80 @@
+Initialize empty image
+f1c9645dbc14efddc7d8a322685f26eb sunlabel.img
+Create new SUN partition table
+f050fd2beb99f8d968bf17450f655f06 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+Create first partition
+e730c7ec8208601f41963f0485147248 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+
+Device Start End Cylinders Size Id Type Flags
+<removed>1 1 128 129 3.9M 83 Linux native
+Set partition sysid
+df75defdb97fbd56222aed18631a22d0 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+
+Device Start End Cylinders Size Id Type Flags
+<removed>1 1 128 129 3.9M 4 SunOS usr
+Set first partition readonly
+da23f66698d9a553162887621d4c7490 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+
+Device Start End Cylinders Size Id Type Flags
+<removed>1 1 128 129 3.9M 4 SunOS usr r
+Set first partition mountable
+3ab76e8491b103eab52b2ae1856c1e30 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+
+Device Start End Cylinders Size Id Type Flags
+<removed>1 1 128 129 3.9M 4 SunOS usr ur
+Create second partition
+
+Welcome to fdisk <removed>.
+Changes will remain in memory only, until you decide to write them.
+Be careful before using the write command.
+
+
+Command (m for help): Partition number (2-8, default 2): First cylinder (128-325, default 128): Last cylinder or +/-cylinders or +/-size{K,M,G,T,P} (128-325, default 325):
+Created a new partition <removed>.
+
+Command (m for help): The partition table has been altered.
+Syncing disks.
+
+a87e80830aa13d2d68b766962f052750 sunlabel.img
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Geometry: 1 heads, 63 sectors/track, 325 cylinders
+Units: cylinders of 63 * 512 = 32256 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / <removed> bytes
+Disklabel type: sun
+
+Device Start End Cylinders Size Id Type Flags
+<removed>1 1 128 129 3.9M 4 SunOS usr ur
+<removed>2 129 325 198 6.1M 83 Linux native
+Delete all partitions
+502ba7a0cfdce2849c3a99881f0590c3 sunlabel.img