[Bug 1767299] Re: Ubuntu 18.04 Installer creates swap partition too small

phanky5 1767299 at bugs.launchpad.net
Thu Sep 19 03:35:27 UTC 2019


For reasons stated further above I like to propose changing the status
of this bug to critical.

I eventually managed to setup a swap file and enable hibernation. The
following steps are copy pasted together from various different
websites. Here are the changes I have made:

First find out how large your swap file should be. There are several
recommendation tables you can find on Google. Adjust the needed size of
the swap file below to your needs.

Setup swap file:

sudo swapoff -a                                    # Turn off all swap space.
sudo rm /swapfile                                  # Delete current swap file.
sudo dd if=/dev/zero of=/swapfile bs=1M count=16384 # Make a new 16GB swap file. (Adjust to your needs)
sudo chown root:root /swapfile                     # Set owner to root, group root
sudo chmod 0600 /swapfile                          # Set permission to root
sudo mkswap /swapfile                              # Convert file to swap format
sudo swapon /swapfile                              # Enable

Enable to swap file on boot. Add the following line to /etc/fstab using your favorite editor: 
/swapfile       none    swap    sw      0       0

Enable hibernation:
sudo apt install uswsusp
sudo apt install hibernate

Test if hibernation works with this command:
sudo hibernate

If everything looks good continue by changing the hibernation engine to use the hibernate command. Edit hibernation service:
sudo systemctl edit systemd-hibernate.service

Paste the following code:
[Service]
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
ExecStartPost=-/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep

Next update systemd:
sudo systemctl daemon-reload

Now you should be able to hibernate with the default system command:
sudo systemctl hibernate

Enable hibernation in the UI by following this guide:
http://ubuntuhandbook.org/index.php/2018/05/add-hibernate-option-ubuntu-18-04/

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to partman-auto in Ubuntu.
https://bugs.launchpad.net/bugs/1767299

Title:
  Ubuntu 18.04 Installer creates swap partition too small

Status in partman-auto package in Ubuntu:
  Confirmed

Bug description:
  Installed Ubuntu 18.04 final release.

  The disk is 512 Gigabyte, the RAM is 8 Gigabyte. The installer just
  gave me 979 Megabyte of space. I chose LVM to have an encrypted drive.

  Here are some details:

  free -h
                total        used        free      shared  buff/cache   available
  Mem:           7,7G        4,0G        152M        399M        3,6G        3,0G
  Swap:          979M          0B        979M


  swapon --show
  NAME      TYPE      SIZE USED PRIO
  /dev/dm-2 partition 980M   0B   -2

  
  cat /etc/fstab
  # /etc/fstab: static file system information.
  #
  # Use 'blkid' to print the universally unique identifier for a
  # device; this may be used with UUID= as a more robust way to name devices
  # that works even if disks are added and removed. See fstab(5).
  #
  # <file system> <mount point>   <type>  <options>       <dump>  <pass>
  /dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
  # /boot was on /dev/sda2 during installation
  UUID=removed-id /boot           ext4    defaults        0       2
  # /boot/efi was on /dev/sda1 during installation
  UUID=removed-id  /boot/efi       vfat    umask=0077      0       1
  /dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/partman-auto/+bug/1767299/+subscriptions



More information about the foundations-bugs mailing list