Discussion Locked

Free Blocks-

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello.

I seem to have created a problem that I'm not sure how to fix.

We had a directory containing over 100,000 files, more than 10GB in size. I needed to free up some space in that filesystem, and my intention was to copy them from the current filesystem to another, then delete the original files/directory. Once the files copied I deleted the original directory using rm -r. I'm guessing this was a bad thing to do- because df -v still shows the same amount of free blocks as it did prior to deleting the directory. I guess I should have deleted the files instead.

I tried creating a new free list by unmounting the filesystem and used fsck -s in maintenance mode, as well as a "check and repair" under scoadmin, but there was no change. It appears that the system still thinks these blocks have data in them. Any help appreciated.

Thanks...

6 replies

by ann777

Does your system have more than one hdd or partition/location/volume?

You need to be very certain from which hdd you are removing files/directories. Unix will often have redirectors to other partitions/locations and it's rarely obvious.

See if you can LS -L the directory. If the files are still there, then you may not be able to remove them while online (which other users/applications may have the files open).

If you cannot find the files at that location, then make sure you have the files in your second location.... and make sure that the second location is on a different physical drive or location. And there are no redirectors.

by gerry a

Thanks Anna,

The directory was definitely deleted from it's original location (usr2) after the copy was complete and it is in it's new location (usr4) with all of the files within the new directory intact. We have multiple drives, but it's a raid configuration. There are no links or redirectors being used the directory or on these files.

I'm thinking I may have to backup and restore this filesystem. Being I'm still new to unix, here's another question- can I simply format a sole filesystem and then restore from tape? I was looking at SCO's TA database, TA# 103922- it states that if fsck does not correct the free block database, a backup/reinstall may be the only way to fix this problem. If I format usr2 and restore from tapethen run fsck, will the free block database then be updated, or will I be back at square 1?

by cmorris

I would second that idea. When you delete a file on UNIX two things happen, one is that the dectory entry (or entries) are deleted and the other is that the actual file is deleted. THe file is actually only after all references are gone and after noprocess has it open.

You might play around with "fuser -cu" to see if any process still has those files in use. If not,
then those files must have been referenced from two different places. Is that possible? This can be caused by using "hard" links rather than symbolic links.

If you go to that disk, would you be able to locate the 10GB using "du"? i.e. see if 10GB is used somewhere else you didn't expect.

If you have an old full directory listing of those files, the refefence count would be greated than one (1) if the files are hard linked.

I would think that after unmounting and remounting the filesystem any cache would be cleaned up so that the number you are seeing is correct.

Hope this helps.

This discussion is closed to new replies.