2019-04-13 06:25:57 +00:00
|
|
|
---
|
2021-03-13 19:06:18 +01:00
|
|
|
lang: en
|
2019-04-13 06:25:57 +00:00
|
|
|
layout: doc
|
2021-06-16 19:56:25 -07:00
|
|
|
permalink: /doc/mount-lvm-image/
|
2021-03-13 19:06:18 +01:00
|
|
|
ref: 46
|
2021-07-09 05:10:44 -07:00
|
|
|
title: How to mount LVM images
|
2019-04-13 06:25:57 +00:00
|
|
|
---
|
|
|
|
|
2021-03-13 18:03:23 +01: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 06:25:57 +00:00
|
|
|
1: make the image available for qubesdb.
|
2019-10-04 15:46:39 +00:00
|
|
|
From dom0 terminal:
|
2019-04-13 06:25:57 +00: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 18:03:23 +01:00
|
|
|
From the GUI, or from the command line:
|
|
|
|
|
2019-04-13 06:25:57 +00: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 18:03:23 +01:00
|
|
|
|
|
|
|
```bash
|
2019-04-13 06:25:57 +00:00
|
|
|
[user@dispXXXX]$ umount /mnt/
|
|
|
|
```
|
|
|
|
|
|
|
|
6: Remove the image from qubesdb
|
2021-03-13 18:03:23 +01:00
|
|
|
|
|
|
|
```bash
|
2019-04-13 06:25:57 +00:00
|
|
|
[user@dom0]$ qubesdb-rm /qubes-block-devices/$dev/
|
|
|
|
```
|
|
|
|
|
|
|
|
# References
|
|
|
|
|
2021-04-11 00:09:05 +02:00
|
|
|
Please consult this issue's [comment](https://github.com/QubesOS/qubes-issues/issues/4687#issuecomment-451626625).
|