Dropped into Emergency Shell - "errno=-17 Object already exists"

For the last two days, I've been unable to fully start up my Garuda PC. After an otherwise uneventful and normal seeming restart, I was dumped into an emergency shell, and have been unable to boot into the desktop proper. As I'm not able to upload a screenshot or photo of what appeared on the emergency shell, I've manually transcribed the full output of what I tried while attempting a solution that worked for a similar, but different drive mount issue.

setfont: KDFONTOP: Function not implemented
mount: /new_root: mount(2) system call failed: File exists.
dmesg(1) may have more information after failed mount system call.
You are now being dropped into an emergency shell.
sh: can't access tty; job control turned off
[rootfs ]# cd usr
[rootfs usr]# cd
[rootfs ]# cd home
sh: cd: can't cd to home: No such file or directory
[rootfs ]# mount /dev/sdc1 new_root
mount: /new_root: unknown filesystem type 'iso9660'.
dmesg(1) may have more information after failed mount system call.
[rootfs ]# mount /dev/sdc2 new_root
mount: /new_root: unknown filesystem type 'vfat'.
dmesg(1) may have more information after failed mount system call.
[rootfs ]# mount /dev/sdb1 new_root
[ 231.423686] BRTFS: error (device sdb1: state A) in _btrfs_run_delayed_items:1088: errno=-17 Object already exists
[ 231.423862] BTRFS: error (device sdb1: state EA) in btrfs_replay_log:2356: errno=-17 Object already exists (Failed to recover log tree)
mount: /new_root: mount(2) system call failed: File exists.
dmesg(1) may have more information after failed mount system call.
[rootfs ]#

Reading the dmesg, while booted into my installation media flash drive, outputs this:

[ 6853.025590] BTRFS: Transaction aborted (error -17)
[ 6853.025626] WARNING: CPU: 8 PID: 9421 at fs/btrfs/delayed-inode.c:1088 __btrfs_run_delayed_items+0x16f/0x270 [btrfs]
[ 6853.025702] Modules linked in: ufs hfsplus hfs minix vfat msdos fat jfs xfs ext4 crc16 mbcache jbd2 snd_seq_dummy snd_hrtimer snd_seq snd_seq_device sg st rfkill sr_mod qrtr ns intel_rapl_msr intel_rapl_common snd_hda_codec_realtek ucsi_ccg snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi typec_ucsi edac_mce_amd snd_hda_intel typec snd_intel_dspcfg roles kvm_amd snd_intel_sdw_acpi kvm snd_hda_codec irqbypass wmi_bmof snd_hda_core crct10dif_pclmul snd_hwdep snd_pcm ccp snd_timer snd mousedev joydev soundcore ghash_clmulni_intel rng_core sp5100_tco i2c_nvidia_gpu i2c_piix4 rapl gpio_amdpt k10temp mac_hid gpio_generic pinctrl_amd acpi_cpufreq uinput crypto_user fuse zram bpf_preload ip_tables x_tables overlay squashfs isofs cdrom uas usb_storage usbhid btrfs blake2b_generic xor raid6_pq libcrc32c crc32c_generic crc32_pclmul crc32c_intel aesni_intel r8169 crypto_simd realtek mdio_devres cryptd xhci_pci libphy xhci_pci_renesas dm_snapshot dm_bufio dm_mod loop nouveau mxm_wmi wmi video
[ 6853.025777]  drm_ttm_helper ttm
[ 6853.025780] CPU: 8 PID: 9421 Comm: mount Tainted: G        W         5.15.74-1-lts #1 c059c1807053d13436aba0757c9a4f8a4ad32094
[ 6853.025785] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./AB350 Gaming K4, BIOS P2.40 04/10/2017
[ 6853.025787] RIP: 0010:__btrfs_run_delayed_items+0x16f/0x270 [btrfs]
[ 6853.025850] Code: 48 0f ba 2a 03 72 25 41 83 ff fb 0f 84 06 01 00 00 41 83 ff e2 0f 84 fc 00 00 00 44 89 fe 48 c7 c7 b0 76 7f c0 e8 7a 64 37 e4 <0f> 0b 44 89 f9 ba 40 04 00 00 48 c7 c6 b0 84 7e c0 4c 89 e7 e8 a9
[ 6853.025853] RSP: 0018:ffffac8ed689b748 EFLAGS: 00010286
[ 6853.025856] RAX: 0000000000000000 RBX: ffff9f96fa29fed0 RCX: 0000000000000027
[ 6853.025858] RDX: ffff9f9d3f0206e8 RSI: 0000000000000001 RDI: ffff9f9d3f0206e0
[ 6853.025859] RBP: ffff9f96fa29fe78 R08: 0000000000000000 R09: ffffac8ed689b558
[ 6853.025861] R10: ffffac8ed689b550 R11: 0000000000000003 R12: ffff9f9654a9ff50
[ 6853.025862] R13: ffff9f9742facbd0 R14: ffff9f9668aa4800 R15: 00000000ffffffef
[ 6853.025864] FS:  00007f274fc5db80(0000) GS:ffff9f9d3f000000(0000) knlGS:0000000000000000
[ 6853.025866] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6853.025868] CR2: 00007f5f438782a0 CR3: 0000000123254000 CR4: 00000000003506e0
[ 6853.025870] Call Trace:
[ 6853.025873]  <TASK>
[ 6853.025876]  drop_one_dir_item+0x14d/0x160 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.025939]  add_inode_ref+0x884/0x11b0 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026002]  replay_one_buffer+0x171/0x4f0 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026063]  ? find_extent_buffer+0x54/0x90 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026120]  ? alloc_extent_buffer+0x7e/0x6c0 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026178]  walk_down_log_tree+0x199/0x3a0 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026239]  walk_log_tree+0xdc/0x200 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026299]  btrfs_recover_log_trees+0x1d1/0x3e0 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026360]  ? replay_one_extent+0x790/0x790 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026420]  open_ctree+0x141f/0x169c [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026485]  btrfs_mount_root.cold+0xe/0xad [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026556]  legacy_get_tree+0x27/0x50
[ 6853.026562]  vfs_get_tree+0x25/0xc0
[ 6853.026567]  vfs_kern_mount.part.0+0x73/0xb0
[ 6853.026571]  btrfs_mount+0x168/0x420 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026627]  ? vfs_parse_fs_param_source+0x1c/0x90
[ 6853.026632]  ? legacy_get_tree+0x27/0x50
[ 6853.026635]  ? btrfs_show_options+0x640/0x640 [btrfs d5ac4552346f4531b80696df917ac71a8b95c788]
[ 6853.026690]  legacy_get_tree+0x27/0x50
[ 6853.026694]  vfs_get_tree+0x25/0xc0
[ 6853.026698]  path_mount+0x46a/0xa40
[ 6853.026702]  __x64_sys_mount+0x116/0x150
[ 6853.026706]  do_syscall_64+0x5b/0x80
[ 6853.026712]  ? syscall_exit_to_user_mode+0x23/0x50
[ 6853.026715]  ? do_syscall_64+0x67/0x80
[ 6853.026719]  ? syscall_exit_to_user_mode+0x23/0x50
[ 6853.026721]  ? do_syscall_64+0x67/0x80
[ 6853.026725]  ? do_syscall_64+0x67/0x80
[ 6853.026728]  ? syscall_exit_to_user_mode+0x23/0x50
[ 6853.026731]  ? do_syscall_64+0x67/0x80
[ 6853.026735]  entry_SYSCALL_64_after_hwframe+0x61/0xcb
[ 6853.026739] RIP: 0033:0x7f274fda0fce
[ 6853.026742] Code: 48 8b 0d bd ed 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 8a ed 0c 00 f7 d8 64 89 01 48
[ 6853.026745] RSP: 002b:00007ffffaec2a38 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
[ 6853.026748] RAX: ffffffffffffffda RBX: 000056212dede3a0 RCX: 00007f274fda0fce
[ 6853.026749] RDX: 000056212dede730 RSI: 000056212dede750 RDI: 000056212dede800
[ 6853.026751] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000073
[ 6853.026753] R10: 0000000000000000 R11: 0000000000000246 R12: 000056212dede800
[ 6853.026754] R13: 000056212dede730 R14: 00000000ffffffff R15: 00007f274feb4076
[ 6853.026758]  </TASK>
[ 6853.026759] ---[ end trace cacebc82dded2076 ]---
[ 6853.026762] BTRFS: error (device sdb1) in __btrfs_run_delayed_items:1088: errno=-17 Object already exists
[ 6853.026777] BTRFS: error (device sdb1) in btrfs_replay_log:2356: errno=-17 Object already exists (Failed to recover log tree)
[ 6853.050142] BTRFS error (device sdb1): open_ctree failed

Here is my garuda-inxi in text, as requested:

[root@garuda-xfce /]# garuda-inxi 
12System:
  12Kernel 5.15.74-1-lts 12arch x86_64 12bits 64 12compiler gcc 12v 12.2.0
    12parameters BOOT_IMAGE=/boot/vmlinuz-x86_64 lang=en_US keytable=us tz=UTC misobasedir=garuda
    misolabel=GARUDA_XFCE_TALON quiet systemd.show_status=1 ibt=off
    systemd.unified_cgroup_hierarchy=1 driver=free nouveau.modeset=1 i915.modeset=1
    radeon.modeset=1
  12Console N/A 12Distro Garuda Linux 12base Arch Linux
12Machine:
  12Type Desktop 12Mobo ASRock 12model AB350 Gaming K4 12serial <filter> 12UEFI-[Legacy] American Megatrends
    12v P2.40 12date 04/10/2017
12CPU:
  12Info 12model AMD Ryzen 5 1600X 12socket AM4 12bits 64 12type MT MCP 12arch Zen 12level v3 12note check
    12built 2017-19 12process GF 14nm 12family 0x17 (23) 12model-id 1 12stepping 1 12microcode 0x800111C
  12Topology 12cpus 1x 12cores 6 12tpc 2 12threads 12 12smt enabled 12cache 12L1 576 KiB
    12desc d-6x32 KiB; i-6x64 KiB 12L2 3 MiB 12desc 6x512 KiB 12L3 16 MiB 12desc 2x8 MiB
  12Speed (MHz) 12avg 2433 12high 3600 12min/max 2200/3600 12boost enabled 12base/boost 3600/4100 12scaling
    12driver acpi-cpufreq 12governor schedutil 12volts 1.4 V 12ext-clock 100 MHz 12cores 121 2200 122 2200 123 2200
    124 2200 125 3600 126 2200 127 2200 128 2200 129 3600 1210 2200 1211 2200 1212 2200 12bogomips 86234
  12Flags avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  12Vulnerabilities
  12Type itlb_multihit 12status Not affected
  12Type l1tf 12status Not affected
  12Type mds 12status Not affected
  12Type meltdown 12status Not affected
  12Type mmio_stale_data 12status Not affected
  12Type retbleed 12mitigation untrained return thunk; SMT vulnerable
  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 Retpolines, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected
  12Type srbds 12status Not affected
  12Type tsx_async_abort 12status Not affected
12Graphics:
  12Device-1 NVIDIA TU104 [GeForce RTX 2070 SUPER] 12vendor Micro-Star MSI 12driver nouveau 12v kernel
    12non-free 520.xx+ 12status current (as of 2022-10) 12arch Turing 12code TUxxx 12process TSMC 12nm
    12built 2018-22 12pcie 12gen 1 12speed 2.5 GT/s 12lanes 16 12link-max 12gen 3 12speed 8 GT/s 12ports
    12active DP-1,HDMI-A-1 12empty DP-2,DP-3 12bus-ID 0b:00.0 12chip-ID 10de:1e84 12class-ID 0300 12temp 40.0 C
  12Display 12server X.org 12v 1.21.1.4 12with Xwayland 12v 22.1.5 12compositor xfwm 12driver 12gpu nouveau
    12note X driver n/a 12tty 80x40
  12Monitor-1 DP-1 12model HP VH240a 12serial <filter> 12built 2018 12res 1920x1080 12dpi 93 12gamma 1.2
    12size 527x296mm (20.75x11.65") 12diag 604mm (23.8") 12ratio 16:9 12modes 12max 1920x1080 12min 720x400
  12Monitor-2 HDMI-A-1 12model HP VH240a 12serial <filter> 12built 2017 12res 1920x1080 12dpi 93 12gamma 1.2
    12size 527x296mm (20.75x11.65") 12diag 604mm (23.8") 12ratio 16:9 12modes 12max 1920x1080 12min 720x400
  12API OpenGL 12Message GL data unavailable in console and glxinfo missing.
12Audio:
  12Device-1 NVIDIA TU104 HD Audio 12vendor Micro-Star MSI 12driver snd_hda_intel 12v kernel 12pcie 12gen 1
    12speed 2.5 GT/s 12lanes 16 12link-max 12gen 3 12speed 8 GT/s 12bus-ID 0b:00.1 12chip-ID 10de:10f8
    12class-ID 0403
  12Device-2 AMD Family 17h HD Audio 12vendor ASRock 12driver snd_hda_intel 12v kernel 12pcie 12gen 3
    12speed 8 GT/s 12lanes 16 12bus-ID 12:00.3 12chip-ID 1022:1457 12class-ID 0403
  12Sound API ALSA 12v k5.15.74-1-lts 12running yes
  12Sound Interface sndio 12v N/A 12running no
  12Sound Server-1 PulseAudio 12v 16.1 12running no
  12Sound Server-2 PipeWire 12v 0.3.61 12running yes
12Network:
  12Device-1 Intel 12driver N/A 12pcie 12gen 2 12speed 5 GT/s 12lanes 1 12port N/A 12bus-ID 07:00.0
    12chip-ID 8086:093c 12class-ID 0280
  12Device-2 Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 12vendor ASRock 12driver r8169
    12v kernel 12pcie 12gen 1 12speed 2.5 GT/s 12lanes 1 12port d000 12bus-ID 0a:00.0 12chip-ID 10ec:8168
    12class-ID 0200
  12IF enp10s0 12state up 12speed 1000 Mbps 12duplex full 12mac <filter>
12Drives:
  12Local Storage 12total 2.3 TiB 12used 20.31 GiB (0.9%)
  12SMART Message Required tool smartctl not installed. Check --recommends
  12ID-1 /dev/sda 12maj-min 8:0 12vendor Samsung 12model MZHPV512HDGL-000H1 12size 476.94 GiB 12block-size
    12physical 512 B 12logical 512 B 12speed 6.0 Gb/s 12type N/A 12serial <filter> 12rev 4H0Q
  12ID-2 /dev/sdb 12maj-min 8:16 12vendor Seagate 12model ST2000DM006-2DM164 12size 1.82 TiB 12block-size
    12physical 4096 B 12logical 512 B 12speed 6.0 Gb/s 12type N/A 12serial <filter> 12rev CC26
  12ID-3 /dev/sdc 12maj-min 8:32 12type USB 12vendor PNY 12model USB 2.0 FD 12size 15.12 GiB 12block-size
    12physical 512 B 12logical 512 B 12type N/A 12serial <filter> 12rev 1100
12Partition:
  12ID-1 / 12raw-size 476.93 GiB 12size 476.93 GiB (100.00%) 12used 20.31 GiB (4.3%) 12fs btrfs
    12block-size 4096 B 12dev /dev/sda1 12maj-min 8:1
  12ID-2 /home 12raw-size 476.93 GiB 12size 476.93 GiB (100.00%) 12used 20.31 GiB (4.3%) 12fs btrfs
    12block-size 4096 B 12dev /dev/sda1 12maj-min 8:1
  12ID-3 /var/log 12raw-size 476.93 GiB 12size 476.93 GiB (100.00%) 12used 20.31 GiB (4.3%) 12fs btrfs
    12block-size 4096 B 12dev /dev/sda1 12maj-min 8:1
  12ID-4 /var/tmp 12raw-size 476.93 GiB 12size 476.93 GiB (100.00%) 12used 20.31 GiB (4.3%) 12fs btrfs
    12block-size 4096 B 12dev /dev/sda1 12maj-min 8:1
12Swap:
  12Kernel 12swappiness 133 (default 60) 12cache-pressure 100 (default)
  12ID-1 swap-1 12type zram 12size 31.3 GiB 12used 0 KiB (0.0%) 12priority 100 12dev /dev/zram0
12Sensors:
  12System Temperatures 12cpu 32.9 C 12mobo N/A 12gpu nouveau 12temp 40.0 C
  12Fan Speeds (RPM) N/A 12gpu nouveau 12fan 0
12Info:
  12Processes 314 12Uptime 1h 54m 12wakeups 0 12Memory 31.3 GiB 12used 2.54 GiB (8.1%) 12Init systemd 12v 252
  12default graphical 12tool systemctl 12Compilers 12gcc 12.2.0 12Packages 12pm pacman 12pkgs 1311 12libs 423
  12tools pamac,paru 12Client Unknown Client: rcu_tasks_rude_ 12inxi 3.3.23
Garuda (2.6.10-1):
  System install date:     2022-12-06
  Last full system update: 2022-12-06
  Is partially upgraded:   No
  Relevant software:       NetworkManager connman
  Windows dual boot:       No/Undetected
  Snapshots:               Snapper
Running in chroot, ignoring command 'list-units'
  Failed units:            

I've attempted to run fsck at the recommendation of another user, but have not been able to figure out how to run it myself on the specific drive in question. Any help in trying to solve this issue would be appreciated, as I've tried everything I can think of and this issue seems to be preventing me from performing any operation on the drive as far as I've been able to see.

Really, ideally, I'd like to be able to return to normal operation, but at bare minimum, I need to be able to salvage the data in the drive, which I can't find a single way to load and open.

I saw a similar issue on another forum a few months ago: BTRFS: File system unmountable, no boot and access possible - Newbie - EndeavourOS

The solution ended up being to clear the filesystem log tree using btrfs rescue zero-log <device>.

According to the documentation here, it is less common to need this command than in years past, but your stack trace above seems to fit the bill:

“If the errors are like above, then zero-log should be used to clear the log and the filesystem may be mounted normally again. The keywords to look for are ‘open_ctree’ which says that it’s during mount and function names that contain replay, recover or log_tree.”

You have all of those keywords in your output above, so it may be worth a shot.

:warning: Note: the documentation does advise you can lose up to 30 seconds of filesystem activity since the last transaction commit by running this command.

From the live environment, check the Btrfs device with lsblk or similar, then:

btrfs rescue zero-log /dev/<your device>
5 Likes

I see btrfs errors for sdb1.
Maybe you could try from the live USB

sudo btrfs check /dev/sdb1

And in case of errors you could repeat with --repair
Can't you access and save your data from the live USB?
Backups...?

3 Likes

Thank you both for the suggestions!

Re: Filo - I only have so much backed up. Honestly I really should have more, but time has simply not permitted me to get everything set up the way I like. Unfortunate, but what can you do.

The live environment, run off my installation media stick, runs into the same problem every time I try to mount and access the original environments' drive, just as a pop up window instead of a text dump. That same "erno=-17" message. Running the btrfs check came back "no error found." Not sure if that's a good thing given the circumstances?

Re: Bluish - Just tried it, got a message stating that it cleared the log on that device, and I think that did it! I'm now able to mount and open the drive in the live environment! 30 seconds of potential data loss seems like a very small price to pay for what I just got back so honestly, I'm glad I took the risk on it.

Again, thank you both so much for a very fast and helpful pair of replies.

3 Likes

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