Solved

Reclaiming disk space after unlinking dir

Posted on 1997-06-20
4
694 Views
Last Modified: 2013-12-27
I am running Solaris 2.5 using the GNU fileutils.  I was
id root (unfortunately) when I did a typo and did rm -rd
instead of rm -rf.  Now the directory is gone, but my disk
did not reclaim any more space.  I have done fsck several
times but it appears everything is fine.  Any ideas on how to reclaim the space besides remaking the fs and restoring?
0
Comment
Question by:bmccrary
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:mlev
ID: 2006443
The man page of rm suggests starting with fsck.
0
 
LVL 2

Expert Comment

by:mlev
ID: 2006444
Oops, sorry, didn't read carefully.

0
 
LVL 3

Accepted Solution

by:
dhm earned 100 total points
ID: 2006445
Did you try giving the "-o f" option to fsck?  Solaris-2.5 stores the filesystem state in the superblock, and if the state is "clean," fsck won't check.  The fsck man page says "-o f" forces fsck to check even if it thinks it doesn't need to.  (BTW, I always thought the option was simply "-f"; you might want to try that too, if "-o f" doesn't force the check.)

I'd expect the directory to end up in the lost+found directory at the top of the partition; the name will be the inode number that the directory had before you unlinked it.  BTW, it's possible that it's already there -- fsck won't "reclaim" space; it'll only find filesystem problems and repair them to the best of its ability.  This generally results in files and directories that have gotten halfway-deleted or otherwise lost, getting restored in the lost+found directory.
0
 

Author Comment

by:bmccrary
ID: 2006446
Thanks for your answer!  I had thought that fsck would ask me yes or no before it did anything to all of those files in the directory, but sure enough, there they all were in lost+found.  I feel really stupid now, but I don't normally go around unlinking directories! :)  Thanks!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question