Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reclaiming disk space after unlinking dir

Posted on 1997-06-20
4
Medium Priority
?
698 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 400 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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

670 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