# Enable swap accounting, to be placed in /etc/default/grub.d/ # Afterwards `update-grub` and reboot must be run/done. # Script from ulif, based on dmraid2mdadm.cfg from stock ubuntu. SWAPACCOUNTING_TOAPPEND="cgroup_enable=memory swapaccount=1" case "$GRUB_CMDLINE_LINUX_DEFAULT" in *$SWAPACCOUNTING_TOAPPEND*) ;; *) GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT $SWAPACCOUNTING_TOAPPEND" ;; esac