ZFS How to install a ZFS based system using an existing system

Make sure to get the device name right.
Code:
#!/bin/sh
#
# shell script extracted from /var/log/bsdinstall_log
# Creating root pool

# Replace "ada0pX" with actual device name


[/QUOTE]
Can I run this while booted from a different partition on the same disk?
 
It's best to use gpt labels. As bios can rename disks.
Note when not many commands, drop to commandline from install media.
I looked at script of T-Daemon looks good. Just edit specific parts for your specific system , copy to install media & run it from install media.
Just one thing,
Code:
zpool set bootfs=pool dataset
 
here two slides from a ten years old slide deck. ( Solaris 11 O/S )
 

Attachments

  • ksnip_20260402-142745.png
    ksnip_20260402-142745.png
    205.2 KB · Views: 7
  • ksnip_20260402-142845.png
    ksnip_20260402-142845.png
    167.7 KB · Views: 7
Not directly related but to hardening , AI tells this, can be interesting for install script
Summary Table of ZFS Properties
Dataset Path
exec (noexec)setuid (nosuid)devices (nodev)
/tmpoffoffoff
/var/tmpoffoffoff
/homeon (usually)offoff
/var/logoffoffoff
/var/mailoffoffoff
/booton/offoffoff


My little tuning now,
Code:
zpool history | grep set | grep -v TREETERRA | grep -v mountpoint | grep -v canmount | grep -v listsnap | grep -v ZUSB3
2026-03-29.19:49:55 zpool set bootfs=SSD SSD
2026-03-29.23:03:07 zfs set special_small_blocks=128K SSD
2026-03-30.00:26:11 zpool set autotrim=on SSD
2026-03-31.01:49:26 zfs set special_small_blocks=16K SSD
2026-04-02.14:54:29 zfs set atime=on SSD/var
2026-04-02.14:54:41 zfs set atime=off SSD/var/cache
2026-04-02.14:54:48 zfs set atime=off SSD/var/cache/pkg
2026-04-02.14:54:52 zfs set atime=off SSD/var/db
2026-04-02.14:54:56 zfs set atime=off SSD/var/db/grafana
2026-04-02.14:55:15 zfs set atime=off SSD/var/db/mariadb
2026-04-02.14:55:19 zfs set atime=off SSD/var/db/pkg
2026-04-02.14:55:23 zfs set atime=off SSD/var/db/postgres
2026-04-02.14:55:28 zfs set atime=off SSD/var/db/prometheus
2026-04-02.14:55:57 zfs set atime=off SSD/var/db/influxdb
2026-04-02.15:00:01 zfs set setuid=off SSD/SSD_now/home
2026-04-02.15:00:14 zfs set devices=off SSD/SSD_now/home
2026-04-02.15:00:43 zfs set exec=off SSD/var/log
2026-04-02.15:00:49 zfs set setuid=off SSD/var/log
2026-04-02.15:00:57 zfs set devices=off SSD/var/log
2026-04-02.15:08:00 zfs set atime=off SSD
2026-04-02.15:08:10 zfs set atime=off SSD/usr
 
Back
Top