wiki-system/add-right-fit-swap-for-laptop-hibernation-during-ubuntu-20.04-full-ZFS-install.md

31 lines
1.1 KiB
Markdown
Raw Normal View History

2020-06-22 09:51:26 +02:00
## create swap partition to permit Hibernate
create a swap partition right sized for hibernation.
add theses 2 lines in : */usr/share/ubiquity/zsys-setup*
~~~{.shell}
MEMSIZE=$(cat /proc/meminfo | grep MemTotal | awk -F' ' '{print $2}')
SWAPVOLSIZE=$(( MEMSIZE / 1024 ))
~~~
like bellow :
~~~{.shell}
# Convert to MiB to align the size on the size of a block
SWAPVOLSIZE=$(( SWAPSIZE / 1024 / 1024 ))
MEMSIZE=$(cat /proc/meminfo | grep MemTotal | awk -F' ' '{print $2}')
SWAPVOLSIZE=$(( MEMSIZE / 1024 ))
prepare_target "${TARGET}"
format_disk "${DISK}" "${PARTBASE}" "${PARTESP}" "${PARTBPOOL}" "${PARTRPOOL}" "${SWAPVOLSIZE}"
init_zfs "${TARGET}" "${DISK}${PARTBASE}${PARTBPOOL}" "${DISK}${PARTBASE}${PARTRPOOL}"
init_system_partitions "${TARGET}" "${DISK}${PARTBASE}1" "${DISK}${PARTBASE}${PARTESP}"
~~~
Run ubiquity to start the installer and install as normal, selecting “Use entire disk” and the option to use ZFS.
source : [Linsomniac's Articles - Encrypting ZFS on Ubuntu 20.04](https://linsomniac.gitlab.io/post/2020-04-09-ubuntu-2004-encrypted-zfs/)