Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qvm-backup-restore should check if there is enough disk space / should continuously make sure to not run out of disk space #4791

Closed
adrelanos opened this issue Feb 5, 2019 · 16 comments · Fixed by QubesOS/qubes-core-admin-client#165

Comments

@adrelanos
Copy link
Member

Qubes OS version:

R4.0

Affected component(s):

dom0 qvm-backup-restore


Steps to reproduce the behavior:

Backup.
Restore the backup which fails for some reason.
Try restore backup again.
Will fail due to low disk space?

Expected behavior:

Check for enough disk space.

Actual behavior:

Run out of disk space.

General notes:

Running out of disk space risks a no longer bootable system.

Files it stored temporarily in /var/tmp are not deleted when trying to verify a backup which fails. Another attempt then can lead to no longer having enough disk space.


Related issues:

@andrewdavidwong andrewdavidwong added T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. C: core labels Feb 6, 2019
@andrewdavidwong andrewdavidwong added this to the Release 4.1 milestone Feb 6, 2019
@andrewdavidwong andrewdavidwong added the P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. label Mar 27, 2019
@tasket
Copy link

tasket commented Apr 1, 2019

@andrewdavidwong andrewdavidwong added P: major Priority: major. Between "default" and "critical" in severity. and removed P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels Apr 2, 2019
@andrewdavidwong
Copy link
Member

Another related user experience:

https://groups.google.com/d/msg/qubes-users/hv4Jao4V0BU/R7e7cFn_EwAJ

marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Sep 14, 2019
Add an option to wait for disk space before extracting a file from qfile
archive. This will allow extracting backup archive using much smaller
temporary space (only enough to hold few chunks, not the whole archive).

Technically, libqubes-rpc-filecopy library got a set_wait_for_space()
function, accepting a margin (in bytes) to be kept free.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue Sep 14, 2019
Add -w MARGIN option to always leave at least MARGIN bytes of free
space.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Sep 29, 2019
…ring

Make it possible to use qvm-backup-restore in a VM. This commit is about
accessing backup itself, when stored in another VM. This involve using
qfile-unpacker instead of qfile-dom0-unpacker and also requesting disk
space monitoring, as a VM probably won't have enough space to hold the
whole backup at once.

QubesOS/qubes-issues#4791
QubesOS/qubes-issues#5310
marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue Oct 18, 2019
Add -w MARGIN option to always leave at least MARGIN bytes of free
space.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Oct 18, 2019
…ring

Make it possible to use qvm-backup-restore in a VM. This commit is about
accessing backup itself, when stored in another VM. This involve using
qfile-unpacker instead of qfile-dom0-unpacker and also requesting disk
space monitoring, as a VM probably won't have enough space to hold the
whole backup at once.

QubesOS/qubes-issues#4791
QubesOS/qubes-issues#5310
marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Oct 18, 2019
Add an option to wait for disk space before extracting a file from qfile
archive. This will allow extracting backup archive using much smaller
temporary space (only enough to hold few chunks, not the whole archive).

Technically, libqubes-rpc-filecopy library got a set_wait_for_space()
function, accepting a margin (in bytes) to be kept free.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Apr 30, 2020
Add an option to wait for disk space before extracting a file from qfile
archive. This will allow extracting backup archive using much smaller
temporary space (only enough to hold few chunks, not the whole archive).

Technically, libqubes-rpc-filecopy library got a set_wait_for_space()
function, accepting a margin (in bytes) to be kept free.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-core-agent-linux that referenced this issue Aug 3, 2020
Add -w MARGIN option to always leave at least MARGIN bytes of free
space.

QubesOS/qubes-issues#4791
marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Aug 3, 2020
…ring

Make it possible to use qvm-backup-restore in a VM. This commit is about
accessing backup itself, when stored in another VM. This involve using
qfile-unpacker instead of qfile-dom0-unpacker and also requesting disk
space monitoring, as a VM probably won't have enough space to hold the
whole backup at once.

QubesOS/qubes-issues#4791
QubesOS/qubes-issues#5310
marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Aug 4, 2020
…ring

Make it possible to use qvm-backup-restore in a VM. This commit is about
accessing backup itself, when stored in another VM. This involve using
qfile-unpacker instead of qfile-dom0-unpacker and also requesting disk
space monitoring, as a VM probably won't have enough space to hold the
whole backup at once.

QubesOS/qubes-issues#4791
QubesOS/qubes-issues#5310
marmarek added a commit to marmarek/qubes-core-admin-client that referenced this issue Jan 5, 2021
Avoid failing restore after potentially lengthy processing - check
available space first.

This will be even more important after adding waiting for free space -
then if there won't be enough free space, the process will deadlock.

QubesOS/qubes-issues#4791
marmarek added a commit to QubesOS/qubes-core-admin-client that referenced this issue Jul 4, 2021
Avoid failing restore after potentially lengthy processing - check
available space first.

This will be even more important after adding waiting for free space -
then if there won't be enough free space, the process will deadlock.

QubesOS/qubes-issues#4791

(cherry picked from commit 10d4381)
marmarek added a commit to QubesOS/qubes-core-admin-client that referenced this issue Jul 4, 2021
Instead of failing the restore process, pause data extracting, until
already extracted data gets processed.
This commit implements this for local tar extraction. Extracting data
received from a VM is handled in qfile-(dom0-)unpacker, which also has
similar feature, turned on in 6338b93.

Fixes QubesOS/qubes-issues#4791

(cherry picked from commit 9360865)
marmarek added a commit to QubesOS/qubes-core-admin-client that referenced this issue Jul 4, 2021
This test uses three tricks to test /var/tmp space monitoring:
1. Creates a big uncompressed backup (2GB file instead of few bytes)
2. Mount small tmpfs over /var/tmp (650MB - minimal space that should
   not deadlock the restore)
3. Artificially slow down data processing by adding sleep()

QubesOS/qubes-issues#4791

(cherry picked from commit 0f42fd0)
@qubesos-bot
Copy link

Automated announcement from builder-github

The package core-admin-client has been pushed to the r4.0 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package python3-qubesadmin-4.0.33-1.fc25 has been pushed to the r4.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-core-admin-client_4.0.33-1 has been pushed to the r4.0 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing buster-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-admin-client (including package python3-qubesadmin-4.0.33-1.fc32) has been pushed to the r4.0 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-core-admin-client_4.0.33-1+deb10u1 has been pushed to the r4.0 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-admin-client (including package python3-qubesadmin-4.0.33-1.fc32) has been pushed to the r4.0 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component core-admin-client (including package python3-qubesadmin-4.0.33-1.fc25) has been pushed to the r4.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment