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?
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).
You didn’t read carrefully your internet searches.