18

I deleted a large file (6 GB) located in my home directory but the free space is not increased.

I have tried looking the file in trash folder by typing cd ~/.local/share/Trash/files but it's not listed there. I have tried running sudo apt-get clean but the problem isn't solved. I have also tried sudo lsof +L1 to see if any other process are using it but it's not showing up there either.

Anyone have any suggestions?

5
  • What is the file named? Can you run sudo fdisk -l?
    – nanofarad
    Oct 24, 2012 at 19:26
  • You can run df -lh to see a list of your partitions including the free space. Even if the file is hidden (starts with a dot .), you should see it in the Nautilus Trash (also called Rubbish Bin).
    – rosch
    Oct 24, 2012 at 19:41
  • 1
    @ObsessiveSSOℲ: file is named output.file located in home directory. "fdisk -l" just gives the start and end Blocks of each partition. I don't know what to do with this data. Oct 25, 2012 at 10:02
  • @rosch: file was not hidden(name wasn't started with a dot) Oct 25, 2012 at 10:06
  • You may be trying to free space on the wrong partition. fdisk will tell me what partition is the one in question/
    – nanofarad
    Oct 25, 2012 at 10:35

2 Answers 2

19

The file is still in use by one (or more) process(es). The space occupied by the file will only be released if no processes have the file open.

This is a common gotcha with log files that are filling up a filesystem, when the administrator forgets to restart the accompanying process.

You can check this with lsof | grep DEL

4
  • Thanks for your reply I don't think that the file was being used by any other process at that time. It was a binary file created using "truncate -s 10M output.file" just to meet the minimum sharing required to use DC++ :). Oct 25, 2012 at 10:07
  • So is your question wrong then? You did not delete the file yet and after deleting you saw the free space?
    – rosch
    Oct 25, 2012 at 12:10
  • @rosch: I deleted the file and after that I saw the space. Why else would I be asking question otherwise ? Oct 25, 2012 at 17:19
  • 1
    Well your question is saying the opposite.."deleting a file does not free up space". So I suggest to rephrase it, or even delete it. I am thinking about people reading the question later on.
    – rosch
    Oct 25, 2012 at 20:44
4

I have resolved this by the following steps

#lsof +L1

Which will show the list of files that holding memory with deleted quote.

Note the pid ( Process id ) of the file

Kill the process

#kill <pid>

The memory will be released by the process

Check it by command

#df -h
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .