File system is full ..even though file is deleted

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat File system is full ..even though file is deleted
# 1  
Old 07-18-2013
File system is full ..even though file is deleted

file system is full ..even though file is deleted?
# 2  
Old 07-18-2013
Probably a process is still using the content of the file..
# 3  
Old 07-18-2013
You can find it using
Code:
# lsof | grep "(deleted)" # (or lsof | grep (filename))

If it's safe to do so, take the pid from the lsof command, and do:
Code:
# ls -l /proc/(pid)/fd # to get the fd# for the file
# > /proc/(pid)/fd/(fd#) # to empty the file.

Otherwise the space will be freed when the application using it closes, or the system restarts.

# implies a root prompt, meaning your sysadmin needs to do this.

(S)he will need to install lsof if it's not already installed.
This User Gave Thanks to Scott For This Post:
# 4  
Old 07-18-2013
Quote:
Originally Posted by rajeshz
file system is full ..even though file is deleted?
Many new-to-UNIX administrators trick themselves like this.

Instead of deleting, truncate, or the contents of a busy file will remain on disk until the process using them is closed.
# 5  
Old 07-18-2013
Quote:
Originally Posted by Corona688
Many new-to-UNIX administrators trick themselves like this.

Instead of deleting, truncate, or the contents of a busy file will remain on disk until the process using them is closed.
Exactly.

But even that doesn't always work.

If the file is still being written to, depending on exactly how the file is being written to, what flags were used to open the file, and the specifics of the underlying file system, a single write to the file could cause it to balloon right back up in size.

And then there are the file systems than have snapshots....
# 6  
Old 07-18-2013
Quote:
Originally Posted by achenle
If the file is still being written to, depending on exactly how the file is being written to, what flags were used to open the file, and the specifics of the underlying file system, a single write to the file could cause it to balloon right back up in size.
Not usually. Most UNIX filesystems have 'sparse' files... You can open a new file, seek ahead 99 gigabytes, and write 1 byte there, to get a file that looks like 99 gigabytes in ls, but only takes 512 bytes on disk. The 99 gigabytes of empty space are not stored.

The same happens when you truncate a file, and they keep writing at the far end. It'll look funny, but you're no longer out of disk space.

You may have problems reading or copying such a file of course, since most programs will just blithely read the sparse sections.

Last edited by Corona688; 07-18-2013 at 01:09 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
# 7  
Old 07-18-2013
But I think you cannot truncate a file that has been opened for writing. I know you can truncate a file that is being appended to (O_APPEND) ( but not with >> in classic Bourne shell )
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Root file system full..Need help

Hi guys, In sun E250 server,root file system is full. we cleared log files in var/adm folder syslogs,mail logs,crash logs are empty. This is a production server. we are not able to run fsck from single user mode. I have given output of df and du command.How to create space in root... (3 Replies)
Discussion started by: PUSHPARAJA
3 Replies

2. AIX

/tmp file system full

Hi, I would like to know if /tmp file system is full, wheather it will affect the peformance of application installed on AIX. if Memory and CPU are not heavily utilized. Regards, Manoj. (1 Reply)
Discussion started by: manoj.solaris
1 Replies

3. Red Hat

File system full, but not really.

Hey all, What do you think mostly happened in the following situation? I have a Red Hat 5.5 server. Someone, somehow, managed to get two .nfs000.... type files that totaled over a terabyte in size. I removed them and thought things were back to normal. Then I started getting complains from... (2 Replies)
Discussion started by: geelsu
2 Replies

4. UNIX for Advanced & Expert Users

/opt file system full !!!

Can anyone help me in cleaning /opt filesystem.. i have checked all the options and i have cleared all the logs and the total size of the files in /opt is shown as 1.8GB were as the size of /opt is 4.8GB but wen i run the command # df -h /opt it gives capacity 99% Please help... (17 Replies)
Discussion started by: kjamsheed
17 Replies

5. Solaris

file system full

hello Even though I am not out of inodes or of space, the /var/adm/messages shows messages: file system full I am doing now fcsk -m (400G) and I am still waiting to see the fragmentation results (should I add another option to df to have a faster output?) Do you have any other hints... (6 Replies)
Discussion started by: melanie_pfefer
6 Replies

6. Solaris

file system full

I am receving following Error message in /var/adm/messages "NOTICE: alloc: /: file system full" Disk space usage is as beklow: df -k $ Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d10 76678257 56962561 18948914 76% / /proc ... (8 Replies)
Discussion started by: Asteroid
8 Replies

7. Solaris

Full file system?

I read the sticky and thought of a script I use on a regular basis. Since unless you patch/upgrade the df command on solaris you have a very tought time teling how full the system truly is. Output looks like $ biggest.sh /tmp Filesystem kbytes used avail capacity Mounted... (0 Replies)
Discussion started by: meyerder
0 Replies

8. Solaris

File system full?

Hi, I just started working with UNIX on an old semi-fossilized Sun workstation which I use to process LOTS of images,however, I just started to get an error message that the file system is full and then my shell tool or/and text editor freeze up. Help? (8 Replies)
Discussion started by: Bend
8 Replies

9. UNIX for Advanced & Expert Users

Full File System

Hi All, There was a background process running on a Solaris 2.8 machine, and appeared to have filled all available disk-space. I done a killall, and upon re-booting found that the file system had filled up, and will not boot as normal as a result. For example, I'm getting /usr/adm/messages: No... (8 Replies)
Discussion started by: Breen
8 Replies

10. UNIX Desktop Questions & Answers

file system full

When I try to log in as root I get the following message realloccg /: file system full sendmail :NO Queue:low on space (have 0,SMTP-DAEMON needs 101 in /var/spool/mqueue) What should I do? (1 Reply)
Discussion started by: hopeless
1 Replies
Login or Register to Ask a Question