Disk space is 100 %

hi ,

there is scenario when the disk space is 100 % and we need to zip files .since zipping will still take some space as it creates a temp file.how will we zip the same
condition : we cannot move or delete file

Create the zip file somewhere else, remove the original, put the zip where it belongs.

Since a zip is a new file anyway, this really isn't that different from what happens ordinarily.

Welcome mayank verma,

I have a few to questions pose in response first:-

  • What have you tried so far?
  • What OS and version are you using?
  • Do you have more than one filesystem on your server? The output of df will tell you.

You cannot compress files to the same filesystem if it's already full, so if you just have one filesystem perhaps you can:-

  1. push some data to another server or removable media, e.g. tape
  2. delete the local copy
  3. compress some of the remaining data
  4. retrieve the sent data

It's not much fun and you have to consider the impact on your applications whilst you do it. An alternate may be to rely on your backups. Just delete something large, perform the housekeeping as you see fit and then recover the removed file from your backups. Again, not pretty but you are not in a good place at the moment.

If you are just a single filesystem server then perhaps have a look in /var for log files. The syslog or rsyslog (you don't tell us your OS version) will write information there and without maintenance that can cause it to fill up. Have a look in /etc/syslog.conf or /etc/rsyslog.conf for clues about these files. They might contain information about what was going wrong on your server to cause it to fill. Do not just delete the log files though. Even if they are huge, they are there for a reason and should be archived/deleted in a managed way.

Usually, a server would have the disk space split up into at least a few filesystems to limit the impact of one section filling up. Often filesystems /, /home, /opt, /tmp, /var & /usr are separated during the Operating System installation. Other software and your data would then have filesystems created for them to use to keep these critical OS filesystems clear. It's difficult, but not impossible to split them up afterwards.

If you could provide us some more detail, we will try to help.

Kind regards,
Robin