Installation script does not remove ZFS headers from partition before creating new partition table

Description

BRIEF:

When a ZFS partition is present on a disk, if that disk is used for the OS and a swap partition is created using the installtion script, the ZFS headers have a potential of not being removed from the swap partition, causing ZFS to recognize the swap partition as a valid ZFS partition.

The ZFS partitions should probably be wiped of their metadata before wiping the GPT.

STEPS AND RESULTS:

Following the steps below will cause the OS to fail to boot due to multiple ZFS pools with the label of `boot-pool`.

Install TrueNAS SCALE without a swap partition using `/dev/sda`.
Reinstall TrueNAS SCALE with a swap partition using `/dev/sda`.
Run from the shell `wipefs /dev/sda4`.

ACTUAL RESULT:

  1. wipefs /dev/sda4
    DEVICE OFFSET TYPE UUID LABEL
    sda4 0x3f000 zfs_member 4243920005595449458 boot-pool
    sda4 0x3e000 zfs_member 4243920005595449458 boot-pool
    sda4 0x3d000 zfs_member 4243920005595449458 boot-pool
    sda4 0x3c000 zfs_member 4243920005595449458 boot-pool
    sda4 0x3b000 zfs_member 4243920005595449458 boot-pool
    sda4 0x3a000 zfs_member 4243920005595449458 boot-pool
    sda4 0x39000 zfs_member 4243920005595449458 boot-pool
    sda4 0x38000 zfs_member 4243920005595449458 boot-pool
    sda4 0x37000 zfs_member 4243920005595449458 boot-pool
    sda4 0x36000 zfs_member 4243920005595449458 boot-pool
    sda4 0x35000 zfs_member 4243920005595449458 boot-pool
    sda4 0x34000 zfs_member 4243920005595449458 boot-pool
    sda4 0x33000 zfs_member 4243920005595449458 boot-pool
    sda4 0x32000 zfs_member 4243920005595449458 boot-pool
    sda4 0x31000 zfs_member 4243920005595449458 boot-pool
    sda4 0x30000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2f000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2e000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2d000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2c000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2b000 zfs_member 4243920005595449458 boot-pool
    sda4 0x2a000 zfs_member 4243920005595449458 boot-pool
    sda4 0x29000 zfs_member 4243920005595449458 boot-pool
    sda4 0x28000 zfs_member 4243920005595449458 boot-pool
    sda4 0x27000 zfs_member 4243920005595449458 boot-pool
    sda4 0x26000 zfs_member 4243920005595449458 boot-pool
    sda4 0x25000 zfs_member 4243920005595449458 boot-pool
    sda4 0x24000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7f000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7e000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7d000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7c000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7b000 zfs_member 4243920005595449458 boot-pool
    sda4 0x7a000 zfs_member 4243920005595449458 boot-pool
    sda4 0x79000 zfs_member 4243920005595449458 boot-pool
    sda4 0x78000 zfs_member 4243920005595449458 boot-pool
    sda4 0x77000 zfs_member 4243920005595449458 boot-pool
    sda4 0x76000 zfs_member 4243920005595449458 boot-pool
    sda4 0x75000 zfs_member 4243920005595449458 boot-pool
    sda4 0x74000 zfs_member 4243920005595449458 boot-pool
    sda4 0x73000 zfs_member 4243920005595449458 boot-pool
    sda4 0x72000 zfs_member 4243920005595449458 boot-pool
    sda4 0x71000 zfs_member 4243920005595449458 boot-pool
    sda4 0x70000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6f000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6e000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6d000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6c000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6b000 zfs_member 4243920005595449458 boot-pool
    sda4 0x6a000 zfs_member 4243920005595449458 boot-pool
    sda4 0x69000 zfs_member 4243920005595449458 boot-pool
    sda4 0x68000 zfs_member 4243920005595449458 boot-pool
    sda4 0x67000 zfs_member 4243920005595449458 boot-pool
    sda4 0x66000 zfs_member 4243920005595449458 boot-pool
    sda4 0x65000 zfs_member 4243920005595449458 boot-pool
    sda4 0x64000 zfs_member 4243920005595449458 boot-pool
    sda4 0x62000 zfs_member 4243920005595449458 boot-pool
    sda4 0x61000 zfs_member 4243920005595449458 boot-pool
    sda4 0x60000 zfs_member 4243920005595449458 boot-pool

EXPECTED RESULT:

  1. wipefs /dev/sda4

SCREENSHOT / FAULT DETAILS:

Block information after step 1.

  1. lsblk -f /dev/sda
    NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
    sda
    ├─sda1
    ├─sda2 vfat FAT32 EFI 5A28-2777
    └─sda3 zfs_member 5000 boot-pool 4243920005595449458

Block information after step 2.

  1. lsblk -f /dev/sda
    NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
    sda
    ├─sda1
    ├─sda2 vfat FAT32 EFI 38B2-E644
    ├─sda3 zfs_member 5000 boot-pool 14294796804182188893
    └─sda4 zfs_member 5000 boot-pool 4243920005595449458

ADDITIONAL INFO:

You can correct the OS with the following.

  1. wipefs -a -t zfs_member /dev/sda4
    /dev/sda4: 8 bytes were erased at offset 0x0003f000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0003e000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0003d000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0003c000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0003b000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0003a000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00039000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00038000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00037000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00036000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00035000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00034000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00033000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00032000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00031000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00030000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002f000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002e000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002d000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002c000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002b000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0002a000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00029000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00028000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00027000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00026000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00025000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00024000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007f000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007e000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007d000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007c000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007b000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0007a000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00079000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00078000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00077000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00076000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00075000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00074000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00073000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00072000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00071000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00070000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006f000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006e000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006d000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006c000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006b000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x0006a000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00069000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00068000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00067000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00066000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00065000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00064000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00062000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00061000 (zfs_member): 0c b1 ba 00 00 00 00 00
    /dev/sda4: 8 bytes were erased at offset 0x00060000 (zfs_member): 0c b1 ba 00 00 00 00 00

  2. lsblk -f /dev/sda
    NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
    sda
    ├─sda1
    ├─sda2 vfat FAT32 EFI 38B2-E644
    ├─sda3 zfs_member 5000 boot-pool 14294796804182188893
    └─sda4

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Vladimir Vinogradenko January 6, 2021 at 8:35 PM

Complete
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Impact

Low

Components

Priority

More fields

Katalon Platform

Created December 26, 2020 at 3:43 PM
Updated July 1, 2022 at 4:59 PM
Resolved January 6, 2021 at 8:35 PM