Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/zfs/install/01-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function create_system_dataset ()

# Generate zfs hostid
print "Generate hostid"
zgenhostid
zgenhostid -f

# Set bootfs
print "Set ZFS bootfs"
Expand All @@ -209,7 +209,10 @@ function import_pool ()
{
print ":: Import zpool"
zpool import -d /dev/disk/by-id -R /mnt zroot -N -f
zfs load-key zroot
if [[ -f /etc/zfs/zroot.key ]];
then
zfs load-key zroot
fi
}

function mount_system ()
Expand Down
8 changes: 6 additions & 2 deletions scripts/zfs/install/02-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ EOF
print ":: Copy ZFS files"
cp /etc/hostid /mnt/etc/hostid
cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache
cp /etc/zfs/${zpoolname}.key /mnt/etc/zfs
if [[ -f /etc/zfs/zroot.key ]];
then
cp /etc/zfs/${zpoolname}.key /mnt/etc/zfs
fi


### Configure username
if [[ -d /mnt/home/${user} ]];
Expand Down Expand Up @@ -237,7 +241,7 @@ EOSF
cpanm --notest --installdeps .

# Create swap
zfs create -V 8GB -b \$(getconf PAGESIZE) -o compression=zle -o logbias=throughput -o sync=always -primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false zroot/swap
zfs create -V 8GB -b \$(getconf PAGESIZE) -o compression=zle -o logbias=throughput -o sync=always -o primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false zroot/swap
mkswap -f /dev/zvol/zroot/swap
swapon /dev/zvol/zroot/swap
echo '/dev/zvol/zroot/swap none swap discard 0 0' > /etc/fstab
Expand Down