zfs create ship/pg zfs set recordsize=16k ship/pg #zfs set sync=standard ship/pg #zfs set compression=lz4 ship/pg #zfs set atime=off ship/pg zfs create ship/pg/data zfs create ship/pg/wal zfs set logbias=throughput ship/pg/data zfs set primarycache=metadata ship/pg/data zfs get -r recordsize,logbias,primarycache ship/pg
export JAIL=pg export JAILHOSTNAME=pg export JAILDOMAIN=ahlawat.com export JAILIP=19 export JAILUSER=X export JAILUSERID=1000 export JAILUSERVNC=false /root/FreeBSD/jails/create.sh $JAIL $JAILHOSTNAME $JAILDOMAIN $JAILIP $JAILUSER $JAILUSERID $JAILUSERVNC iocage fstab -r $JAIL /mnt/ship/certs /mnt/certs nullfs ro 0 0 iocage exec $JAIL "mkdir -p /var/db/postgres/data14" iocage exec $JAIL "mkdir -p /var/db/postgres/data14_wal" iocage fstab -a $JAIL /mnt/ship/pg/data /var/db/postgres/data14 nullfs rw 0 0 iocage fstab -a $JAIL /mnt/ship/pg/wal /var/db/postgres/data14_wal nullfs rw 0 0 iocage fstab -l $JAIL iocage exec $JAIL "pkg install -y postgresql-server" iocage exec $JAIL "sysrc postgresql_enable=YES" iocage exec $JAIL "chown -R postgres:postgres /var/db/postgres*" #first time only #iocage exec $JAIL "/usr/local/etc/rc.d/postgresql initdb" #iocage exec $JAIL "cp -a /var/db/postgres/data14/pg_wal/* /var/db/postgres/data14_wal" #iocage exec $JAIL "rm -rf /var/db/postgres/data14/pg_wal" #iocage exec $JAIL "ln -s /var/db/postgres/data14_wal /var/db/postgres/data14/pg_wal" iocage exec $JAIL "cp /mnt/config/postgresql.conf /var/db/postgres/data14/" iocage exec $JAIL "cp /mnt/config/pg_hba.conf /var/db/postgres/data14/" iocage exec $JAIL "chown -R postgres:postgres /var/db/postgres*" iocage exec $JAIL "service postgresql start"
su postgres psql -c "alter user postgres with password 'aStrongPassword'" Major Version Upgrade: pg_dump > backupfile.sql upgrade postgres psql -f backupfile.sql