Solved

Reclaiming disk space after unlinking dir

Posted on 1997-06-20
4
696 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

623 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