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.
Mainly inspired from @sthames42 at https://gist.github.com/gangefors/2029e26501601a99c501599f5b100aa6
- Download TrueNAS Scale and burn to USB.
- Boot from USB and select
Start TrueNAS SCALE Installation
from the Grub loader menu. - Select
Shell
from the Console Setup menu. - 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
exit
to return from shell.- Select
Install/Upgrade
from the Console Setup menu (without rebooting, first) and install to NVMe drive. - Remove the USB and reboot.
- Login to shell (if you are connected to the NAS with a display, press
8
to open linux shell). - Use
parted
to edit partitions. unit KiB
to change size display units.print list
to find your boot device, for me it was /dev/nvme0n1.select <path to your boot device>
. in this caseselect /dev/nvme0n1
.- 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
- (Optional) name 3 boot-pool to name the boot partition.
- Find the end of the last partition in your boot device (filesystem should be zfs) - for me it was 17304576kiB
- Create the new partition using
mkpart <new partition name> <last partition end in kiB> 100%
, for me it wasmkpart nvme-pool 17304576kiB 100%
. 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.
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
zpool export <pool name>
to allow Truenas Web UI to see this pool.exit
to exit shell.- In the Web UI, go to Storage/Import Pool, and select the new pool in the dropdown list.