After power outage i have some corrupt directories on zfs.
rm -vfR
returns
Directory not empty.
zpool status -x
all pools are healthy
rm -vfR
returns
Directory not empty.
zpool status -x
all pools are healthy
Is the directory empty or not? Can you check the link count of the offending directory?rm -vfR
returns
Directory not empty.
ls -o
.I did this. It ended with,Code:zdb --checksum tank
Does that come up with anything related?
leaked space: vdev 2, offset 0x2d3fe18000, size 4096
space_map_iterate(sm, space_map_length(sm), iterate_through_spacemap_logs_cb, &uic) == 0 (0x61 == 0)
ASSERT at cmd/zdb/zdb.c:460:iterate_through_spacemap_logs()zsh: abort (core dumped) zdb --checksum ZT
chflags -Rv noschg *
rm -vfR *
zsh: sure you want to delete all 2 files in /test [yn]? y
rm: test1/Tools/scripts: Directory not empty
rm: test1/Tools: Directory not empty
rm: test1/audio/mous: Directory not empty
rm: test1/audio: Directory not empty
rm: test1: Directory not empty
rm: test3/4: Directory not empty
rm: test3/c/8: Directory not empty
rm: test3/c: Directory not empty
rm: test3: Directory not empty
?Do you have deduplication somewhere?
/bin/ls -al
ls: Makefile: No such file or directory
total 9
drwxr-xr-x 2 root wheel 3 10 dec. 22:14 .
drwxr-xr-x 3 root wheel 3 10 dec. 22:14 ..
It's looking a little grim. I'd be checking the state of the backups.Big question, what to do i now.
?Do you have deduplication somewhere?
I presume when you issued those two commands, you were in the directory /test, which is the parent directory of things like /test/test1/ and so on, right?Code:chflags -Rv noschg * rm -vfR * zsh: sure you want to delete all 2 files in /test [yn]? y rm: test1/Tools/scripts: Directory not empty rm: test1/Tools: Directory not empty rm: test1/audio/mous: Directory not empty rm: test1/audio: Directory not empty rm: test1: Directory not empty rm: test3/4: Directory not empty rm: test3/c/8: Directory not empty rm: test3/c: Directory not empty rm: test3: Directory not empty
Again, I presume you are in the directory with things that can't get deleted. And this output is actually interesting. To begin with, you used the -l switch on ls, which is good and bad. It's good, because it will tell us the attributes of the things in the directory. It is bad, because it forces ls to look up the attributes of things in this directory, which opens interesting new failure modes.Code:/bin/ls -al ls: Makefile: No such file or directory total 9 drwxr-xr-x 2 root wheel 3 10 dec. 22:14 . drwxr-xr-x 3 root wheel 3 10 dec. 22:14 ..
/bin/rm -vfR *
rm: test1/Tools/scripts: Directory not empty
rm: test1/Tools: Directory not empty
rm: test1/audio/mous: Directory not empty
rm: test1/audio: Directory not empty
rm: test1: Directory not empty
rm: test3/4: Directory not empty
rm: test3/c/8: Directory not empty
rm: test3/c: Directory not empty
rm: test3: Directory not empty
HOST:root: /jails/a/test #
Makefile
/bin/ls -al
ls: Makefile: No such file or directory
total 9
drwxr-xr-x 2 root wheel 3 10 dec. 22:14 .
drwxr-xr-x 3 root wheel 3 10 dec. 22:14 ..
.
./Makefile
rm: ./Makefile: No such file or directory
find . -type f -exec ls -lai {} \;
. Once you know that inode of Makefile you can do find . -xdev -inum $inum -exec rm {} \;
where $inum is the Makefile's inum. I purposely used . for the directory you want to remove that file from.mv test test2
mv: test/test1/Tools/scripts/getpatch.sh: No such file or directory
mv: test/test1/audio/mous/Makefile: No such file or directory
mv: test/test3/4/stats: No such file or directory
mv: /bin/cp test test2/test: terminated with 1 (non-zero) status
find: ./test1/Tools/scripts/getpatch.sh: No such file or directory
find: ./test1/audio/mous/Makefile: No such file or directory
find: ./test3/4/stats: No such file or directory
689291 1 drwxr-xr-x 5 root wheel 5 12 dec. 13:09 .
22941 1 drwxr-xr-x 3 root wheel 3 12 dec. 11:31 ./test1
463617 1 drwxr-xr-x 3 root wheel 3 10 dec. 22:14 ./test1/Tools
463620 1 drwxr-xr-x 2 root wheel 3 10 dec. 22:14 ./test1/Tools/scripts
find: ./test1/Tools/scripts/getpatch.sh: No such file or directory
462796 1 drwxr-xr-x 3 root wheel 3 12 dec. 03:59 ./uclcmd-0.1_3.pkg
462798 1 drwxr-xr-x 2 root wheel 3 12 dec. 13:08 ./uclcmd-0.1_3.pkg/1670813940
find: ./uclcmd-0.1_3.pkg/1670813940/pkg%arch: No such file or directory
833582 1 drwxr-xr-x 4 root wheel 4 10 dec. 22:11 ./test3
364953 1 drwxr-xr-x 2 root wheel 3 10 dec. 22:11 ./test3/4
find: ./test3/4/stats: No such file or directory
364854 1 drwxr-xr-x 3 root wheel 3 15 sep. 18:12 ./test3/c
367858 337 drwxr-xr-x 2 root wheel 3 15 sep. 18:12 ./test3/c/8