Command failed with status code 5 when trying to change cache mode to writeback

elcaribou12

New Member
Mar 28, 2025
6
0
1
Hi,
I'm not a power user of proxmox but I try to optimize my storage by putting an ssd as a cache.

I manage to do it but the cache mode is writethrough and I want to pass it to writeback but when I do :

lvchange --cachemode writeback vg_data/lv_data

The answer is :

Command failed with status code 5.

There is my storage config :

root@pve:~# lvs -o+cache_mode,cache_settings
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert CacheMode CacheSettings
data pve twi-aotz-- <49.34g 32.42 2.11
root pve -wi-ao---- <37.70g
swap pve -wi-ao---- 8.00g
vm-100-disk-0 pve Vwi-a-tz-- 4.00g data 29.20
vm-101-disk-0 pve Vwi-a-tz-- 8.00g data 36.24
vm-102-disk-0 pve Vwi-a-tz-- 8.00g data 22.00
vm-103-disk-0 pve Vwi-a-tz-- 8.00g data 21.54
vm-104-disk-0 pve Vwi-a-tz-- 8.00g data 16.25
vm-105-disk-0 pve Vwi-a-tz-- 8.00g data 16.65
vm-106-disk-0 pve Vwi-a-tz-- 8.00g data 19.93
vm-107-disk-0 pve Vwi-a-tz-- 8.00g data 15.43
vm-108-disk-0 pve Vwi-a-tz-- 8.00g data 37.32
lv_data vg_data Cwi---C--- 200.00g [cachepool_cpool] [lv_data_corig] writethrough
lv_data_storage vg_data -wi-a----- <17.29t
lv_data_storage vg_data -wi-a----- <17.29t

Can you tell me why I can't change the cache mode to writeback ?

Thanks
 
Hi!

Have you checked whether there is any error logged in the syslog/dmesg? What is the output of lvs -ao+devices?
 
Thanks for the help !

Nothing relevant in the syslog/dmesg.

This is the output unfortunatly with a bad text format

root@pve:~# lvs -ao+devices
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices
data pve twi-aotz-- <49.34g 32.44 2.11 data_tdata(0)
[data_tdata] pve Twi-ao---- <49.34g /dev/sdc3(11698)
[data_tmeta] pve ewi-ao---- 1.00g /dev/sdc3(24329)
[lvol0_pmspare] pve ewi------- 1.00g /dev/sdc3(24585)
root pve -wi-ao---- <37.70g /dev/sdc3(2048)
swap pve -wi-ao---- 8.00g /dev/sdc3(0)
vm-100-disk-0 pve Vwi-aotz-- 4.00g data 29.21
vm-101-disk-0 pve Vwi-aotz-- 8.00g data 36.25
vm-102-disk-0 pve Vwi-aotz-- 8.00g data 22.03
vm-103-disk-0 pve Vwi-a-tz-- 8.00g data 21.54
vm-104-disk-0 pve Vwi-aotz-- 8.00g data 16.25
vm-105-disk-0 pve Vwi-aotz-- 8.00g data 16.67
vm-106-disk-0 pve Vwi-a-tz-- 8.00g data 19.93
vm-107-disk-0 pve Vwi-a-tz-- 8.00g data 15.43
vm-108-disk-0 pve Vwi-a-tz-- 8.00g data 37.36
[cachepool_cpool] vg_data Cwi---C--- 190.00g cachepool_cpool_cdata(0)
[cachepool_cpool_cdata] vg_data Cwi------- 190.00g /dev/sdb(0)
[cachepool_cpool_cmeta] vg_data ewi------- 10.00g /dev/sdb(48640)
lv_data vg_data Cwi---C--- 200.00g [cachepool_cpool] [lv_data_corig] lv_data_corig(0)
[lv_data_corig] vg_data owi---C--- 200.00g /dev/sda(0)
lv_data_storage vg_data -wi-ao---- <17.29t /dev/sda(51200)
lv_data_storage vg_data -wi-ao---- <17.29t /dev/sdd(0)
[lvol0_pmspare] vg_data ewi------- 10.00g /dev/sdd(2674679)
 
Hi!

lvchange --cachemode writeback vg_data/lv_data

The answer is :

Command failed with status code 5.
Is there certainly no other output than this line? The status code 5 is a completely general error for lvchange and does not indicate anything other than that the command failed. You could try to add a --verbose flag to the command.

Else, I'd be curious what the LV lv_data_storage does, as it lies on the same disk device as the caching device and is in state active and is opened? have you tried to (temporarily) disable it, if there's nothing currently reading/writing from/to the LV?
 
Hi !

The verbose flag add "Archiving volume group "vg_data" metadata (seqno 22)." to the status code 5

lv_data_storage is the main storage and for my understanding lv_data is the cache of lv_data_storage but maybe i don't do it correctly