Hi Chris,
Thank you very much for your fast and helpful reply.
For the sake of my own learning, I've been trying to verify what you said by
doing the following:
1. Clone a VM.
2. Compare the sizes of the parent and child VMs.
3. The child VM (which contains no delta from the parent VM) should have a much
smaller size than the parent VM (which is about 10 GB).
I haven't been able to do this, I presume due to my ignorance. The above
procedure would work with Hyper-V VMs, but it might be conceptually wrong for
regard to Qubes/Xen/Linux. I'm new to logical volumes on Linux, thin
provisioning, etc., though I've been trying to read up on them today. (If
anyone knows of good conceptual material on this stuff, I'd certainly
appreciate it.)
I ran qvm-clone to clone my Windows 8 HVM, named "windows". The clone is named
"windows2". I have never touched "windows2", so it should have no delta from
"windows".
In case it matters, the Windows 8 HVM started life as a Hyper-V .vhdx file,
which I converted to a .vhd using Powershell, then to an .img file using
StarWind Converter. I then imported it into Qubes using qvm-create with
--root-move-from.
My Qubes install is plain vanilla and I haven't tweaked any settings, file
systems, etc.
Here are some commands I've run to try to determine the actual size of
"windows2", and the output (edited to remove irrelevant info):
$ sudo lvm lvs
LV VG Attr LSize Pool
Origin Data% Meta% Move Log Cpy%Sync Convert
pool00 qubes_dom0 twi-aotz-- 43.98g
45.81 27.26
root qubes_dom0 Vwi-aotz-- 43.98g pool00
9.03
swap qubes_dom0 -wi-ao---- 5.98g
...
vm-windows-private qubes_dom0 Vwi-a-tz-- 2.00g pool00
0.00
vm-windows-private-1526795188-back qubes_dom0 Vwi-a-tz-- 2.00g pool00
0.00
vm-windows-root qubes_dom0 Vwi-a-tz-- 10.00g pool00
83.61
vm-windows-root-1526795191-back qubes_dom0 Vwi-a-tz-- 10.00g pool00
82.08
vm-windows2-private qubes_dom0 Vwi-a-tz-- 2.00g pool00
vm-windows-private 0.00
vm-windows2-root qubes_dom0 Vwi-a-tz-- 10.00g pool00
vm-windows-root 83.61
...
I'm guessing the LSize column means apparent size rather than actual size, so
vm-windows2-root having size 10 G wouldn't be unexpected.
Now I want to find the block special files for these VMs.
$ ls -la /dev/qubes_dom0
...
lrwxrwxrwx 1 root root 8 May 23 13:24 vm-windows2-private -> ../dm-32
lrwxrwxrwx 1 root root 8 May 23 13:24 vm-windows2-root -> ../dm-31
lrwxrwxrwx 1 root root 8 May 23 13:24 vm-windows-private -> ../dm-18
lrwxrwxrwx 1 root root 8 May 23 13:13 vm-windows-private-1526795188-back ->
../dm-17
lrwxrwxrwx 1 root root 8 May 23 13:24 vm-windows-root -> ../dm-20
lrwxrwxrwx 1 root root 8 May 23 13:13 vm-windows-root-1526795191-back ->
../dm-19
lrwxrwxrwx 1 root root 8 May 23 13:13 vm-work-private -> ../dm-16
So the parent (vm-windows-root) is dm-20, and the child (vm-windows2-root) is
dm-31.
$ sudo blockdev --getsize64 /dev/dm-20
10737418240
$ sudo blockdev --getsize64 /dev/dm-31
10737418240
Still getting 10 GB for both of them.
$ sudo fdisk -l /dev/dm-20
Disk /dev/dm-20: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: dos
Disk identifier: 0x18b40766
Device Boot Start End Sectors
Size Id Type
/dev/mapper/qubes_dom0-vm--windows--root-part1 * 2048 718847 716800
350M 7 HPFS/NTFS/exFAT
/dev/mapper/qubes_dom0-vm--windows--root-part2 718848 25163775 24444928
11.7G 7 HPFS/NTFS/exFAT
$ sudo fdisk -l /dev/dm-31
Disk /dev/dm-31: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: dos
Disk identifier: 0x18b40766
Device Boot Start End Sectors
Size Id Type
/dev/mapper/qubes_dom0-vm--windows2--root-part1 * 2048 718847 716800
350M 7 HPFS/NTFS/exFAT
/dev/mapper/qubes_dom0-vm--windows2--root-part2 718848 25163775 24444928
11.7G 7 HPFS/NTFS/exFAT
Still seeing the same 10 GB size for both VMs. The original .vhdx had a max
size of 12 GB, with the first 350 MB allocated for the system partition.
$ sudo du -h /dev/dm-20
0 /dev/dm-20
$ sudo du -h /dev/dm-31
0 /dev/dm-31
$ du -h --apparent-size /dev/dm-20
0 /dev/dm-20
$ du -h --apparent-size /dev/dm-31
0 /dev/dm-31
$ df /dev/dm-20
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1996484 0 1996484 0% /dev
$ df /dev/dm-31
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1996484 0 1996484 0% /dev
Not sure what I'm seeing there. Could be those commands aren't appropriate for
this type of file or storage?
Thank you!
--
You received this message because you are subscribed to the Google Groups
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qubes-users/6dc8f8ca-9986-4f88-8a3d-f115a5d52639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.