0

I have an 8GB swap file under /swapfile1 and I have to load it manually in the terminal every time I log in. I tried to modify fstab following the advice given in this thread Adding a new swap file. How to edit fstab to enable swap after reboot? with no success. What do I need to add to fstab to make this work?

Here is my existing fstab file:

# /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/nvme0n1p6_crypt /               ext4    errors=remount-ro 0       1
# /boot was on /dev/nvme0n1p5 during installation
UUID=0caeaa04-232f-4181-87a6-cab787ef6d0c /boot           ext4    defaults        0       2
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=666E-4F0F  /boot/efi       vfat    umask=0077      0       1
  • Please paste in your existing fstab so we can see where you're starting. [Edit] the question above to include the text of the file. And welcome to AskUbuntu! Please be sure to take the [tour] and read through the [FAQ]. – Zeiss Ikon Jan 12 '23 at 19:22
  • Is your /swapfile1 located inside the nvme0n1p6_crypt volume? – Zeiss Ikon Jan 12 '23 at 20:12
  • Yes it is, the encrypted partition is mounted as / and partition 5 is mounted as /boot – osilverstone96 Jan 12 '23 at 20:18

1 Answers1

1

You should add something like:

/swapfile1  none  swap  sw   0  0

to /etc/fstab.

Soren A
  • 6,799
  • Asker claimed to have tried this (it was the basis of the answer linked in the question), but it doesn't show in the pasted fstab. – Zeiss Ikon Jan 12 '23 at 20:09
  • 1
    Yes this works, I tried something similar from the thread that I mentioned but I think there were too many spaces. Thanks – osilverstone96 Jan 12 '23 at 20:16