location of root.img in v4.0

174 views
Skip to first unread message

lik...@gmx.de

unread,
Sep 21, 2018, 5:10:06 PM9/21/18
to qubes...@googlegroups.com
Hi,

there are several topics in the documentation pointing to the location of files like: root.img, volatile.img, private.img
here:
https://www.qubes-os.org/doc/hvm/
or here:
https://www.qubes-os.org/doc/windows-template-customization/
or here:
https://www.qubes-os.org/doc/reinstall-template/

All of them are refering to a location of these file to: /var/lib/qubes/{appvms,vm-templates}/MY_VM/

Unfortunately, as of version 4.0 I cannot find these files there. Where did they moved to?

Thanks, Pete

Chris Laprise

unread,
Sep 21, 2018, 5:30:11 PM9/21/18
to lik...@gmx.de, qubes...@googlegroups.com
The R4.0 default is to use thin-provisioned lvm for storage instead of
image files. You can think of these "logical volumes" as being like
partitions and they have device entries under /dev/mapper. To view and
manipulate them directly you'll need to use lvm commands like "lvs" and
"lvrename" etc. although its best to first try using the qvm-* commands
like "qvm-volume".


--

Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

Chris Laprise

unread,
Sep 21, 2018, 5:43:18 PM9/21/18
to lik...@gmx.de, qubes...@googlegroups.com
On 09/21/2018 05:30 PM, Chris Laprise wrote:
> On 09/21/2018 05:10 PM, lik...@gmx.de wrote:
>> Hi,
>>
>> there are several topics in the documentation pointing to the location
>> of files like: root.img, volatile.img, private.img
>> here:
>> https://www.qubes-os.org/doc/hvm/
>> or here:
>> https://www.qubes-os.org/doc/windows-template-customization/
>> or here:
>> https://www.qubes-os.org/doc/reinstall-template/
>>
>> All of them are refering to a location of these file to:
>> /var/lib/qubes/{appvms,vm-templates}/MY_VM/
>>
>> Unfortunately, as of version 4.0 I cannot find these files there.
>> Where did they moved to?
>
> The R4.0 default is to use thin-provisioned lvm for storage instead of
> image files. You can think of these "logical volumes" as being like
> partitions and they have device entries under /dev/mapper. To view and
> manipulate them directly you'll need to use lvm commands like "lvs" and
> "lvrename" etc. although its best to first try using the qvm-* commands
> like "qvm-volume".

To be a bit more specific, a Qubes AppVM called "work" within this lvm
system will boot from an lvm volume named "vm-work-root-snap". This is
because Qubes takes a read-only snapshot of the template root when the
AppVM is started.

lik...@gmx.de

unread,
Sep 22, 2018, 5:02:00 AM9/22/18
to qubes...@googlegroups.com
On 21/09/2018 23:43, Chris Laprise wrote:
> On 09/21/2018 05:30 PM, Chris Laprise wrote:
>> On 09/21/2018 05:10 PM, liked2-Mm...@public.gmane.org wrote:
>>> Hi,
>>>
>>> there are several topics in the documentation pointing to the location of files like: root.img, volatile.img, private.img
>>> here:
>>> https://www.qubes-os.org/doc/hvm/
>>> or here:
>>> https://www.qubes-os.org/doc/windows-template-customization/
>>> or here:
>>> https://www.qubes-os.org/doc/reinstall-template/
>>>
>>> All of them are refering to a location of these file to: /var/lib/qubes/{appvms,vm-templates}/MY_VM/
>>>
>>> Unfortunately, as of version 4.0 I cannot find these files there. Where did they moved to?
>>
>> The R4.0 default is to use thin-provisioned lvm for storage instead of image files. You can think of these "logical volumes" as being like partitions and they have device entries under /dev/mapper. To view and manipulate them directly you'll need to use lvm commands like "lvs" and "lvrename" etc. although its best to first try using the qvm-* commands like "qvm-volume".
>
> To be a bit more specific, a Qubes AppVM called "work" within this lvm system will boot from an lvm volume named "vm-work-root-snap". This is because Qubes takes a read-only snapshot of the template root when the AppVM is started.
>
>

Thanks a lot Chris. With this explanation, does the stripping still makes sense documented here:
https://www.qubes-os.org/doc/windows-template-customization/
mentioned in the last paragraphs?

I could even think that's even counterproductive, because when the space is filled with zeros, the volume size will be increased. Is there a possibility to strip this space or should we ad a remark to the documentation, that it's not reasonable to do so as of R4.0?

Best, Pete

Chris Laprise

unread,
Sep 22, 2018, 11:02:02 AM9/22/18
to lik...@gmx.de, qubes...@googlegroups.com
This depends on whether Windows is configured to use TRIM/discard on its
disks. I don't recall what the default is for various versions of
Windows, but there is an easy way to tell... if Qube Manager shows the
disk usage for the template going down as you remove stuff then you
don't need to do anything. Otherwise, I suggest following Microsoft
instructions for enabling TRIM.

If you still want to duplicate the kind of wipe+sparse copy the Qubes
doc recommends (i.e. if you removed a lot of stuff _before_ TRIM was
enabled), its possible to do this using lvm commands and 'dd
conv=sparse'... but you need to familiarize with Linux lvm first.

Chris Laprise

unread,
Sep 22, 2018, 11:34:49 AM9/22/18
to lik...@gmx.de, qubes...@googlegroups.com
Also should mention the 'fallocate' command. It has a way to deallocate
zero blocks in-place so you probably won't need to use issue lvm
commands directly:

sudo fallocate --dig-holes /dev/mapper/qubes_dom0-vm--untrusted--private

This method can also be used on .img files (for Qubes installations that
use them).
Reply all
Reply to author
Forward
0 new messages