- Joined
- Nov 25, 2013
- Messages
- 7,776
Please copy & paste text and not a screen shot. But besides - that looks good. What's your problem? Do you have only one disk for boot? Not a mirror?
gpart list ada0
to find the rawuuid for ada0p4. Then use zpool create <yourpoolname> gptid/<the-rawuuid>
to create the pool. Without any redundancy this is quite risky, though.zpool export <yourpoolname>
and finally import the pool from the UI.zpool create ssd gptid/1bd5436e-9781-11eb-b91a-d050992848c3 cannot use '/dev/gptid/1bd5436e-9781-11eb-b91a-d050992848c3': must be a block device or regular file
zpool create ssd ada0p4/1bd5436e-9781-11eb-b91a-d050992848c3 cannot open 'ada0p4/1bd5436e-9781-11eb-b91a-d050992848c3': no such device in /dev must be a full path or shorthand device name
zpool status ssd
result in?zpool create <poolname> nvd0p4
. Or ada0p4, or whatever your matching device is. You should never do that in TrueNAS. Apart from the boot-pool always refer to disk via their gptid. The UI won't show your disks and the pool status correctly, otherwise. That's why I asked. The guide that I wrote respects that.gpart add -t freebsd-zfs -a 1m ada4 gpart add -t freebsd-zfs -a 1m ada5 gpart list ada4 gpart list ada5
3. Name: ada4p3 [...] rawuuid: 25fe934a-19d6-11ea-82a1-ac1f6b76641c [...] 3. Name: ada5p3 [...] rawuuid: 3fc8e29a-19d0-11ea-9848-ac1f6b76641c
zpool create ssd mirror gptid/25fe934a-19d6-11ea-82a1-ac1f6b76641c gptid/3fc8e29a-19d0-11ea-9848-ac1f6b76641c
zpool export ssd
I found the issue, it's a buggy error message, but the issue is difference in block size between devices, as discussed here.
zpool attach boot-pool /dev/da13p2 /dev/da0p3
cannot attach /dev/da0p3 to /dev/da13p2: can only attach to mirrors and top-level disks
#ssd drive - add jail partition - will be ada0p4
gpart add -t freebsd-zfs -l jail0 ada0
#setup jail pool
zpool create jail /dev/ada0p4
umount /jail
zpool export jail
#wait for resilver! run 'zpool status' to check status
zpool offline freenas-boot /dev/da0p2
zpool detach freenas-boot /dev/da0p2
zpool create jail /dev/ada0p4
but use zpool create jail gptid/<rawuuid of ada0p4>
instead.wipe contents (SSD is ada0)
Excellent article. Thank you for the step by step guide.
Had a similar scenario, with the addition of a second SSD. Was setting up mirrored boot with two 250 GB SSD and wanted to use unused portion for jail. Followed all steps from seltz upto step '#ssd drive - add jail partition - will be ada0p4' for both SSD. Then created a mirrored pool with two partitions for jail. This is for TrueNAS. Note that, needed to use boot-pool for turenas vs freenas-boot for freenas.
All steps are listed below. Copying seltz's (thanks seltz) steps for completeness.
Steps:
1. Install TrueNAS onto USB drive B as normal.
2. Boot TrueNAS from USB drive B.
3. From here, run the following commands (running these one-by-one)
#ssd drive - wipe contents (First SSD is ada0, Second SSD is ada1)
gpart destroy -F /dev/ada0
gpart destroy -F /dev/ada1
#ssd drive - setup gpt partitioning scheme
gpart create -s gpt ada0
gpart create -s gpt ada1
#ssd drive - setup boot partition
# and embed bootstrap code in
# partition scheme metadata
# note: i follow gpart's manpage advice on making the size 472
# so the swap partition will be aligned correctly.
gpart add -b 40 -s 472 -t freebsd-boot ada0
gpart add -b 40 -s 472 -t freebsd-boot ada1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1
#ssd drive - add swap partition at first available offset - will be ada0p2, ada1p2
gpart add -s 16g -t freebsd-swap -l swap0 ada0
gpart add -s 16g -t freebsd-swap -l swap0 ada1
#ssd drive - add boot partition - will be ada0p3, ada1p3 (I had allocated 32g, probably not needed)
gpart add -s 16g -t freebsd-zfs -l root0 ada0
gpart add -s 16g -t freebsd-zfs -l root0 ada1
#ssd drive - add jail partition - will be ada0p4, ada1p4
gpart add -t freebsd-zfs -l jail0 ada0
gpart add -t freebsd-zfs -l jail0 ada1
Steps below are bit different from post above (colored text):
#setup jail pool
zpool create jail mirror /dev/ada0p4 /dev/ada1p4
umount /jail
zpool export jail
#setup boot as mirror from our usb drive (usb drive B is da0, da0p2 is the boot-pool)
zpool attach boot-pool /dev/da0p2 /dev/ada0p3
zpool attach boot-pool /dev/da0p2 /dev/ada1p3
#wait for resilver! run 'zpool status' to check status
4. Reboot/remove usb drive B, and boot from SSD. You will need to import the 'jail' pool within the truenas GUI before setting up jails.
Thanks.
It will work with current TrueNAS CORE versions.
There's a different thread if you want to use SCALE.