0

When trying to unininstall cups from a linux machine some kind of "schrödingers file" was left behind: ls shows it, but otherwise its not there. System is ubuntu 17.10 / kernel 4.13, filesystem is BTRFS raid1 on 2 devices. Here's a shell snippet showing the problem:

root@kiney-desktop /root $ apt-get purge cups-daemon -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libarmadillo6 libdap17v5 libgdal1i libhdf5-10 liblwgeom-2.1.8 libossp-uuid16 libpoppler58 libproj9 libsane-hpaio libsuperlu4 python3-reportlab python3-reportlab-accel
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  cups-daemon*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 965513 files and directories currently installed.)
Purging configuration files for cups-daemon (2.2.4-7ubuntu3.1) ...
rm: cannot remove '/var/cache/cups': Directory not empty
dpkg: error processing package cups-daemon (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 cups-daemon
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@kiney-desktop /root $ cd /var/cache/cups/
root@kiney-desktop /var/cache/cups $ ls -lsha
ls: cannot access 'job.cache': No such file or directory
total 0
0 drwxrwx--- 1 root lp    18 Aug 14 19:39 .
0 drwxr-xr-x 1 root root 514 Jan 26  2018 ..
? -????????? ? ?    ?      ?            ? job.cache
root@kiney-desktop /var/cache/cups $ rm job.cache 
rm: cannot remove 'job.cache': No such file or directory
root@kiney-desktop /var/cache/cups $ stat job.cache 
stat: cannot stat 'job.cache': No such file or directory

"ls" on /var/cache/cups shows a file job.cache but no further info, just question marks. I cant delete or stat the file. I have readonly BTRFS snapshots of the filesystem from before trying to remove cups, they show the file the same way. So what's going on here? Is this a bug?

kiney
  • 1
  • 1
  • A few years ago I had a colleague who liked to use BTRFS - I see to recall it screwing up a few times like this. Have you tried a `btrfs check` or repair? – Tim Aug 14 '18 at 18:05
  • @varlogtim I run BTRFS on a few dozen systems. Basically its stable... but it definitely is less mature than e.g. ext4 that's why I mentioned it in the question. But good idea, i just started a "btrfs scrub". Unfortunately "btrfs check" only runs on unmounted filesystems, which I can't do at the moment. – kiney Aug 14 '18 at 18:10
  • btrfs scrub came out with 0 errors – kiney Aug 14 '18 at 19:08
  • What does `btrfs filesystem du -s /var/cache/cups/job.cache` say? How about `find /var/cache/cups` ? – rickhg12hs Aug 28 '18 at 18:42
  • @rickhg12hs `btrfs fi du -s /var/cache/cups/job.cache` `Total Exclusive Set shared Filename` `ERROR: cannot check space of '/var/cache/cups/job.cache': No such file or Directory` `btrfs fi du -s /var/cache/cups/job.cache Total Exclusive Set shared Filename ERROR: cannot check space of '/var/cache/cups/job.cache': No such file or directory` `btrfs fi du -s /var/cache/cups/job.cache Total Exclusive Set shared Filename ERROR: cannot check space of '/var/cache/cups/job.cache': No such file or directory` edit: formatting... still not what i wanted... – kiney Aug 29 '18 at 19:28
  • You can edit your original post to include more information. – rickhg12hs Aug 29 '18 at 20:04
  • What does `btrfs filesystem du /var/cache/cups` say? How about `find /var/cache/cups` ? – rickhg12hs Aug 29 '18 at 20:06

0 Answers0