Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save iu2frl/f051be9d4c3f116dea339990714b3fbf to your computer and use it in GitHub Desktop.

Select an option

Save iu2frl/f051be9d4c3f116dea339990714b3fbf to your computer and use it in GitHub Desktop.
How to install TrueNAS SCALE on a partition and use the space left for apps

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

Note

Tested with TrueNAS 25.10

The easiest way to solve this is to modify the installer script before starting the installation process.

  1. Boot TrueNAS Scale installer from USB stick/ISO
  2. Select shell in the first menu (instead of installing)
  3. While in the shell, run the following commands:
sed -i 's/-n3:0:0/-n3:0:+16384M/g' /usr/lib/python3/dist-packages/truenas_installer/install.py

The command modifies the installer script so that it creates a 16GiB boot-pool partition instead of using the full disk.

  1. The press CTRL+D to return to the installer
  2. Continue installing according to the official docs.

From now on, we will be using parted to edit disks.

  1. Check the partition layout. Fix all the GPT space warning prompts that show up.
 $ parted -l
 [...]
 Warning: Not all of the space available to /dev/nvme0n1 appears to be used, you can fix the GPT to use all of the
 space (an extra 946741296 blocks) or continue with the current setting?
 Fix/Ignore? f
 [...]
 Model:  USB  SanDisk 3.2Gen1 (scsi)
 Disk /dev/sdb: 15.4GB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags:

 Number  Start   End     Size    File system  Name  Flags
  1      20.5kB  1069kB  1049kB                     bios_grub
  2      1069kB  538MB   537MB   fat32              boot, esp
  3      538MB   15.4GB  14.8GB  zfs
 [...]
  1. Ensure we are using right disk and parameters
 (parted) unit kiB
 (parted) select /dev/nvme0n1
 (parted) print
  Model: KINGSTON SNVS500GB (nvme)
 Disk /dev/nvme0n1: 488386584kiB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags:

 Number  Start        End           Size          File system  Name       Flags
  1      20.0kiB      1044kiB       1024kiB                               bios_grub
  2      1044kiB      525332kiB     524288kiB     fat32                   boot, esp
  3      526336kiB    17303552kiB   16777216kiB                boot-pool
  1. Now you can create a partiton allocating the rest of the disk in the boot drive (/dev/nvme0n1).

Important

Make sure to set the start of the new partition after the End of the partition before as indicated by the print command above

 (parted) mkpart pool 17303552kiB 100%
 (parted) print
 Model: KINGSTON SNVS500GB (nvme)
 Disk /dev/nvme0n1: 488386584kiB
 Sector size (logical/physical): 512B/512B
 Partition Table: gpt
 Disk Flags:

 Number  Start        End           Size          File system  Name       Flags
  1      20.0kiB      1044kiB       1024kiB                               bios_grub
  2      1044kiB      525332kiB     524288kiB     fat32                   boot, esp
  3      526336kiB    17303552kiB   16777216kiB                boot-pool
  4      17303552kiB  488386560kiB  471083008kiB               pool
  1. At this point a reboot is a good idea
 $ reboot
  1. Once the system is back on, we should see the new partitions
 $ lsblk
 NAME MAJ:MIN RM SIZE RO Type MOUNTPOINTS
 sda   8:0     0   32G 0  disk
  sda1 8:1     0    1M 0  part
  sda2 8:2     0  512M 0  part
  sda3 8:3     0   16G 0  part
  sda4 8:4     0   16G 0  part
  1. Make the new pool for the apps
 $ mount -o remount,rw /
 $ zpool create apps /dev/sda4
 $ zpool export apps
  1. Navigate to the UI > Pools and from the top-right menu select Import Pool, select the apps pool and proceed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment