Install TrueNAS Scale with Custom OS Partition Size
- Details
- Written by: JC
- Category: Software
One of the features that TrueNAS lacks is the ability to partition your OS disk so that you don't waste a whole drive for only needing about 16 GB for the OS. It’s also a restriction where you cannot use the OS drive for any file shares. Most of the time you probably aren’t worred about that, but for some use cases partitioning is desirable. The community has found a way of modifying the installation script to specify the OS partition size. This works, but is unsupported if you are paying for support. Most of the community is running without support and we tend to be aware of backing things up in-case something weird happens. Follow these instructions to install to a custom defined OS partition size:
1. Boot up the USB installer
2. On the installer menu select the "shell" option
3. Follow these command line commands:
# to get working arrow keys and command recall type bash to start a bash console:
bash
# find the installer script, this should yield 3 hits
find / -name truenas-install
# /usr/sbin/truenas-install is the one we're after
# feel the pain as vi seems to be the only available editor
vi /usr/sbin/truenas-install
4. Type "/Create boot pool" and press enter
5. Find the "-n3:0:0" line and arrow over to the last zero,
6. Type ":i" for insert mode and change the zero to "+64GiB" (without quotes) or whatever size you want.
# Create boot pool
if ! sgdisk -n3:0:+64GiB -t3:BF01 /dev/${_disk}; then
return 1
fi
7. Press the ESC key and type in ":wq" to save and quit vi.
8. Type "/usr/sbin/truenas-install" without quotes to start the installer. Follow the installer to your requirements and reboot at the end.
9. Login into the shell and run "fdisk" on the disk you would like to add the new ZFS parition to. You will want to create a new parition with disk type "157".
10. Run these commands to have the system see the new parition and add to ZFS pool:
# tell the kernel to load the new partition
partprobe
# find the uuid of the partition you created
ls -al /dev/disk/by-partuuid/
# create the zpool using the partition you created
zpool create -f [name of zpool] stripe /dev/disk/by-partuuid/[uuid from command above]
# let the system know about the zpool; this is persistent
zpool export [name of zpool]
You shold now be able to use the new zpool to use shares for.