public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Empty dir can't be removed ... because it's not empty?
@ 2012-01-10 20:26 Rafa Grimán
  2012-01-10 20:58 ` Markus Trippelsdorf
  2012-01-10 22:10 ` Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: Rafa Grimán @ 2012-01-10 20:26 UTC (permalink / raw)
  To: xfs-oss

Hi all :)

My /home is on an XFS partition all to it's own. The other day the lights went 
out and when I rebooted, there's an empty directory that can't be erased. This 
directory is a subdirectory in ~/.kde4/

The funny thing about this is that I can rename the directory, but I can't 
delete it:

[root@mine albumcovers]# ls
.  ..  cache

[root@mine albumcovers]# ls -lah cache/
total 0
drwx------ 1 rafa users  6 Jan 10 02:23 .
drwx------ 3 rafa users 18 Jan 10 02:23 ..

[root@mine albumcovers]# du -sh cache/
0       cache/

[root@mine albumcovers]# mount | grep -i home
/dev/sda3 on /home type xfs (rw,relatime,attr2,delaylog,noquota)

[root@mine albumcovers]# file cache/
cache/: directory

[root@mine albumcovers]# rm -Rf cache/
rm: cannot remove `cache': Directory not empty

[root@mine albumcovers]# mv cache other_dir_name

[root@mine albumcovers]# ls
.  ..  other_dir_name

[root@mine albumcovers]# rm -Rf other_dir_name/
rm: cannot remove `other_dir_name': Directory not empty

[root@mine albumcovers]# ls -lah other_dir_name/
total 0
drwx------ 1 rafa users  6 Jan 10 02:23 .
drwx------ 3 rafa users 27 Jan 10 21:14 ..

[root@mine albumcovers]# du -sh other_dir_name/
0       other_dir_name/

[root@mine albumcovers]#



Kernel version: 3.1.8-1-ARCH (Arch Linux)

XFS: xfsprogs 3.1.7-1



Any idea of what's going on?
Any tool I can use to understand what's happening?

TIA

   Rafa

-- 
"We cannot treat computers as Humans. Computers need love."

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty dir can't be removed ... because it's not empty?
  2012-01-10 20:26 Empty dir can't be removed ... because it's not empty? Rafa Grimán
@ 2012-01-10 20:58 ` Markus Trippelsdorf
  2012-01-10 22:10 ` Dave Chinner
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Trippelsdorf @ 2012-01-10 20:58 UTC (permalink / raw)
  To: Rafa Grimán; +Cc: xfs-oss

On 2012.01.10 at 21:26 +0100, Rafa Grimán wrote:
> Hi all :)
> 
> My /home is on an XFS partition all to it's own. The other day the lights went 
> out and when I rebooted, there's an empty directory that can't be erased. This 
> directory is a subdirectory in ~/.kde4/
> 
> The funny thing about this is that I can rename the directory, but I can't 
> delete it:
> 
> Any idea of what's going on?
> Any tool I can use to understand what's happening?

Try to run xfs_repair on that partition.

-- 
Markus

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty dir can't be removed ... because it's not empty?
  2012-01-10 20:26 Empty dir can't be removed ... because it's not empty? Rafa Grimán
  2012-01-10 20:58 ` Markus Trippelsdorf
@ 2012-01-10 22:10 ` Dave Chinner
  2012-01-11 18:28   ` Rafa Grimán
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2012-01-10 22:10 UTC (permalink / raw)
  To: Rafa Grimán; +Cc: xfs-oss

On Tue, Jan 10, 2012 at 09:26:35PM +0100, Rafa Grimán wrote:
> Hi all :)
> 
> My /home is on an XFS partition all to it's own. The other day the lights went 
> out and when I rebooted, there's an empty directory that can't be erased. This 
> directory is a subdirectory in ~/.kde4/

Is your system using barriers (i.e. mounting with nobarrier option,
or hardware that doesn't support FUA)? Directory corruption like
this on power failure is a classic sign of a voltile drive cache
being lost on power failure.

The output of dmesg from a system boot will tell us what hardware
you have...

> The funny thing about this is that I can rename the directory, but I can't 
> delete it:
> 
> [root@mine albumcovers]# ls
> .  ..  cache
> 
> [root@mine albumcovers]# ls -lah cache/
> total 0
> drwx------ 1 rafa users  6 Jan 10 02:23 .
> drwx------ 3 rafa users 18 Jan 10 02:23 ..
            ^^^

It's link count is 3, meaning that it thinks that there is an entry
in the directory. You need to run xfs_repair to fix it (and whatever
else is broken).

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty dir can't be removed ... because it's not empty?
  2012-01-10 22:10 ` Dave Chinner
@ 2012-01-11 18:28   ` Rafa Grimán
  0 siblings, 0 replies; 4+ messages in thread
From: Rafa Grimán @ 2012-01-11 18:28 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs-oss

Hi :)

On Tuesday, January 10, 2012 11:10 PM Dave Chinner wrote
> On Tue, Jan 10, 2012 at 09:26:35PM +0100, Rafa Grim�n wrote:
> > Hi all :)
> > 
> > My /home is on an XFS partition all to it's own. The other day the lights
> > went out and when I rebooted, there's an empty directory that can't be
> > erased. This directory is a subdirectory in ~/.kde4/
> 
> Is your system using barriers (i.e. mounting with nobarrier option,
> or hardware that doesn't support FUA)? Directory corruption like
> this on power failure is a classic sign of a voltile drive cache
> being lost on power failure.


Nope, no barriers. It's a single internal SATA drive. It's my personal PC at 
home so no fancy hardware :(


> The output of dmesg from a system boot will tell us what hardware
> you have...
> 
> > The funny thing about this is that I can rename the directory, but I
> > can't delete it:
> > 
> > [root@mine albumcovers]# ls
> > .  ..  cache
> > 
> > [root@mine albumcovers]# ls -lah cache/
> > total 0
> > drwx------ 1 rafa users  6 Jan 10 02:23 .
> > drwx------ 3 rafa users 18 Jan 10 02:23 ..
> 
>             ^^^
> 
> It's link count is 3, meaning that it thinks that there is an entry
> in the directory. You need to run xfs_repair to fix it (and whatever
> else is broken).


Thanks Dave and Markus. The thing is that when the lights came back on I ran 
an xfs_check first and got nothing (no errors). When I got the error mentioned 
above, I reran an xfs_check (no errors) and an xfs_repair but nothing seemed 
to be wrong. Yup, partition was unmounted ;)

Maybe I messed up typing the command or go figure, it was too late. That'll 
teach me to go to sleep at a decent time of the night ;)

In any case, I just wanted to know if maybe xfs_db or some other tool could 
come in handy. Can't do any more checks since I repartitioned my drive and 
reorganized my storage. Had backups, no data loss so it was more of a 
curiosity. Backups: can't live without them ;)

Thanks for your time !!

   Rafa

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-11 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 20:26 Empty dir can't be removed ... because it's not empty? Rafa Grimán
2012-01-10 20:58 ` Markus Trippelsdorf
2012-01-10 22:10 ` Dave Chinner
2012-01-11 18:28   ` Rafa Grimán

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox