From ad02700b519cebfd6547e49c85ad9fd1d493a7b9 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Thu, 15 Sep 2022 11:06:59 +0200 Subject: [PATCH] fix(backups/RemoteAdapter#_getPartition): mount with norecovery option --- @xen-orchestra/backups/RemoteAdapter.js | 4 +++- packages/xo-server/docs/file-restoration.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/@xen-orchestra/backups/RemoteAdapter.js b/@xen-orchestra/backups/RemoteAdapter.js index 30dafd219..0240b4d2e 100644 --- a/@xen-orchestra/backups/RemoteAdapter.js +++ b/@xen-orchestra/backups/RemoteAdapter.js @@ -128,7 +128,9 @@ class RemoteAdapter { } async *_getPartition(devicePath, partition) { - const options = ['loop', 'ro'] + // the norecovery option is necessary because if the partition is dirty, + // mount will try to fix it which is impossible if because the device is read-only + const options = ['loop', 'ro', 'norecovery'] if (partition !== undefined) { const { size, start } = partition diff --git a/packages/xo-server/docs/file-restoration.md b/packages/xo-server/docs/file-restoration.md index 9d717797e..f6780d80a 100644 --- a/packages/xo-server/docs/file-restoration.md +++ b/packages/xo-server/docs/file-restoration.md @@ -89,7 +89,7 @@ When logical volume no longer necessary: ``` > mkdir /tmp/block-mount -> mount --options=loop,ro,offset=$(($START * 512)),sizelimit=$(($SIZE)) --source=/tmp/vhd-mount/vhdi2 --target=/tmp/block-mount +> mount --options=loop,ro,norecovery,offset=$(($START * 512)),sizelimit=$(($SIZE)) --source=/tmp/vhd-mount/vhdi2 --target=/tmp/block-mount > ls /tmp/block-mount bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys @System.solv tmp usr var ```