Qubes Manager says "Logical volume is not a thin volume" when it actually is

Hello!

I wanted to recreate a private volume in the hope to reduce its footprint (the real size occuped by logical volume). Here is what I did in dom0 using a test VM:

# Mount and backup files
mkdir mnt
sudo mount /dev/qubes_dom0/vm-test-private mnt
cd mnt
sudo tar -czf /tmp/_test_backup.tar.gz .
cd ..
sudo umount mnt

# Remove old volume
sudo lvremove /dev/qubes_dom0/vm-test-private 

# Recreate and format the volume
sudo lvcreate --thin --size 2g --name vm-test-private qubes_dom0
sudo mkfs.ext4 /dev/qubes_dom0/vm-test-private 

# Mount and restore backup
sudo mount /dev/qubes_dom0/vm-test-private mnt
cd mnt
sudo rm -frd lost+found/
sudo tar -xf /tmp/_test_backup.tar.gz 
cd ..
sudo umount mnt

After all this, qvm-volume shows

$ qvm-volume info test:private
pool               vm-pool
vid                qubes_dom0/vm-test-private
rw                 True
source             
save_on_stop       True
snap_on_start      False
size               2147483648
usage              0
revisions_to_keep  0
ephemeral          False
is_outdated        False
Available revisions (for revert): none

I was a bit supprised that the “usage” is 0. I was expecting something like few megabytes here. And then, upon starting the test VM, I got this:

Logical volume qubes_dom0/vm-test-private is not a thin volume. Thin snapshot supports only thin origins.

What did I do wrong? I think I have created thin volume with “sudo lvcreate --thin --size 2g --name vm-test-private qubes_dom0” command, right? So why did dom0 told me the above?

Thanks

You have created a thin pool, not a thin volume.
To create a thin volume you need to use --virtualsize and specify the pool.

I don’t think you can actually copy data into a thin pool (I don’t know, didn’t search).
That would explain why the usage is zero.
Or maybe the qube must be started for the data to be updated.

I also think that your test qube use the vm-test-private you created because of the name.
But as it’s not a thin volume, you got the error message you pasted.
The data can probably not be updated because your vm-test-private is a pool.

You didn’t read carrefully the man page (man lvcreate). :slight_smile:
You didn’t read carrefully your internet searches.

https://www.startpage.com/do/search?q=lvm+create+thin+volume
first result (there are ofc many other resources).
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/thinly_provisioned_volume_creation

TLDR:
create a thin pool:

[user@dom0 ~]$ sudo lvcreate --thin --size 2g --name test42 qubes_dom0
|...]
  Logical volume "test42" created.

[user@dom0 ~]$ sudo lvs
  LV                      VG         Attr        LSize   Pool    [...]
  [...]
  test42                  qubes_dom0 twi-a-tz--   2.00g          [...]
  [...]
  vm-pool                 qubes_dom0 twi-aotz--  42.00g          [...]
  [...]
  vm-sys-dvm-private      qubes_dom0 Vwi-a-tz--   2.00g vm-pool  [...]

[user@dom0 ~]$ sudo lvremove qubes_dom0/test42
Do you really want to remove active logical volume qubes_dom0/test42? [y/n]: y
  Logical volume "test42" successfully removed

notice that test42 is not in the pool vm-pool, because test42 is a pool (just like vm-pool).

vs

create a thin volume:

[user@dom0 ~]$ sudo lvcreate --thin --virtualsize 2g --name test43 qubes_dom0/vm-pool
[...]
  Logical volume "test43" created.

[user@dom0 ~]$ sudo lvs
  LV                      VG         Attr        LSize   Pool       [...]
  [...]
  test43                  qubes_dom0 Vwi-a-tz--   2.00g vm-pool     [...]
  [...]

[user@dom0 ~]$ sudo lvremove qubes_dom0/test43
Do you really want to remove active logical volume qubes_dom0/test43? [y/n]: y
  Logical volume "test43" successfully removed
1 Like

Thank you, I see now. I was sitting hungry at the nuclear terminal and thought the “Launch” button was “Lunch”… :slight_smile: