#3662 Issue open: Support immutable servers¶
Labels: enhancement
svlv opened issue at 2026-11-04 13:17:¶
During recovery, ReaR mounts filesystems using their original mount options.
Therefore, if a filesystem was originally mounted with the read-only
flag, it will also be mounted as read-only during recovery.
This will prevent files and directories from being written to that
filesystems.
For example, the recently
released openSUSE
Leap 16.1
supports the so-called Immutable mode,
in which the root filesystem is mounted as read-only:
findmnt -o TARGET,FSTYPE,OPTIONS /
TARGET FSTYPE OPTIONS
/ btrfs ro,relatime,seclabel,discard=async,space_cache=v2,subvolid=274,subvol=/@/.snapshots/4/snapshot
During recovery, the filesystem is also mounted with the ro flag.
Excerpt from diskrestore.sh:
LogPrint "Mounting filesystem /"
mkdir -p /mnt/local/
mount -t btrfs -o ro,relatime,discard=async,space_cache=v2 /dev/sda3 /mnt/local/
# SLES12-SP1 (and later) btrfs subvolumes setup needed for /dev/sda3 (default subvolume path contains '@/.snapshots/')
# Creating normal btrfs subvolume @ on /dev/sda3 at /
btrfs subvolume create /mnt/local//@
However, the btrfs subvolume create command fails because the
filesystem is mounted as read-only:
btrfs subvolume create /mnt/local//@
ERROR: Could not create subvolume: Read-only file system
In other words, mounting a filesystem as read-only prevents the system
from being recovered properly.
I believe this issue affects all systems with read-only filesystems, not
just those using the read-only Btrfs root.
Shouldn't ReaR always mount filesystems as read-write during recovery, regardless of whether they were mounted as read-only on the original system?
jsmeix commented at 2026-11-04 13:58:¶
Offhandedly I agree because it looks obvious,
but I would like to sleep on it...
On the one hand
ReaR should mount filesystems as rw
when needed during recovery,
in particular to restore files from the backup
but also for adjustments in the restored files
(e.g. via finalize/.../...migrate... scripts)
and to reinstall the bootloader and so on
BUT
on the other hand
ReaR must ensure that ro mounted filesystems
get mounted ro when the recreated system boots.
[Export of Github issue for rear/rear.]