System is borked after resizing btrfs partition

garuda-inxi from a live session.

System:
Kernel: 5.16.16-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
parameters: BOOT_IMAGE=/boot/vmlinuz-x86_64 lang=en_US keytable=us tz=UTC
misobasedir=garuda misolabel=GARUDA_DR460NIZED_WHITETAILEDEAG quiet
systemd.show_status=1 driver=free nouveau.modeset=1 i915.modeset=1
radeon.modeset=1
Console: pty pts/0 wm: kwin_x11 DM: SDDM Distro: Garuda Linux
base: Arch Linux
Machine:
Type: Laptop System: LENOVO product: 81NB v: Lenovo IdeaPad S340-14API
serial: <filter> Chassis: type: 10 v: Lenovo IdeaPad S340-14API
serial: <filter>
Mobo: LENOVO model: LNVNB161216 v: SDK0Q55722 WIN serial: <filter>
UEFI: LENOVO v: AMCN29WW(V1.12) date: 01/27/2021
Battery:
ID-1: BAT1 charge: 53.0 Wh (100.0%) condition: 53.0/52.5 Wh (101.0%)
volts: 12.8 min: 11.3
model: 0x4C 0x47 0x43 0x00 0x32 0x30 0x 0x4C 0x31 0x38 0x33 0x50 0x5250
type: Li-ion serial: <filter> status: full cycles: 485
Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard
serial: <filter> charge: 50% (should be ignored) rechargeable: yes
status: N/A
CPU:
Info: model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx socket: FP5
bits: 64 type: MT MCP arch: Zen/Zen+ note: check family: 0x17 (23)
model-id: 0x18 (24) stepping: 1 microcode: 0x8108109
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 384 KiB desc: d-4x32 KiB; i-4x64 KiB L2: 2 MiB desc: 4x512 KiB
L3: 4 MiB desc: 1x4 MiB
Speed (MHz): avg: 1487 high: 2100 min/max: 1400/2100 boost: enabled
base/boost: 2100/3700 scaling: driver: acpi-cpufreq governor: schedutil
volts: 1.2 V ext-clock: 100 MHz cores: 1: 1400 2: 1400 3: 1400 4: 1400
5: 1400 6: 2100 7: 1400 8: 1400 bogomips: 33535
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities:
Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass
mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1
mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2
mitigation: Retpolines, IBPB: conditional, STIBP: disabled, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:
Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
vendor: Lenovo driver: amdgpu v: kernel pcie: gen: 3 speed: 8 GT/s
lanes: 16 ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 04:00.0
chip-ID: 1002:15d8 class-ID: 0300
Device-2: Syntek Integrated Camera type: USB driver: uvcvideo
bus-ID: 1-4:3 chip-ID: 174f:2426 class-ID: 0e02 serial: <filter>
Display: server: X.Org v: 1.21.1.3 compositor: kwin_x11 driver: X:
loaded: amdgpu unloaded: modesetting alternate: fbdev,vesa gpu: amdgpu
display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
s-diag: 582mm (22.93")
Monitor-1: eDP-1 mapped: eDP model: LG Display 0x05ec built: 2018
res: 1920x1080 hz: 60 dpi: 158 gamma: 1.2 size: 309x174mm (12.17x6.85")
diag: 355mm (14") ratio: 16:9 modes: max: 1920x1080 min: 640x480
OpenGL: renderer: AMD Radeon Vega 8 Graphics (RAVEN DRM 3.44.0
5.16.16-zen1-1-zen LLVM 13.0.1)
v: 4.6 Mesa 21.3.7 direct render: Yes
Audio:
Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Lenovo
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
bus-ID: 04:00.1 chip-ID: 1002:15de class-ID: 0403
Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo
driver: snd_pci_acp3x v: kernel
alternate: snd_rn_pci_acp3x,snd_pci_acp5x,snd_pci_acp6x pcie: gen: 3
speed: 8 GT/s lanes: 16 bus-ID: 04:00.5 chip-ID: 1022:15e2 class-ID: 0480
Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
bus-ID: 04:00.6 chip-ID: 1022:15e3 class-ID: 0403
Sound Server-1: ALSA v: k5.16.16-zen1-1-zen running: yes
Sound Server-2: PulseAudio v: 15.0 running: no
Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
Device-1: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter
vendor: Lenovo ThinkPad E595 driver: rtw_8822be v: N/A
modules: rtw88_8822be pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 2000
bus-ID: 02:00.0 chip-ID: 10ec:b822 class-ID: 0280
IF: wlp2s0 state: up mac: <filter>
Bluetooth:
Device-1: Realtek RTL8822BE Bluetooth 4.2 Adapter type: USB driver: btusb
v: 0.8 bus-ID: 3-2:2 chip-ID: 0bda:b023 class-ID: e001 serial: <filter>
Report: bt-adapter ID: hci0 rfk-id: 2 state: up address: <filter>
Drives:
Local Storage: total: 1.16 TiB used: 0 KiB (0.0%)
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Lenovo O.E.M.
model: RPFTJ256PDD2MWX size: 238.47 GiB block-size: physical: 512 B
logical: 512 B speed: 15.8 Gb/s lanes: 2 type: SSD serial: <filter>
rev: 11.9 temp: 39.9 C scheme: GPT
SMART: yes health: PASSED on: 27d 14h cycles: 2,764
read-units: 46,946,318 [24.0 TB] written-units: 33,669,357 [17.2 TB]
ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST1000LM035-1RK172
family: Mobile HDD size: 931.51 GiB block-size: physical: 4096 B
logical: 512 B sata: 3.1 speed: 6.0 Gb/s type: HDD rpm: 5400
serial: <filter> rev: LFM1 temp: 36 C scheme: GPT
SMART: yes state: enabled health: PASSED on: 166d 20h cycles: 2588
Old-Age: g-sense error rate: 141 Pre-Fail: attribute: Spin_Retry_Count
value: 100 worst: 100 threshold: 97
ID-3: /dev/sdb maj-min: 8:16 type: USB vendor: SanDisk
model: Cruzer Glide size: 14.91 GiB block-size: physical: 512 B
logical: 512 B type: N/A serial: <filter> rev: 1.27 scheme: MBR
SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
Message: No partition data found.
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 5.79 GiB used: 126 MiB (2.1%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 74.0 C
Fan Speeds (RPM): N/A
Info:
Processes: 260 Uptime: 1h 51m wakeups: 6 Memory: 5.79 GiB
used: 4.09 GiB (70.6%) Init: systemd v: 250 tool: systemctl Compilers:
gcc: 11.2.0 Packages: pacman: 1174 lib: 293 Shell: garuda-inxi (sudo)
default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.14
Garuda (2.5.6-2):
System install date:     2022-04-23
Last full system update: 2022-04-23 ↻
Is partially upgraded:   No
Relevant software:       NetworkManager
Windows dual boot:       Yes
Snapshots:               Snapper
Failed units:            snapper-cleanup.service```

Below are the complete details of what happened. I really need assistance and I need my data that are stored in the partition so I request help and clarity.

My linux btrfs partition had around 65gigs and I almost ran out of storage, I had 20 gigs of free space (above all linux partitions) , that I wanted to add and added it to the btrfs partition. My system was working fine, and after couple of shutting down and turning on(same day since didn't want to put it to sleep), kde popped up with "Couldn't write to .x" config-dotfiles, after a restart got the following error:

: :mounting '/dev/nvme0n1p7' on real root
[    3.105820] BTRFS: error (device nvme0n1p7) in btrfs_recover_log_trees:6553: errorno=-22 unknown
[    3.105889] BTRFS: error (device nvme0n1p7) in btrfs_reply_log:2529: error=-22 unknown (Failed to recover log tree)
mount: /new_root: wrong fs type, bad option, bad superblock on /dev/nvme0n1p7, missing codepage or helper program or other error.
dmesg(1) may have some more information after failed mount system call.

After this, booted into live usb and tried chroot & mount; neither worked, so asked help in the garuda TG chat as emergency

One of the members (Official group maintainer) replied

I got this error

It aborted and I got this output:

Was told to run again and similar thing happened

Some were suggesting to check ram(due to getting aborted), used memtestx86 and had no errors

I tried checking ssd with smartmontools this is what i get.

$ sudo smartctl --health /dev/nvme0n1

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.16.16-zen1-1-zen] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
$ sudo smartctl -d ata -H /dev/nvme0n1

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.16.16-zen1-1-zen] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Inappropriate ioctl for device

If this is a USB connected device, look at the various --device=TYPE variants
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
$ sudo smartctl -t long /dev/nvme0n1

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.16.16-zen1-1-zen] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

NVMe device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information
$ sudo smartctl -l selftest /dev/nvme0n1
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.16.16-zen1-1-zen] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

NVMe device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information
$ sudo smartctl -a /dev/nvme0n1
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-5.16.16-zen1-1-zen] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       RPFTJ256PDD2MWX
Serial Number:                      SS0R27339Z1CD04311J3
Firmware Version:                   11.9
PCI Vendor/Subsystem ID:            0x1cc4
IEEE OUI Identifier:                0x000000
Total NVM Capacity:                 256,060,514,304 [256 GB]
Unallocated NVM Capacity:           0
Controller ID:                      0
NVMe Version:                       1.2
Number of Namespaces:               1
Namespace 1 Size/Capacity:          256,060,514,304 [256 GB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Sat Apr 23 16:53:04 2022 UTC
Firmware Updates (0x12):            1 Slot, no Reset required
Optional Admin Commands (0x0007):   Security Format Frmw_DL
Optional NVM Commands (0x001e):     Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Log Page Attributes (0x04):         Ext_Get_Lg
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     90 Celsius
Critical Comp. Temp. Threshold:     94 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
0 +     3.00W       -        -    0  0  0  0        0       0
1 +     2.00W       -        -    1  1  1  1        0       0
2 +     2.00W       -        -    2  2  2  2        0       0
3 -   0.1000W       -        -    3  3  3  3     1000    1000
4 -   0.0050W       -        -    4  4  4  4     1000    5000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
0 +     512       0         1
1 -    4096       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        40 Celsius
Available Spare:                    100%
Available Spare Threshold:          50%
Percentage Used:                    11%
Data Units Read:                    46,946,314 [24.0 TB]
Data Units Written:                 33,669,357 [17.2 TB]
Host Read Commands:                 433,969,327
Host Write Commands:                395,607,401
Controller Busy Time:               651
Power Cycles:                       2,764
Power On Hours:                     662
Unsafe Shutdowns:                   249
Media and Data Integrity Errors:    0
Error Information Log Entries:      354
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 2:               40 Celsius

Error Information (NVMe Log 0x01, 16 of 16 entries)
Num   ErrCount  SQId   CmdId  Status  PELoc          LBA  NSID    VS
0        354     0  0x101d  0x0005      -            6     0     -
1        353     0  0x1009  0x0005      -            6     0     -
2        352     0  0x100d  0x0005      -            6     0     -
3        350     0  0x0015  0x0005      -            6     0     -
4        349     0  0x0005  0x0005      -            6     0     -
5        348     0  0x0019  0x0005      -            6     0     -
6        347     0  0x100d  0x0005      -            6     0     -
7        346     0  0x0009  0x0005      -            6     0     -
8        345     0  0x0019  0x0005      -            6     0     -
9        344     0  0x0001  0x0005      -            6     0     -
10        343     0  0x0011  0x0005      -            6     0     -
11        342     0  0x0015  0x0005      -            6     0     -
12        341     0  0x1011  0x0005      -            6     0     -
13        340     0  0x0005  0x0005      -            6     0     -
14        339     0  0x0001  0x0005      -            6     0     -
15        335     0  0x0009  0x0005      -            6     0     -

I've not booted into the garuda system since.

How did you realize it?

By the way, pictures of terminal inputs and outputs are not welcome here as in all technical help forums.
They are not searchable and sometimes not readable for some helpers.

4 Likes

I just decreased the size of windows a long time ago..

Should I remove the images??

You cant remove, you can only hide it from your post, so no.
It is just a hint for future posts :slight_smile:

But how you add it???

This could be the crux of the issue here. When you add space to a btrfs partition, you need to adjust the size of the filesystem as well. It isn't super straightforward since parted uses GB and btrfs filesystem resize uses GiB.

The best thing to do is set the btrfs filesystem to smaller than the final size, then fill the partition with btrfs filesystem resize max.

Try to mount the drive from the live session, shrink down the filesystem, and then expand it to the correct size again with this method.

1 Like

This issue wasn't anything to do with the resize process - OP used the system for several days and rebooted several times afterwards.

Something else has corrupted the filesystem, and that's where it currently is: toasted.

1 Like

Check out this thread here: [SOLVED] mount: /new_root: wrong fs type, bad option... (btrfs) / Newbie Corner / Arch Linux Forums

For this person, the problem appears to not have manifested until that part of the filesystem had to be accessed.

1 Like

If I'm reading it correctly, that thread is talking about a situation where the filesystem allocation was (somehow) larger than the partition. :thinking:

Btrfs weirdness! :exploding_head:

1 Like

No I didn't use it for several days, just 5 hours. The system borked after 5 hours and 3-4 boots. And my issue was could have been resolved by btrfs rescue zero-log and btrfs rescue superblock but as the dev suggested btrfs check --repair then the issue started.

I added it thru Live Usb Kde partition manager.

Now that btrfs check --repair has deleted most of the files... What could be done..?

@SGS @BluishHumility @jonathon
Do check this 1st and 2nd comment

This is most resembling to mine.

I used KDE partition manager.
What does kde partition manager use for resizing?
parted/gdisk/fdisk?

Do you have Windows on this device?

I've checked them. What are you asking me to look for, exactly?

Please forgive me if I'm mistaken, but when a partition is altered, doesn't that generate a new identifier (UUID in this case)?

I tend to get fuzzy(er) thinking without enough caffeine...

1 Like

I had a similar problem but I was inpatient and reinstalled my system. I was trying to resize my btrfs partition but I think the uuid must have changed and wasn't updated in the fstab which caused it not to boot.

Haven't read every post in this thread so apologies if this isn't related, but could the OP get the UUID of their Linux install via chroot and check it against their fstab and update as needed? Or is this a different problem with btrfs I'm not familiar with? Anyway good luck regardless what the issue is.

1 Like

I do have it as a backup, dual boot.

My error was also originally was the log tree and with btrfs rescue zero-log

My issue might've been fixed i guess..