2019-04-13 02:25:57 -04:00
|
|
|
---
|
2021-03-13 13:06:18 -05:00
|
|
|
lang: en
|
2019-04-13 02:25:57 -04:00
|
|
|
layout: doc
|
2021-06-16 22:56:25 -04:00
|
|
|
permalink: /doc/mount-lvm-image/
|
2021-03-13 13:06:18 -05:00
|
|
|
ref: 46
|
2021-06-17 07:23:57 -04:00
|
|
|
title: How to Mount LVM Images
|
2019-04-13 02:25:57 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
You want to read your LVM image (e.g., there is a problem where you can't start any VMs except dom0).
|
|
|
|
|
2019-04-13 02:25:57 -04:00
|
|
|
1: make the image available for qubesdb.
|
2019-10-04 11:46:39 -04:00
|
|
|
From dom0 terminal:
|
2019-04-13 02:25:57 -04:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# Example: /dev/qubes_dom0/vm-debian-9-tmp-root
|
|
|
|
[user@dom0]$ dev=$(basename $(readlink /dev/YOUR_LVM_VG/YOUR_LVM_IMAGE))
|
|
|
|
[user@dom0]$ qubesdb-write /qubes-block-devices/$dev/desc "YOUR_LVM_IMAGE"
|
|
|
|
```
|
|
|
|
|
|
|
|
2: Create a new disposable VM
|
|
|
|
|
|
|
|
```bash
|
|
|
|
[user@dom0]$ qvm-run -v --dispvm=YOUR_DVM_TEMPLATE --service qubes.StartApp+xterm &
|
|
|
|
```
|
|
|
|
|
|
|
|
3: Attach the device to your newly created disp VM
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
From the GUI, or from the command line:
|
|
|
|
|
2019-04-13 02:25:57 -04:00
|
|
|
```bash
|
|
|
|
[user@dom0]$ qvm-block attach NEWLY_CREATED_DISPVM dom0:$dev
|
|
|
|
```
|
|
|
|
|
|
|
|
4: Mount the partition you want to, and do what you want with it
|
|
|
|
|
|
|
|
```bash
|
|
|
|
[user@dispXXXX]$ mount /dev/xvdiX /mnt/
|
|
|
|
```
|
|
|
|
|
|
|
|
5: Umount and kill the VM
|
2021-03-13 12:03:23 -05:00
|
|
|
|
|
|
|
```bash
|
2019-04-13 02:25:57 -04:00
|
|
|
[user@dispXXXX]$ umount /mnt/
|
|
|
|
```
|
|
|
|
|
|
|
|
6: Remove the image from qubesdb
|
2021-03-13 12:03:23 -05:00
|
|
|
|
|
|
|
```bash
|
2019-04-13 02:25:57 -04:00
|
|
|
[user@dom0]$ qubesdb-rm /qubes-block-devices/$dev/
|
|
|
|
```
|
|
|
|
|
|
|
|
# References
|
|
|
|
|
2021-04-10 18:09:05 -04:00
|
|
|
Please consult this issue's [comment](https://github.com/QubesOS/qubes-issues/issues/4687#issuecomment-451626625).
|
2021-03-13 12:03:23 -05:00
|
|
|
|