ext3 filesystem which can't be corrected?
I have a ext3 filesystem which can't (?) be corrected with e2fsck - it shows files having the same inode, with the same names in the same directory.
e2fsck passes the check and does not find any errors (well, the first pass showed lots of errors). The filesystem is iSCSI-connected with commit=60 mount option, and initiator was brutally disconnected from the target several times.
However:
# cd /mnt/1/lost+found/
These are the directories I can't remove:
# ls #83363275/ #83378623/ #83379228/ #83379558/ #83380843/ #83380850/ #83380938/
# cd \#83378623/
Let's see what we have there - four files with exactly the same name and inode:
# ls -li total 16 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib
Let's remove "attrib" file:
# rm -f attrib
Ouch:
# ls ls: attrib: No such file or directory ls: attrib: No such file or directory ls: attrib: No such file or directory
When I want to browse the directory i.e. in midnight commander (mc), it shows me three files in red called "?attrib", dated 1 Jan 1970.
# cd / # umount /mnt/1 # mount /dev/sda /mnt/1 # cd /mnt/1/lost+found/#83378623/ # ls attrib attrib attrib # rm attrib rm: remove regular file `attrib'? y # ls ls: attrib: No such file or directory ls: attrib: No such file or directory
OK, mounting and unmounting just to delete one file is boring, so let's try it another way:
# ls ls: cannot access attrib: No such file or directory attrib # echo 3 > /proc/sys/vm/drop_caches # ls attrib # rm attrib rm: remove regular file `attrib'? y # ls #
e2fsck comes from e2fsprogs 1.39 - should I try something newer?
Signature · 2 lines
Tomasz Chmielewski http://wpkg.org
Quoted 17 lines · Tomasz Chmielewski
Let's see what we have there - four files with exactly the same name and inode:
# ls -li total 16 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attribLet's remove "attrib" file:
# rm -f attribOuch:
Quoted 7 lines
# ls ls: attrib: No such file or directory ls: attrib: No such file or directory ls: attrib: No such file or directoryWhen I want to browse the directory i.e. in midnight commander (mc), it shows me three files in red called "?attrib", dated 1 Jan 1970.
Looks like it has unprinting characters. Try
find . -print0 | xargs -0 rm
Quoted 1 line
e2fsck comes from e2fsprogs 1.39 - should I try something newer?
It is usually best to use the latest version.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
Quoted 22 lines · Andreas Dilger
Quoted 21 lines · Tomasz Chmielewski
Let's see what we have there - four files with exactly the same name and inode:
# ls -li total 16 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attrib 73793642 -rw-r----- 179 backuppc backuppc 46 May 14 2007 attribLet's remove "attrib" file:
# rm -f attribOuch:
# ls ls: attrib: No such file or directory ls: attrib: No such file or directory ls: attrib: No such file or directory
Quoted 4 lines
Quoted 1 line
When I want to browse the directory i.e. in midnight commander (mc), it shows me three files in red called "?attrib", dated 1 Jan 1970.
Looks like it has unprinting characters. Try
find . -print0 | xargs -0 rm
Nope, that's something else.
Several files in the same directory which had the same inode number and the same name.
Quoted 3 lines
Quoted 1 line
e2fsck comes from e2fsprogs 1.39 - should I try something newer?
It is usually best to use the latest version.
True, but the filesystem check takes 8 hours or so here, so I can't start it unless a disaster happens.
Signature · 2 lines
Tomasz Chmielewski http://wpkg.org