You are not logged in.

#1 2025-02-13 10:53:19

BenjB83
Member
From: Caracas, VE
Registered: 2023-11-14
Posts: 28
Website

[SOLVED] Swap File Setup not working

Hi,

I am running a system, setup with zram and I am trying to create a swapfile setup. I have followed the steps in the arch Arch Wiki. \

I created a sub volume:

# btrfs subvolume create /swap

Then I made it a swap file:

# btrfs filesystem mkswapfile --size 4g --uuid clear /swap/swapfile

Then I went to turn on swap and made the changes permanent, editing /etc/fstab.

/etc/fstab
/swap/swapfile none swap defaults 0 0

The system fails to boot... it gets me straight into the emergency mode.

This is my fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda2
UUID=199abba2-726b-4d43-8f6d-133575927808       /               btrfs           rw,relatime,c>

# /dev/sda2
UUID=199abba2-726b-4d43-8f6d-133575927808       /tmp            btrfs           rw,relatime,c>

# /dev/sda2
UUID=199abba2-726b-4d43-8f6d-133575927808       /var/log        btrfs           rw,relatime,c>

# /dev/sda2
#UUID=199abba2-726b-4d43-8f6d-133575927808       /swap/swapfile  none swap       defaults 0 0

# /dev/sda1
UUID=5D4B-AD6E          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,cod>

# /dev/sda4 LABEL=home
UUID=6647a667-23eb-4781-b94d-1abf33a0e56c       /home   ext4            rw,relatime     0 2

I have commented the swap entry out, for now, so the system boots.

Any help would be appreciated.

Last edited by BenjB83 (2025-02-13 13:25:59)

Offline

#2 2025-02-13 13:27:33

BenjB83
Member
From: Caracas, VE
Registered: 2023-11-14
Posts: 28
Website

Re: [SOLVED] Swap File Setup not working

In case someone is wondering... silly me did not realize, that I had added the UUID to the fstab entry. It had to be just

/swap/swapfile     none swap      defaults 0 0

Offline

Board footer

Powered by FluxBB