LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   No free Space even after deleting files (ext3) (https://www.linuxquestions.org/questions/linux-general-1/no-free-space-even-after-deleting-files-ext3-355326/)

jeffUK 08-20-2005 07:18 PM

No free Space even after deleting files (ext3)
 
Hi,
I'm running Mandrake 9.2 on a Mini ITX system.
I was having hardware probs. with hard-drive, so I bought a new one.
It has
hda1 / ext3 (6 gig)
hda5 swap (10 gig)
hda6 /home ext3 (110gig)
I copied the MBR & Partition table with dd & sfdisk.
I copied over the OS with partimage.
I made a new filesystem on hda6 with mkfs.ext3
I copied over the files from old HD hda5 to new one with rsync
So far so good.

I've filled up hda6, so I deleted files to make space.
Now the problem starts - even though "df" shows that I'm using less space,
the amount of free space stays at ZERO & I keep getting "No space left on device"
I've used tune2fs to check old hda6 and new hda6 - they show similar info.

If I use tune2fs to check how much free space I get "Free blocks: 59765" on the new one - this increases if I delete files, but still df gives me 0 free bytes!
I've run fschk on /dev/hda6 - that's clean.
I don't get the problem with hda1 or the old hda6

I've tried booting under a Knoppix Live CD (system rescue) - same effect.

Here's a typical output from df
Before delete:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part1
6040288 4942936 790516 87% /
/dev/ide/host0/bus0/target0/lun0/part6
108839616 108600556 0 100% /home
After delete:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part1
6040288 4942936 790516 87% /
/dev/ide/host0/bus0/target0/lun0/part6
108839616 107887000 0 100% /home

So now I've got a nice new (quiet!) HD, but I can't write to it!

Help would be gratefully received!

Jeff

rjlee 08-21-2005 04:07 AM

An ext filesystem stores an amount of “emergency” space that can only be written to by the root user; this manifests itself as a directory called /lost+found.

The exact amount of “emergency” space is set at the time of formating; I don't know if you can change it. This is done so that you have scratch space available to use if you need to take any drastic measures to reconstruct the drive, for example if fsck needs temporary space to fix a file.

I think you've probably filled this emergency space, and you will need to delete more files if you want to actually see any usable free space on the disk.

davcefai 08-21-2005 04:20 AM

Speaking from ignorance, you copied over the partition table from the old disc. It could be that as a result you have the same partition size.

Suggestion: I don't know what equivalent Linux tools there are but you could run Ranish Partition Manager to have a look. It runs under just about any DOS so you could make a FreeDOS boot diskette and then run Ranish. Note: Ranish display is confusing but the prog is very powerful and can handle Linux Partitions. That said, it is easy to destroy data so make sure you're backed up/

rjlee 08-21-2005 04:55 AM

fdisk will tell you what the partitions are. Gnuparted will let you resize partitions.

eddiebaby1023 08-21-2005 09:58 AM

Another way to "lose" space is from daemon programs that write big log files. You can remove the directory entry to the file, but the space won't be released until the program that's writing it terminates. Also, if you have other hard links to a file the space isn't released until the last link is deleted, ls -l will give you a link count for each file and directory.

jeffUK 08-21-2005 05:16 PM

Hi - thanks for your suggestions.
After seraching (again!) through the forums, I found this post
http://www.linuxquestions.org/questi...hreadid=122949
which helped to solve the problem.

The answer is to run (as root)
tune2fs -r 0 /dev/hda6
to set the reserved blocks to zero (as it was on my original partition).

Hope this helps others!

I can't see any advantage to having reserved blocks - if they're never used, they wont help reduce fragmentation.

Thanks again,

Jeff

michaelk 08-21-2005 07:13 PM

BTW. reserved space is intended to allow for the system to continue functioning even if a user fills up all the available space. i.e. If you accidentally filled up /, the system would crash the next time the OS attempted to write a log file. It also keeps the filesystem from filling up entirely which helps combat fragmentation.


All times are GMT -5. The time now is 01:58 PM.