Booting Into Snapshot: Read-Only File System

Hi all,

I need some help please because a pacman -Syu upgrade failed while the kernel was being installed (machine froze), and now cannot find the kernel when booting.

Ok, no problem, I will just boot from a BTRFS snapshot. But what I find is that the snapshot does boot, sort of, but only to a TTY. The problem is that the root partition is mounted read-only from the snapshot.

I searched the forum but no clues in there. I checked the grub entry for the snapshot but it doesn't seem to be instructing it to mount read-only. However every snapshot I've tried does only mount r/o.

Is there a way of changing the settings from live usb or something and telling it to mount as read-write when booting from a snapshot?

I managed to boot into it using a live-usb and chrooted into the install. I finished the pacman -Syu but on rebooting it still says the kernel cannot be found.

Thanks for any help.


sh-5.1# garuda-inxi
12System:
12Kernel 5.14.8-zen1-1-zen 12arch x86_64 12bits 64 12compiler gcc 12v 11.1.0
12parameters BOOT_IMAGE=/boot/vmlinuz-x86_64 lang=en_US keytable=us tz=UTC misobasedir=garuda
misolabel=GARUDA_DR460NIZED_HARPYEAGLE quiet systemd.show_status=1 driver=free
nouveau.modeset=1 i915.modeset=1 radeon.modeset=1
12Console N/A 12wm kwin_x11 12Distro Garuda Linux 12base Arch Linux
12Machine:
12Type Laptop 12System LENOVO 12product 20AMS5AN10 12v ThinkPad X240 12serial <filter> 12Chassis 12type 10
12serial <filter>
12Mobo LENOVO 12model 20AMS5AN10 12serial <filter> 12UEFI-[Legacy] LENOVO 12v GIET98WW (2.48 )
12date 08/08/2019
12Battery:
12ID-1 BAT1 12charge 28.2 Wh (100.0%) 12condition 28.2/47.5 Wh (59.4%) 12volts 12.3 12min 10.8
12model SMP 45N1736 12type Li-ion 12serial <filter> 12status full
12CPU:
12Info 12model Intel Core i5-4300U 12socket rPGA988B (U3E1) 12note check 12bits 64 12type MT MCP
12arch Haswell 12gen core 4 12built 2013-15 12process Intel 22nm 12family 6 12model-id 0x45 (69) 12stepping 1
12microcode 0x26
12Topology 12cpus 1x 12cores 2 12tpc 2 12threads 4 12smt enabled 12cache 12L1 128 KiB
12desc d-2x32 KiB; i-2x32 KiB 12L2 512 KiB 12desc 2x256 KiB 12L3 3 MiB 12desc 1x3 MiB
12Speed (MHz) 12avg 1980 12high 2236 12min/max 800/2900 12base/boost 1900/1900 12scaling
12driver intel_cpufreq 12governor performance 12volts 0.7 V 12ext-clock 100 MHz 12cores 121 1896 122 2236
123 1896 124 1895 12bogomips 19953
12Flags avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
12Vulnerabilities
12Type itlb_multihit 12status KVM: VMX disabled
12Type l1tf 12mitigation PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
12Type mds 12mitigation Clear CPU buffers; SMT vulnerable
12Type meltdown 12mitigation PTI
12Type spec_store_bypass 12mitigation Speculative Store Bypass disabled via prctl and seccomp
12Type spectre_v1 12mitigation usercopy/swapgs barriers and __user pointer sanitization
12Type spectre_v2
12mitigation Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling
12Type srbds 12mitigation Microcode
12Type tsx_async_abort 12status Not affected
12Graphics:
12Device-1 Intel Haswell-ULT Integrated Graphics 12vendor Lenovo ThinkPad X240 12driver i915 12v kernel
12arch Gen7.5 12process Intel 22nm 12built 2013 12ports 12active DP-4,eDP-1
12empty DP-1, DP-2, DP-3, DP-5, HDMI-A-1, HDMI-A-2 12bus-ID 00:02.0 12chip-ID 8086:0a16
12class-ID 0300
12Device-2 Chicony Integrated Camera 12type USB 12driver uvcvideo 12bus-ID 2-8:6 12chip-ID 04f2:b39a
12class-ID 0e02
12Display 12server X.org 12v 1.21.1.3 12with Xwayland 12v 22.1.2 12compositor kwin_x11 12driver 12X 12loadedN/A
12unloaded modesetting 12failed intel 12alternate fbdev,vesa 12gpu i915 12note  X driver n/a 12display-ID :0
12Monitor-1 DP-4 12model Samsung S23B300 12serial <filter> 12built 2012 12res 1920x1080 12dpi 96 12gamma 1.2
12size 510x287mm (20.08x11.3") 12diag 585mm (23") 12ratio 16:9 12modes 12max 1920x1080 12min 720x400
12Monitor-2 eDP-1 12model AU Optronics 0x106c 12built 2012 12res 1366x768 12dpi 126 12gamma 1.2
12size 276x155mm (10.87x6.1") 12diag 317mm (12.5") 12ratio 16:9 12modes 1366x768
12Message Unable to show GL data. Required tool glxinfo missing.
12Audio:
12Device-1 Intel Haswell-ULT HD Audio 12vendor Lenovo ThinkPad X240 12driver snd_hda_intel
12bus-ID 2-2:2 12v kernel 12bus-ID 00:03.0 12chip-ID 20b1:3008 12class-ID fe01 12chip-ID 8086:0a0c
12serial <filter> 12class-ID 0403
12Device-2 Intel 8 Series HD Audio 12vendor Lenovo ThinkPad X240 12driver snd_hda_intel 12v kernel
12bus-ID 00:1b.0 12chip-ID 8086:9c20 12class-ID 0403
12Device-3 XMOS iFi (by AMR) HD USB Audio 12type USB 12driver snd-usb-audio
12Sound Server-1 ALSA 12v k5.14.8-zen1-1-zen 12running yes
12Sound Server-2 PulseAudio 12v 16.0 12running no
12Sound Server-3 PipeWire 12v 0.3.52 12running yes
12Network:
12Device-1 Intel Ethernet I218-LM 12vendor Lenovo ThinkPad X240 12driver e1000e 12v kernel 12port 3080
12bus-ID 00:19.0 12chip-ID 8086:155a 12class-ID 0200
12IF enp0s25 12state down 12mac <filter>
12Device-2 Intel Wireless 7260 12driver iwlwifi 12v kernel 12pcie 12gen 1 12speed 2.5 GT/s 12lanes 1
12bus-ID 03:00.0 12chip-ID 8086:08b2 12class-ID 0280
12IF wlp3s0 12state up 12mac <filter>
12Bluetooth:
12Device-1 Intel Bluetooth wireless interface 12type USB 12driver btusb 12v 0.8 12bus-ID 2-7:4
12chip-ID 8087:07dc 12class-ID e001
12Report bt-adapter 12ID hci0 12rfk-id 1 12state up 12address N/A
12Drives:
12Local Storage 12total 4.16 TiB 12used 69.77 GiB (1.6%)
12SMART Message Required tool smartctl not installed. Check --recommends
12ID-1 /dev/sda 12maj-min 8:0 12vendor Netac 12model SSD 512GB 12size 476.94 GiB 12block-size
12physical 512 B 12logical 512 B 12speed 6.0 Gb/s 12type SSD 12serial <filter> 12rev 0326
12ID-2 /dev/sdb 12maj-min 8:16 12type USB 12model USB DISK 3.0 12size 57.7 GiB 12block-size 12physical 512 B
12logical 512 B 12type N/A 12serial <filter> 12rev PMAP
12ID-3 /dev/sdc 12maj-min 8:32 12type USB 12vendor Western Digital 12model WD My Passport 25E2
12size 3.64 TiB 12block-size 12physical 4096 B 12logical 512 B 12type N/A 12serial <filter> 12rev 4005
12Partition:
12ID-1 / 12raw-size 87.89 GiB 12size 87.89 GiB (100.00%) 12used 69.77 GiB (79.4%) 12fs btrfs
12block-size 4096 B 12dev /dev/sda7 12maj-min 8:7
12Swap:
12Kernel 12swappiness 133 (default 60) 12cache-pressure 100 (default)
12ID-1 swap-1 12type zram 12size 7.44 GiB 12used 174.2 MiB (2.3%) 12priority 100 12dev /dev/zram0
12Sensors:
12System Temperatures 12cpu 80.0 C 12mobo N/A
12Fan Speeds (RPM) 12fan-1 4934
12Info:
12Processes 229 12Uptime 11m 12wakeups 1 12Memory 7.44 GiB 12used 3.86 GiB (51.9%) 12Init systemd 12v 251
12default graphical 12tool systemctl 12Compilers 12gcc 12.1.0 12clang 13.0.1 12Packages 12pacman 1981 12lib 437
12flatpak 0 12Client 12inxi 3.3.18
Garuda (2.6.3-2):
System install date:     2022-06-16
Last full system update: 2022-06-16 ↻
Is partially upgraded:   No
Relevant software:       NetworkManager connman
Windows dual boot:       No/Undetected
Snapshots:               Snapper
Running in chroot, ignoring command 'list-units'
Failed units:

That's not a problem. You're supposed to restore the working snapshot and reboot.

I'm pretty sure a message pops up and tells you that? :thinking:

5 Likes

Start live USB and then load up BTRFS assistant. Go to "Snapper" tab, choose your system fs, then Backup/Restore, restore a snapshot from a day bedore you attempted an update.

Yes, normally, but as it is mounting the root partition as read-only, it does not fully boot into the desktop, only a console, with multiple error messages. So there is no way to restore the snapshot from there.

The problem is not that it is booting into the snapshot, the problem is that it is mounting the snapshot read-only and therefore cannot load the desktop (Gnome in this case) or show the message you are referring to.

Thanks, I see this is one way to do it, but I was wondering why the normal process of choosing a snapshot from the grub menu, booting into that and then choosing to restore it, is not working (due to it mounting the snapshot r/o instead of r/w.)

Are you sure there is a causal link here? Snapshots are intended to be read-only.

I'm not sure. But I do know it is failing to boot into the desktop from any snapshot and therefore not offering me the restore message.

1 Like

This is a very old kernel, even for a snapshot. Has this system not been updated in a long time?

The advised update method is:

garuda-update

This is especially true if your system is in trouble, like this one.

I think this is a good start. I would try installing another kernel while you are in there and see if you can get that to boot. chroot into the install, update:

garuda-update

Install another kernel (LTS is often a nice safe bet):

pacman -S linux-lts linux-lts-headers

Select "advanced" boot options on the grub screen to boot with the LTS kernel.

4 Likes

Could it be that maybe the partition in question is full?
I'd also recommend, once booted read-only to the snapshot, to take a look at the dmesg, looking (grep) for errors, and maybe the journal as well.
If possible, from the tty I would also try a full balance:

sudo btrfs filesystem balance start /

If no help, maybe also a sudo btrfs check and if necessary a --repair

2 Likes

Definately give a try with sudo btrfs check, with filesystem unmounted.

Your filesystem could have hit some weird bug and corrupted inodes or other stuff which then sends it to read-only in order to protect itself from being damaged more.
Happened to me twice, so just saying...

3 Likes

Thanks for the reply but no, plenty of space on the partition.

I will try the dmesg and the balance, thanks.

I was in the process of updating the system when the problem occurred - it was because the current kernel had been uninstalled in that update process, which then crashed the computer, that it wouldn't boot.

I will try installing the LTS kernel as a backup, thanks.

I did actually fix this issue by chrooting into the system using a live usb and reinstalling the kernel. But I'd love to know why it won't boot into the snapshots properly. It has the feature so I'd like to be able to use it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.