You are not logged in.

#1 2025-02-05 22:51:38

Wateir
Member
Registered: 2024-12-28
Posts: 27

[SOLVED] Enable zram backend device : Device or resource busy

I have already zram setup for some week, and now i want a backup device for have more "unified memory"

So i follow what the wiki said, with no more resultat than the erroron the title.

I tried to change the udev rule

ACTION=="add", KERNEL=="zram0", ATTR{comp_algorithm}="zstd", ATTR{disksize}="8G", RUN="/usr/bin/mkswap -U clear /dev/%k", TAG+="systemd", ATTR{backing_dev}="/dev/volgroup0/lv_swap"

with no succes too.

i tried a bunch of other combinastion of tee and echo command and everything i can rember who can write on the file, but not i can seems to write on /sys/block/zram0/backing_dev

Some system info :
Kernel : Linux 6.12.10-hardened1-1-hardened
zramctl from util-linux 2.40.4

$ lsblk
NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                       8:0    1     0B  0 disk  
zram0                   253:0    0     8G  0 disk  [SWAP]
nvme0n1                 259:0    0 476.9G  0 disk  
├─nvme0n1p1             259:1    0     1G  0 part  /efi
└─nvme0n1p2             259:2    0 475.9G  0 part  
  └─lv_root             254:0    0 475.9G  0 crypt 
    ├─volgroup0-lv_root 254:1    0    50G  0 lvm   /
    ├─volgroup0-lv_home 254:2    0   300G  0 lvm   /home
    └─volgroup0-lv_swap 254:3    0    24G  0 lvm   

and /dev/volgroup0/lv_swap is the partion i want to use for baking device

Last edited by Wateir (2025-02-13 22:37:01)

Offline

#2 2025-02-05 23:07:12

mackin_cheese
Member
Registered: 2025-01-07
Posts: 477

Re: [SOLVED] Enable zram backend device : Device or resource busy

wateir wrote:

So i follow what the wiki said, with no more resultat than the erroron the title.

which exact part of the wiki article? what's the exact sections?

Offline

#3 2025-02-06 07:46:15

Wateir
Member
Registered: 2024-12-28
Posts: 27

Re: [SOLVED] Enable zram backend device : Device or resource busy

which exact part of the wiki article? what's the exact sections?

Manually part here
https://wiki.archlinux.org/title/Zram#E … zram_block

Offline

#4 2025-02-07 08:28:43

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: [SOLVED] Enable zram backend device : Device or resource busy

The "Device or resource busy" error shows because the udev rule gets run twice. The wiki page was recently updated to fix this by additionally matching the state of the zram device with

ATTR{initstate}=="0"

Add that to your udev rule (as shown in the wiki page) and try again.

AFAIK, all parameters must be set while initializing the device, so the manual method shouldn't work after the zram device already has been assigned a disksize.

Offline

#5 2025-02-13 22:35:59

Wateir
Member
Registered: 2024-12-28
Posts: 27

Re: [SOLVED] Enable zram backend device : Device or resource busy

Sorry for late respond

So i have a solution. If it can help somone.

all parameters must be set while initializing the device, so the manual method shouldn't work after the zram device already has been assigned a disksize.

So this not true, because i can do that.

For use manual methode after setup zram and start using it, for change all kind of thing that the error "ressource busy" don't allow you

swapoff -a

This gonna disable swap

modprob -r zram

This gonna "kill" (i don't have the right term, i'm sorry) zram

whatever command you need to run for change on zram
modprob zram

Reboot and enjoy youre change.

The wiki page was recently updated to fix this by additionally matching the state of the zram device with

Gonna read that, thanks mate

Offline

#6 2025-07-07 03:15:43

Rf0421
Member
Registered: 2025-07-07
Posts: 1

Re: [SOLVED] Enable zram backend device : Device or resource busy

Wateir wrote:

Sorry for late respond

So i have a solution. If it can help somone.

all parameters must be set while initializing the device, so the manual method shouldn't work after the zram device already has been assigned a disksize.

So this not true, because i can do that.

For use manual methode after setup zram and start using it, for change all kind of thing that the error "ressource busy" don't allow you

swapoff -a

This gonna disable swap

modprob -r zram

This gonna "kill" (i don't have the right term, i'm sorry) zram

whatever command you need to run for change on zram
modprob zram

Reboot and enjoy youre change.

The wiki page was recently updated to fix this by additionally matching the state of the zram device with [SOLVED] Enable zram backend device : Device or resource busy
https://bbs.archlinux.org/viewtopic.php?id=303196

Gonna read that, thanks mate

How exactly did this work for you? Once you "kill" zram as you say, the device is no longer mounted and the directories become inaccessible.

If zram is active I can't write to it cause it's in use. If i kill it it doesn't work cause it isn't active.

Offline

Board footer

Powered by FluxBB