Best method to remove / fix some dodgy files on BTRFS

Hi guys,

I have some dodgy / corrupt files / file system due to a program i was trying to run to overclock my gfx card which i suspect mishandled its files.

[timothyd@Endeavour .config]$ ls -la | grep tux
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
ls: cannot access 'tuxclocker.conf': No such file or directory
ls: cannot access 'tuxclocker.conf.lock': No such file or directory
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
-????????? ? ?        ?           ?            ? tuxclocker.conf.lock
[timothyd@Endeavour .config]$ rm tuxclocker.conf
tuxclocker.conf       tuxclocker.conf.lock  
[timothyd@Endeavour .config]$ rm tuxclocker.conf
tuxclocker.conf       tuxclocker.conf.lock  
[timothyd@Endeavour .config]$ rm tuxclocker.conf.lock 
rm: cannot remove 'tuxclocker.conf.lock': No such file or directory
[timothyd@Endeavour .config]$ 

btrfs scrub reports back fine. Whats the best way to resovle this?

The gnome file explorer cant see those files so something is off.

It say’s the files don’t exist?

indeed but ls shows “something”.

this is a snip of output from ls -la

drwxr-xr-x 1 timothyd timothyd   30 Nov 17 14:22  nautilus
drwxr-xr-x 1 timothyd timothyd   12 Nov 24 08:50  pamac
-rw-r--r-- 1 timothyd timothyd  109 Nov 21 09:45  pavucontrol.ini
drwxr-xr-x 1 timothyd timothyd   22 Nov 17 14:16  pop-shell
drwx------ 1 timothyd timothyd    0 Nov 17 14:16  procps
drwx------ 1 timothyd timothyd  988 Nov 17 14:16  pulse
-rw-r--r-- 1 timothyd timothyd    0 Nov 17 14:34  reflector-simple-free-params.txt
drwxr-xr-x 1 timothyd timothyd    8 Nov 17 14:08  systemd
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
-????????? ? ?        ?           ?            ?  tuxclocker.conf.lock
drwxr-xr-x 1 timothyd timothyd    0 Nov 17 14:16 'Unknown Organization'
-rw------- 1 timothyd timothyd  633 Nov 17 14:16  user-dirs.dirs
-rw-r--r-- 1 timothyd timothyd    5 Nov 17 14:16  user-dirs.locale
drwx------ 1 timothyd timothyd  840 Nov 17 14:16  VirtualBox
drwxr-xr-x 1 timothyd timothyd    0 Nov 17 14:16  whatsapp-for-linux
drwx------ 1 timothyd timothyd  684 Nov 24 13:18  whatsapp-nativefier-d40211
drwxr-xr-x 1 timothyd timothyd    0 Nov 17 14:16  yay
[timothyd@Endeavour .config]$ 


Are file permissions messed up?

i cant chown the files. Too all extents they dont exist and these are directory remnants of sorts. Many years ago you used to be able to do a form of edit on a directory but i dont want to brick my BTRFS after the memory debacle and im fairly sure thats probably not what needs to happen here.

Theyre not “doing harm”. it would be nice to figure out how to fix it tho.

First, I am assuming you have already tried rebooting?

Next run btrfs-check on the volume and report back if it finds any errors. Don’t pass it the --repair option unless you are 100% sure that errors are able to be repaired. The --repair option can render a filesystem completely unreadable if it is run in the wrong state.

Plenty of reboots yes.

Booted into EOS iso on usb stick and ran a check on the nvme i got:

Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p7
UUID: 618bc5b2-d681-4772-bf2a-2f828db3b5fc
found 206671380480 bytes used, error(s) found
total csum bytes: 199572836
total tree bytes: 1079312384
total fs tree bytes: 781025280
total extent tree bytes: 57802752
btree space waste bytes: 195591760
file data blocks allocated: 417718456320
 referenced 232369872896


root 577 inode 224562 errors 1, no inode item
	unresolved ref dir 261 index 235 namelen 20 name tuxclocker.conf.lock filetype 1 errors 5, no dir item, no inode ref
root 577 inode 224563 errors 1, no inode item
	unresolved ref dir 261 index 237 namelen 15 name tuxclocker.conf filetype 1 errors 5, no dir item, no inode ref
root 577 inode 224564 errors 1, no inode item

All errors were related to the problematic tux files.

There were a handful of errors like that.

What do you think is next @dalto ?

I don’t know the best path from here.

If it was my system, I would make a good backup of any important data and then run btrfs-check --repair

That being said, I don’t know enough about btrfs internals to tell you definitively that is the right path and --repair definitely has the potential to destroy data.

Thats what im thinking. DD the file system to somewhere as a backup and run a repair.

Im in no rush

Thx for input. I might find out where the btrfs experts / devs hang out and ask them.

1 Like