Home » Questions » Unexperienced [ Ask a new question ]

"No space left on device" after resizing partition

"No space left on device" after resizing partition

I decided to resize the partition on my storage drive (with gparted), all seemed to go well but now when I try to create directories or copy files to the drive I get a "No space left on device" error.

Asked by: Guest | Views: 282
Total answers/comments: 2
Guest [Entry]

"Firstly, you can't simply add up the sizes of all the files on the disk, and expect that to be the total amount used. Every time you store a file, there is some space wasted. It's like putting books on a shelf, if the books vary in size, then you're going to have a space between the top of the book and the bottom of the next shelf.

Secondly, if you have any files which are open but deleted, then the space that is used will still be used until the program with that file either closes it, or exits. That's often used for temporary files, the program doesn't have to worry about cleaning them up, all it needs to do is open a file, then delete it, before working with it. These files used space will show up in df, but you can't find a filename which corresponds to it. If you want to find them, then you'll have to look in /proc/*/fd

Thirdly, and this is your issue here, ext3 file systems have a percentage of reserved space which can only be written to by root. There are two reasons for this, many file systems become inefficient when the disk becomes close to becoming full, the system has to spend more and more time fitting files into the spaces that are left. Also reading and writing to the files is slow, as they end up being badly fragmented. Another reason for reserving space for root is that it allows root to compress files and hopefully recover some space for the users. If the disk was totally full, then that wouldn't be possible.

Therefore, there is nothing wrong, what you are seeing is normal behaviour for a full disk."
Guest [Entry]

"Ok, you were all right, it was full :D

Thanks to quack for the tune2fs comment I see where I went wrong:

Reserved block count: 11685177
Free blocks: 11298646

I have just moved about 60GB from the drive and it is now working as it should :)

Thank you all for your help."