General discussion

Locked

file deletion

By ajerinsky ·
i have deleted a file in a unix system, but the system has not reclaimed the space. What steps are needed to reclaim the space? sorry but i am not unix savy

This conversation is currently closed to new comments.

12 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

file deletion

by TimTheToolMan In reply to file deletion

Hi,

You probably deleted a link to a file rather than the file itself. Now that the link is gone, you probably wont know where the file was... Search the disk for the file again.

Cheers,
Tim.

Collapse -

file deletion

by ajerinsky In reply to file deletion

The question was auto-closed by TechRepublic

Collapse -

file deletion

by cpfeiffe In reply to file deletion

In many flavors of Unix deleting a link deletes the original file. Using unlink will remove just the link and then the original file and space will still exist. What kind of file was this? If it was a database file, then the database may have a hold on the space and you will have to reconfigure the database to reclaim the space. Many different databases work this way.

Collapse -

file deletion

by ajerinsky In reply to file deletion

The question was auto-closed by TechRepublic

Collapse -

file deletion

by Shanghai Sam In reply to file deletion

Another possibility is that some process has that file open. For instance, a license daemon may open a log file and then you delete the log file but do not restart the license process. The directory entry for that log file will be deleted but the actual file will not be deleted until all processes that have that file open are gone (reboot?). On solaris, the utility /usr/sbin/fuser can show which process have files open for a particular mount point.

Collapse -

file deletion

by BGJKL In reply to file deletion

If the file belongs to a database, shutting down and restarting the database will usually free the space.

Sometimes also, a process will have a hold on the filespace and not release it. I saw another partial answer above, but to elaborate:

1)Shutdown any application that is using the filesystem that contains the deleted file

2) unmount (umount or unmount depending on UNIX flavor) then remount the filesystem....the space should be released. (make sure that you 'cd' out of the filesystem mount point before trying to unmount, or the unmount will not work).

3) If filesystem will not umount, issue
fuser -k -u /filesystem/name
(this will kill any process holding the fs. This is generic UNIX and should work for all flavors..).

4) Remount the filesystem and space should be back..

5) On rare occasions, the space may not come back, because a 'shadow' process is holding the file. A shadow process is not running, but is still residing in memory somewhere. In this case the best thing to do is to re-boot the box to clear.

Collapse -

file deletion

by ajerinsky In reply to file deletion

The question was auto-closed by TechRepublic

Collapse -

file deletion

by BGJKL In reply to file deletion

If the file belongs to a database, shutting down and restarting the database will usually free the space.

Sometimes also, a process will have a hold on the filespace and not release it. I saw another partial answer above, but to elaborate:

1)Shutdown any application that is using the filesystem that contains the deleted file

2) unmount (umount or unmount depending on UNIX flavor) then remount the filesystem....the space should be released. (make sure that you 'cd' out of the filesystem mount point before trying to unmount, or the unmount will not work).

3) If filesystem will not umount, issue
fuser -k -u /filesystem/name
(this will kill any process holding the fs. This is generic UNIX and should work for all flavors..).

4) Remount the filesystem and space should be back..

5) On rare occasions, the space may not come back, because a 'shadow' process is holding the file. A shadow process is not running, but is still residing in memory somewhere. In this case the best thing to do is to re-boot the box to clear.

Collapse -

file deletion

by ajerinsky In reply to file deletion

The question was auto-closed by TechRepublic

Collapse -

file deletion

by BGJKL In reply to file deletion

If the file belongs to a database, shutting down and restarting the database will usually free the space.

Sometimes also, a process will have a hold on the filespace and not release it. I saw another partial answer above, but to elaborate:

1)Shutdown any application that is using the filesystem that contains the deleted file

2) unmount (umount or unmount depending on UNIX flavor) then remount the filesystem....the space should be released. (make sure that you 'cd' out of the filesystem mount point before trying to unmount, or the unmount will not work).

3) If filesystem will not umount, issue
fuser -k -u /filesystem/name
(this will kill any process holding the fs. This is generic UNIX and should work for all flavors..).

4) Remount the filesystem and space should be back..

5) On rare occasions, the space may not come back, because a 'shadow' process is holding the file. A shadow process is not running, but is still residing in memory somewhere. In this case the best thing to do is to re-boot the box to clear.

Back to Linux Forum
12 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums