[SOLVED] Can't remove huge directory in /home/user or run fsck
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't remove huge directory in /home/user or run fsck
Slackware 14.1, 32 bit system on a netbook.
I have a directory in my /home/user that shows a dir size of 166,780,928. If I try and do anything with it, the disk light goes solid on, and the system becomes unresponsive.
I was doing some updates from Sbopkg when the system locked up. I suspect some junk got written to home.
I went to init 1 and tried to umount /dev/sda6 which is /home/user. The system reports it as busy. I can not figure out what has it busy.
Managed to boot the system off a slack install usb stick. Ran fsck /dev/sda6 -t ext4, and the system reports the file system is good.
I want to run fsck on sda6.
How can I either find out why its busy?
Is there some way I can run fsck? This system does not have a CD or DVD drive, so I can not boot a live system from there.
Suggestions on how to check sda6? FWIW the HD has sda1 as /, sda5 is swap, and sda6 is /home. No other disks in the system.
I booted the system with a slack install USB stick. Got a root command prompt.
I mounted /dev/sda6, was able to change into the directory in question. Did a ls -l, and it lists a ton of files with obscure file names. Between each file name are lines of '\ \ \ \ \ \ '
I ran rm * and rm *.* . Did another ls -l, and still file names appear separated by the back slashes.
Your thoughts?
Last edited by camorri; 10-27-2014 at 06:16 PM.
Reason: Added info
OK. Since my first post and update, I have made progress.
Quote:
Have you tried lsof?
I did, but not with the /home/user or +D. Got a large list mt limited ability could not make sense of.
Quote:
If you can reboot, comment the line with /dev/sda6 in /etc/fstab, then reboot at runlevel 3, login as root, run fsck on /dev/sda6.
Great idea, never thought of that. After I booted with the USB stick I did run fsck on sda6. It reported no problems.
Quote:
Did you login originally as a non-root user and then "su - root" or similar?
Yes I had, I was trying to update some packages from Sbo when the system locked up.
So, after booting from USB, as root I mounted /dev/sda6 and changed to the directory in question. As I posted on my first post, I saw I had files starting with random numbers and letters. I did a long series of 'rm 1*' to 9*, then A* to Z* and finally a* to z*. The files were removed, what ever they were. I was then able to rmdir the dir in question.
On reboot off the hdd, the system complained the date and time were wrong. They were way off in the bios. I set them correctly. I adding this post from the netbook. I'll do some more testing tomorrow. All seems well now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.