You are not logged in.

#1 2024-12-14 05:04:47

pidaras
Member
Registered: 2024-12-14
Posts: 7

cant mount swapfile on boot (luks over lvm on 2 drive systemd)

I have luks over lvm on 2 drive system.
Here is my cmdline:

rd.luks.name=7ecbcf9c-734e-4b7d-90ff-b18e5cffdad4=linuxroot  root=/dev/mapper/linuxroot rootfstype=btrfs rootflags=subvol=/@ rw

Here is my fstab:

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e       /               btrfs           rw,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,sub>

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e       /home           btrfs           rw,nodev,relatime,compress=zstd:3,ssd,space_cache=v2,commit=1>

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e       /var            btrfs           rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cac>

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e       /.snapshots     btrfs           rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cac>

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e       /.swap          btrfs           rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cac>

/.swap/swapfile none swap defaults 0 0

# /dev/nvme0n1p1 LABEL=ESP
UUID=00EB-554E          /efi            vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,e>

swapon -show outupt:

Filename				Type		Size		Used		Priority
/.swap/swapfile                         file		524284		0		-2

so, I suppose its activated but lsblk -f dont display it. And... it doesnt work

Offline

#2 2024-12-14 08:48:35

seth
Member
Registered: 2012-09-03
Posts: 59,911

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

You've read and followed https://wiki.archlinux.org/title/Btrfs#Swap_file ?
Please post the complete fstab and don't copy it out of a pager as the latter truncates li>

It's not a block device, what's the actual output of "lsblk -f" and what would you expect to see beyond that?

Also how do you determine that "it doesn't work"?
To be clear, you cannot "mount" swap devices in the traditional sense to begin with.
Edit: ie. like entering it like a directory and look at files inside or so.

Last edited by seth (2024-12-14 08:49:13)

Offline

#3 2024-12-14 11:01:51

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,494
Website

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

Don't use a swap file with btrfs, it's a horrible hack.


Para todos todo, para nosotros nada

Offline

#4 2024-12-14 14:01:46

pidaras
Member
Registered: 2024-12-14
Posts: 7

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

fstab:

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e	/         	btrfs     	rw,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,subvol=/@	0 0

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e	/home     	btrfs     	rw,nodev,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,subvol=/@home	0 0

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e	/var      	btrfs     	rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,subvol=/@var	0 0

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e	/.snapshots	btrfs     	rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,subvol=/@snapshots	0 0

# /dev/mapper/linuxroot LABEL=linuxroot
UUID=254127e3-541c-47ec-95a4-e89e3eb6442e	/.swap    	btrfs     	rw,nosuid,nodev,noexec,relatime,compress=zstd:3,ssd,space_cache=v2,commit=120,subvol=/@swap	0 0

/.swap/swapfile none swap defaults 0 0

# /dev/nvme0n1p1 LABEL=ESP
UUID=00EB-554E      	/efi      	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

lsblk -f:

lsblk -f
NAME              FSTYPE      FSVER            LABEL       UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda               iso9660     Joliet Extension ARCH_202412 2024-12-01-05-48-32-00                                
├─sda1            iso9660     Joliet Extension ARCH_202412 2024-12-01-05-48-32-00                                
└─sda2            vfat        FAT32            ARCHISO_EFI 674B-F8B0                                             
nvme1n1                                                                                                          
└─nvme1n1p1       LVM2_member LVM2 001                     jLFgfS-cJhO-EBLb-l2QX-6vY6-Wz63-QwiE52                
  └─vg0-cryptroot crypto_LUKS 2                            7ecbcf9c-734e-4b7d-90ff-b18e5cffdad4                  
    └─linuxroot   btrfs                        linuxroot   254127e3-541c-47ec-95a4-e89e3eb6442e      1.4T     0% /home
                                                                                                                 /var
                                                                                                                 /.swap
                                                                                                                 /.snapshots
                                                                                                                 /
nvme0n1                                                                                                          
├─nvme0n1p1       vfat        FAT32            ESP         00EB-554E                               281.1M    45% /efi
└─nvme0n1p2       LVM2_member LVM2 001                     hFtBoI-9fTg-VxEx-Sbfq-EKi9-Uhse-tMbA1k                
  └─vg0-cryptroot crypto_LUKS 2                            7ecbcf9c-734e-4b7d-90ff-b18e5cffdad4                  
    └─linuxroot   btrfs                        linuxroot   254127e3-541c-47ec-95a4-e89e3eb6442e      1.4T     0% /home
                                                                                                                 /var
                                                                                                                 /.swap
                                                                                                                 /.snapshots
                                                                                                                 /

i want to see [SWAP] in lsblk

Offline

#5 2024-12-14 14:10:46

pidaras
Member
Registered: 2024-12-14
Posts: 7

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

f*ck, i think its because of compression

Offline

#6 2024-12-14 14:11:24

seth
Member
Registered: 2012-09-03
Posts: 59,911

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

i want to see [SWAP] in lsblk

seth wrote:

It's not a block device

Idk about btrfs swapfiles, but you won't typically see them in lsblk for that reason.

Offline

#7 2024-12-14 14:13:48

pidaras
Member
Registered: 2024-12-14
Posts: 7

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

yeap, i managed to hibernate from tty, but is so strange. Its flicking why hibernating and it doest asks password when I entering system. Hibernation from active compositor session doesnt work anyway

Offline

#8 2024-12-14 14:18:35

pidaras
Member
Registered: 2024-12-14
Posts: 7

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

i think that using logical volume will be better idea, i use lvm anyway. Its looks more stable and straightforward. I will try lately

Offline

#9 2024-12-14 14:19:12

pidaras
Member
Registered: 2024-12-14
Posts: 7

Re: cant mount swapfile on boot (luks over lvm on 2 drive systemd)

thank dude

Offline

Board footer

Powered by FluxBB