1

It must be one of the oddities I cannot understand, that using chromium browser, from time to time yields me an inode-less file named Preferences.

If I do this in the terminal:

$> ls -i ~/.config/chromium/Default/ | grep Preferences

I receive this output

ls: cannot access '~/.config/chromium/Default/Preferences': No such file or directory
       ? Preferences
10551098 Secure Preferences

The output shows on the first line that the file is not existing, yet it is still showing up as an entry of the directory on the second line. The third line only shows up because as it happens to be there is also the grep Preferences also filtered that entry.

The question, as stated in the title now is mainly: "how do I delete this directory entry"?

Some additional information: os/distro Current Arch Linux, filesystem: btrfs.

I have in the past booted from a live-usb thumb drive and run a btrfs check with the respective flags, that found the problem an resovled it. However right now I do not have such a drive ready. And therefore I would be most interested in different ways to clean a directory entry, that has no associated inode anymore.

Maybe btrfs can do this "online"?

1

Unfortunately, the only way to do this right now on BTRFS is offline with btrfs check. There has been some discussion in the past of adding provisions to handle this, but it's not really gone anywhere (at least, not publicly, I have no idea what any arbitrary developer might be working on).

However, there are a couple of somewhat more complicated alternatives to doing this offline with a USB drive, such as:

  1. If you're using both an initramfs and Systemd, you should be able to tell systemd to stop the boot process prior to mounting the real root filesystem and drop to a shell. Unfortunately I don't remember how to do this (I don't use systemd myself, so it never really comes up for me), but it may be the easiest option if you can figure it out, because this will give you a (mostly) complete environment for system recovery.
  2. It's generally possible to set up a local copy of a Live USB or Live CD system on your hard drive. This is the approach I take, extracting the relevant files from a SystemRescueCD ISO and dropping them in my boot partition (and in my case updating the bootloader with an entry, though if you use os-prober that should pick it up automatically). The exact set of files varies by Live system, but for SystemRescueCD you need one of the kernels, the initramfs image, sysrcd.dat, and sysrcd.md5.
  3. If you've got some time and the patience to keep it up to date, you can use Buildroot or similar tools to put together an image that is directly loadable by a bootloader and runs entirely from RAM, independent of the rest of your system. You can then bundle in whatever recovery tools you want (such as btrfs-progs), and boot that when you need to do things like this (this takes the most effort, but uses less space than option 2 and is more reliable than option 1).
  4. On some distros, you can just create a backup root partition pretty easily that contains the stuff you need to be able to fix the main one. THis can get really involved though, and it's not the easiest thing to keep up to date. Debian and Gentoo make this really easy however (Debian has tools for the initial setup, and can reliably run updates in a chroot, Gentoo is just trivial to do stuff like this with, and doesn't even need a chroot for updates (because you can point emerge at an arbitrary directory to treat as a root directory)).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.