LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-04-2014, 11:37 AM   #1
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,352

Rep: Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925
Can't delete a directory on 14.1 32 bit - size files appears wrong


As the title says, I have a directory I can not delete. When I run rmdir, the system reports the directory is not empty.

I can change into the directory, but can not list any files. If I do a simple ls command, disk I/O starts up, and nothing is ever displayed. I have let the disk thrash for over 15 minutes, nothing ever displays.

I tried a 'rm -f *' in the directory, the disk thrashes endlessly, nothing changes, I still can't ls anything.

The one thing that appears wrong, if I run ls outside the directory one level, the dir listing is there, but the size field is huge. Here is what I see:

Quote:
ls
total 1017220
drwxr-xr-x 3 cliff users 4096 Mar 4 09:14 ./
drwx------ 5 cliff users 4096 Jan 8 09:28 ../
drwxr-xr-x 2 cliff users 1041616896 Jan 13 21:58 junk/
Its the junk directory I'm trying to delete. I was able to re-name it form the original name, which was
Quote:
XCliTS4zUl
.

I was cleaning up some files with XFE, and moved them to Trash. The desktop I use most often is XFCE. I see the same problem if I try to empty Trash with XFE or Thunar.

Every other directory I see shows a size of 4096, this one is huge.

Is there some way of deleting it? Is there some command to change the size to 4096?

The file is not causing the system any problems that I have seen, outside of the thrashing if I try to ls the contents.
 
Old 03-04-2014, 12:03 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Interesting. Can you run a stat command on the offending directory?

maybe an 'lsattr -d' on it as well.

Last edited by szboardstretcher; 03-04-2014 at 12:06 PM.
 
Old 03-04-2014, 01:05 PM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,352

Original Poster
Rep: Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925
The stat command returns:

Quote:
#stat junk
File: ‘junk’
Size: 1041616896 Blocks: 2034424 IO Block: 4096 directory
Device: 806h/2054d Inode: 2359303 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 1000/ cliff) Gid: ( 100/ users)
Access: 2014-03-04 09:18:38.561631663 -0500
Modify: 2014-01-13 21:58:02.932502544 -0500
Change: 2014-03-04 09:14:47.381078833 -0500
Birth: -
and lsattr returns :

Quote:
#lsattr -d
-------------e-- .
[root@duelie:files]#lsattr -d junk
----------I--e-- junk
Thank-you for the interest.
 
Old 03-04-2014, 05:18 PM   #4
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 828
Blog Entries: 1

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
First, if possible, I would umount the drive and do a fsck

If fsck goes OK and you still cannot to remove the dir, try:
Code:
mkdir bad
mv junk bad
rm -rf bad
Assuming junk is the 'bad' directory.
 
Old 03-04-2014, 05:29 PM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Well first,. before sitting through an fsck that could take days, depending on the number of files in there,..

why not try deleting by inode? You now know the inode number of the dir.. so:

Code:
find . -inum 2359303 -exec /bin/rm -irf {} \;
 
3 members found this post helpful.
Old 03-04-2014, 05:31 PM   #6
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,352

Original Poster
Rep: Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925
The results of fsck...

Quote:
# fsck /dev/sda6
fsck from util-linux 2.21.2
e2fsck 1.42.6 (21-Sep-2012)
/dev/sda6: clean, 2576431/8216576 files, 12331332/32854925 blocks
Did the mkdir, mv junk to bad, and rm -rf bad. Results look the same. The disk light is on and the disk is thrashing away. The only way to stop it is to do a 'shutdown -r now' and reboot. I'm going to let this run at least 15 minutes. I'll report back.

szboardstretcher,

I'll give that a go, after the 15 minute expires...

Last edited by camorri; 03-04-2014 at 05:32 PM.
 
Old 03-04-2014, 08:40 PM   #7
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,352

Original Poster
Rep: Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925Reputation: 925
I let the recursive remove run for over an hour, with no change.

I ran the command
Quote:
find . -inum 2359303 -exec /bin/rm -irf {} \;
and let it run. It has deleted the junk directory.

Thank-you szboardstretcher. This problem is solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync uses wrong directory, has wrong size but right file count? brianpbarnes Linux - Software 1 02-23-2009 06:48 PM
Script to delete files with 0k file size in a directory justgiver Linux - Newbie 4 01-28-2008 05:56 AM
delete files uncompressed into wrong directory safely petersk Linux - General 3 03-04-2007 02:38 PM
Delete Files by size LoafOfBread34 Linux - General 3 11-28-2005 12:16 PM
delete files by size Serena Linux - Newbie 2 04-25-2002 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration