Fedora. Remove file containing dollar sign

Jevgeni Smirnov asked:

Cannot remove a file nor a directory containing it.

output of ls -la:

-????????? ? ?           ?                  ?            ? 1221036243.V905I191359M574755.domain.com:2$

UPDATE 1

[root@domain Maildir]# chmod -R 777 cur
chmod: cannot access `cur/1221036243.V905I191359M574755.domain.com:2$': No such file or directory

UPDATE 2

[root@domain Maildir]# rm -rf cur
rm: cannot remove `cur': Directory not empty

rm -rf 1221036243.V905I191359M574755.domain.com:2$
rm -rf 1221036243.V905I191359M574755.domain.com:2$

NO output at all.

UPDATE 3

[root@domain cur]# getfacl .
# file: .
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

UPDATE 4

[root@domain /]# umount backup
[root@domain /]# fsck /dev/md119
fsck from util-linux 2.19.1
e2fsck 1.41.14 (22-Dec-2010)
/dev/md119: clean, 1487811/183148544 files, 80994051/732566603 blocks
[root@domain /]# mount backup

UPDATE 5

[root@domain /]# fsck -f /dev/md119
fsck from util-linux 2.19.1
e2fsck 1.41.14 (22-Dec-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Problem in HTREE directory inode 180886324: block #10437 has bad min hash
Invalid HTREE directory inode 180886324 (/.snapshots/daily.2/h1/mailboxs/magazin/Maildir/cur).  Clear HTree index<y>? yes

Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/md119: ***** FILE SYSTEM WAS MODIFIED *****
/dev/md119: 1487811/183148544 files (0.1% non-contiguous), 80980327/732566603 blocks

And many thanks goes to Michael Hampton with his fsck -f /dev/md119.

My answer:


You need to run fsck with the -f option, to actually do the filesystem check.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.