Update disk-troubleshooting.md

This commit is contained in:
Enjeck Cleopatra 2020-10-19 17:42:33 +01:00 committed by GitHub
parent fe877dbe8b
commit 7d365f1083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,17 +16,24 @@ redirect_from:
VMs (especially templates) use pre-allocated space.
The default private storage max size is 2 GB, but it's very easy to increase as needed.
If the disk is completely full, you will get an `Out of disk space` error that may crash your system because Dom0 does not have enough disk space to work.
So it's good practice to regularly check disk space usage with the command `df -h` in dom0 terminal.
A system that's out of space should be able to boot, but may be unable to load a desktop manager.
In this case it is possible to login to dom0 terminal with Alt + Ctrl + F2.
To recover disk space it may be possible to delete files in a userVM by connecting to the userVM terminal:
So it's good practice to regularly check disk space usage.
Running the `df -h` command in dom0 terminal will show some information, but not include all the relevant details.
The Qubes user interface provides a disk space widget.
If you are unable to access the interface, the command line version is running `sudo lvs | head` and looking at top entry for LVM pool.
For example:
~~~
qvm-start <VMname>
qvm-console-dispvm <VMname>
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool00 qubes_dom0 twi-aotz-- 453.17g 89.95 69.78
root qubes_dom0 Vwi-aotz-- 453.17g pool00 5.87
swap qubes_dom0 -wi-ao---- 7.57g
~~~
If you run `df -h`, it only shows the information in the `root` line (which is already included in the `pool00` line).
As you can see, the `sudo lvs | head` command includes additional important columns `Data%` and `Meta%`, shown in the above example to have the values 89% and 69% respectively.
If your system is able to boot, but cannot load a desktop environment, it is possible to login to dom0 terminal with Alt + Ctrl + F2.
If this does not work, check the size of /var/lib/qubes/qubes.xml.
If it is zero, you'll need to use one of the file backup (stored in /var/lib/qubes/backup), hopefully you have the current data there.
Find the most recent one and place in /var/lib/qubes/qubes.xml instead of the empty file.
@ -37,7 +44,7 @@ If not, here are some hints how to free some disk space:
1. Clean yum cache.
~~~
sudo yum clean all
sudo dnf clean all
~~~
2. Delete `.img` files of a less important VM, which can be found in `/var/lib/qubes/appvms/`.
@ -55,7 +62,50 @@ If not, here are some hints how to free some disk space:
sudo tune2fs -m 4 /dev/mapper/vg_dom0-lv_root
~~~
4. Remove some unneeded files in dom0 home (if you have any, most likely not).
4. Remove some unneeded files in dom0 home (if you have any, most likely not). Also look for unneeded files in `/var/log` in dom0, and `/var/log/qubes`.
The above steps applies to old VM disks format. These steps may work on Qubes 4.0, but are not default anymore. By default, Qubes 4.0 now uses LVM. The equivalent steps are:
1. Get a list of VM disks using `sudo lvs`.
2. Use `sudo lvremove qubes_dom0/<name>` to remove backup copies of some less important VMs -- entries with `-back` in their name.
3. If that isn't enough, remove actual disks of less important VMs. NOTE: You will lose the data of that VM, but your system will resume working.
For example:
~~~
$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool00 qubes_dom0 twi-aotz-- 453.17g 89.95 69.78
root qubes_dom0 Vwi-aotz-- 453.17g pool00 5.87
swap qubes_dom0 -wi-ao---- 7.57g
(...)
vm-d10test-private qubes_dom0 Vwi-a-tz-- 2.00g pool00 vm-d10test-private-1600961860-back 29.27
vm-d10test-private-1600961860-back qubes_dom0 Vwi-a-tz-- 2.00g pool00 4.87
vm-d10test-standalone-private qubes_dom0 Vwi-a-tz-- 2.00g pool00 vm-d10test-standalone-private-1580772439-back 4.90
vm-d10test-standalone-private-1580772439-back qubes_dom0 Vwi-a-tz-- 2.00g pool00 4.87
vm-d10test-standalone-root qubes_dom0 Vwi-a-tz-- 10.00g pool00 vm-d10test-standalone-root-1580772439-back 43.37
vm-d10test-standalone-root-1580772439-back qubes_dom0 Vwi-a-tz-- 10.00g pool00 42.05
vm-debian-10-my-private qubes_dom0 Vwi-a-tz-- 2.00g pool00 4.96
vm-debian-10-my-root qubes_dom0 Vwi-a-tz-- 10.00g pool00 vm-debian-10-my-root-1565013689-back 57.99
vm-debian-10-my-root-1565013689-back qubes_dom0 Vwi-a-tz-- 10.00g pool00 56.55
vm-debian-10-private qubes_dom0 Vwi-a-tz-- 2.00g pool00 4.94
vm-debian-10-root qubes_dom0 Vwi-a-tz-- 10.00g pool00 vm-debian-10-root-1601126126-back 93.44
vm-debian-10-root-1601126126-back qubes_dom0 Vwi-a-tz-- 10.00g pool00 88.75
(...)
$ sudo lvremove qubes_dom0/vm-d10test-standalone-root-1580772439-back
Do you really want to remove and DISCARD active logical volume qubes_dom0/vm-d10test-standalone-root-1580772439-back? [y/n]: y
Logical volume "vm-d10test-standalone-root-1580772439-back" successfully removed
~~~
After freeing some intial space, it may be possible to recover more space by deleting files in a userVM after connecting to the userVM terminal:
qvm-start <VMname>
qvm-console-dispvm <VMname>
~~~
Since `qvm-console-dispvm` requires working graphical user interface login, you must first free enough space to be able to start a VM and login to graphical UI.
## Can't resize VM storage / "resize2fs: Permission denied" error ##
@ -70,7 +120,7 @@ To fix this issue:
1. In the dom0 terminal get a root console on the vm (eg. sys-usb) with:
~~~
sudo xl console -t pv sys-usb
qvm-console-dispvm sys-usb
~~~
2. Unmount everything mounted on the private volume `/dev/xvdb partition`.