Hi everyone,
I’m currently using openSUSE Leap Micro 6.1 in a homelab environment on a physical Intel NUC with Btrfs as the root filesystem. My setup is as follows:
- 2× disks:
/dev/sda
and/dev/sdb
/dev/sd[a|b]2
: EFI system partitions (FAT16)/dev/sd[a|b]3
: Btrfs root- EFI partitions are manually synchronized via
rsync
after kernel/GRUB updates - Btrfs is configured in RAID1 for metadata and data between
sda3
andsdb3
I’m simulating a disk failure recovery in virtual environment:
- I removed the primary disk (/dev/vda)
- Replaced it with a fresh disk
- Boot from live image
- Cloned partition layout from /dev/vdb using sfdisk
- Created new EFI FS and rsync-ed contents
- Re-added /dev/vda3 to the Btrfs RAID with btrfs replace
All of that works great, but since EFI partition’s UUID has changed I need to update /etc/fstab
accordingly, but I can’t edit that file due to read-only rootfs.
After mounting the restored Btrfs RAID1 system with:
mkdir -p /mnt/btrfs
mount -o degraded /dev/sdb3 /mnt/btrfs
…the system remains read-only. Trying to directly edit /mnt/btrfs/etc/fstab
with vim fails
So I attempted a chroot
into the mounted snapshot:
chroot /mnt/btrfs
But inside the chroot, every command referencing /dev/null fails:
bash: /dev/null: Read-only file system
Attempting to use sed inside the chroot to update the EFI UUID:
sed -i 's/4457-FEA0/DED9-DB0B/g' /etc/fstab
sed: couldn't open temporary file /etc/sedsThOpV: Read-only file system
Lastly, I tried launching transactional-update shell from within the chroot:
transactional-update shell
Which resulted in:
/sbin/transactional-update: line 1133: /dev/fd/63: No such file or directory
/sbin/transactional-update: line 221: /var/run/transactional-update.pid.4251: No such file or directory
/sbin/transactional-update: line 222: /dev/null: Read-only file system
tee: /var/log/transactional-update.log: Read-only file system
head: cannot open '/var/run/transactional-update.pid' for reading: No such file or directory
/sbin/transactional-update: line 230: /dev/null: Read-only file system
/sbin/transactional-update: line 201: /var/log/transactional-update.log: Read-only file system
Couldn't get lock, is another instance already running?
So the general question is how can I update /etc/fstab
on an openSUSE Leap Micro installation from an external live system (e.g. openSUSE Tumbleweed Live), after replacing a disk and needing to fix the EFI partition UUID?
General output from lsblk
command:
lsblk -o NAME,LABEL,PARTLABEL,UUID,PARTUUID,PARTTYPE,FSTYPE,MOUNTPOINTS
NAME LABEL PARTLABEL UUID PARTUUID PARTTYPE FSTYPE MOUNTPOINTS
vda
├─vda1 p.legacy ddac82a9-70a7-480b-b449-673ac863c308 21686148-6449-6e6f-744e-656564454649
├─vda2 EFI p.UEFI 4457-FEA0 4b3db800-1f38-4c2e-a316-01eed205c0c0 c12a7328-f81f-11d2-ba4b-00a0c93ec93b vfat /boot/efi
└─vda3 ROOT p.lxroot ebce2217-3184-4274-a920-76235395dc52 fc492be2-0a62-45d9-a8e6-62ecdde75673 0fc63daf-8483-4772-8e79-3d69d8477de4 btrfs /usr/local
/srv
/boot/writable
/opt
/home
/boot/grub2/i386-pc
/boot/grub2/x86_64-efi
/.snapshots
/var
/root
/
vdb
├─vdb1 p.legacy ddac82a9-70a7-480b-b449-673ac863c308 21686148-6449-6e6f-744e-656564454649
├─vdb2 EFI p.UEFI 5555-066A 4b3db800-1f38-4c2e-a316-01eed205c0c0 c12a7328-f81f-11d2-ba4b-00a0c93ec93b vfat
└─vdb3 ROOT p.lxroot ebce2217-3184-4274-a920-76235395dc52 fc492be2-0a62-45d9-a8e6-62ecdde75673 0fc63daf-8483-4772-8e79-3d69d8477de4 btrfs