Skip to content

Instantly share code, notes, and snippets.

@royz
Created April 27, 2025 23:24
Show Gist options
  • Save royz/b4668f8162bdea7f1289c4399ae415cf to your computer and use it in GitHub Desktop.
Save royz/b4668f8162bdea7f1289c4399ae415cf to your computer and use it in GitHub Desktop.
TrueNAS Scale - install in 16GB partition

This guide is useful for when installing truenas scale on large ssd. The idea is to create a small partition (16GB) to install the OS. And use the remaining space to create another partition for creating an nvme pool.

Tested on TrueNAS Scale v25.04.0

Mainly inspired from @sthames42 at https://gist.github.com/gangefors/2029e26501601a99c501599f5b100aa6

Steps for creating boot partition and installation

  1. Download TrueNAS Scale and burn to USB.
  2. Boot from USB and select Start TrueNAS SCALE Installation from the Grub loader menu.
  3. Select Shell from the Console Setup menu.
  4. Modify the installer to create 16GB boot partition instead of using the entire drive. sed -i 's/-n3:0:0/-n3:0:+16384M/g' /usr/lib/python3/dist-packages/truenas_installer/install.py
  5. exit to return from shell.
  6. Select Install/Upgrade from the Console Setup menu (without rebooting, first) and install to NVMe drive.
  7. Remove the USB and reboot.

Steps for creating a pool from remaining space

  1. Login to shell (if you are connected to the NAS with a display, press 8 to open linux shell).
  2. Use parted to edit partitions.
  3. unit KiB to change size display units.
  4. print list to find your boot device, for me it was /dev/nvme0n1.
  5. select <path to your boot device>. in this case select /dev/nvme0n1.
  6. print to get exact info on your boot device current partition status. It will look something like this:
 Model: HP SSD EX900 Plus 1TB (nvme)
 Disk /dev/nvme0n1: 1024GB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags: 
 
 Number  Start        End            Size          File system  Name       Flags
  1      2048kiB      3072kiB        1024kiB                               bios_grub, legacy_boot
  2      3072kiB      527360kiB      524288kiB     fat32                   boot, esp
  3      527360kiB    17304576kiB    16777216kiB   zfs
  1. (Optional) name 3 boot-pool to name the boot partition.
  2. Find the end of the last partition in your boot device (filesystem should be zfs) - for me it was 17304576kiB
  3. Create the new partition using mkpart <new partition name> <last partition end in kiB> 100%, for me it was mkpart nvme-pool 17304576kiB 100%.
  4. print to verify
 Model: HP SSD EX900 Plus 1TB (nvme)
 Disk /dev/nvme0n1: 1000204632kiB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags: 
 
 Number  Start        End            Size          File system  Name       Flags
  1      2048kiB      3072kiB        1024kiB                               bios_grub, legacy_boot
  2      3072kiB      527360kiB      524288kiB     fat32                   boot, esp
  3      527360kiB    17304576kiB    16777216kiB   zfs          boot-pool
  4      17304576kiB  1000204288kiB  982899712kiB  zfs          nvme-pool

Note the new partition number. It will be required for creating the zpool. (for me it was 4). 11. quit to exit parted. 12. To create a zpool, visible for Truenas, use zpool create <pool name> <path to your boot device>p<your new partition number>. For me it was zpool create nvme-pool /dev/nvme0n1p4. Received an error: cannot mount '/ssd-pool': failed to create mountpoint: Read-only file system This can be ignored.

Note: This drive and partition naming is only true for NVME drives.

  1. zpool status to verify.
   pool: boot-pool
  state: ONLINE
 config:
 
         NAME         STATE     READ WRITE CKSUM
         boot-pool    ONLINE       0     0     0
           nvme0n1p3  ONLINE       0     0     0
 
 errors: No known data errors
 
   pool: nvme-pool
  state: ONLINE
 config:
 
         NAME         STATE     READ WRITE CKSUM
         nvme-pool    ONLINE       0     0     0
           nvme0n1p4  ONLINE       0     0     0
 
 errors: No known data errors
  1. zpool export <pool name> to allow Truenas Web UI to see this pool.
  2. exit to exit shell.
  3. In the Web UI, go to Storage/Import Pool, and select the new pool in the dropdown list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment