mv files still in use - space not freed


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory mv files still in use - space not freed
# 1  
Old 01-08-2008
mv files still in use - space not freed

Had a issue recently where DB admins did:

mv listener.log listener.log.old
gzip listener.log.old

Where file listener.log is continually being written to by an oracle process.

Anyway, according to the DB admins they successfully created the
listener.log.old.gz
file (i.e. all went okay).

Then they started complaining that space had not been freed on the filesystem.

I logged in and couldn't see the file listener.log.old.gz anywhere. The "listener.log", which was 2GB originally, was indeed smaller when I checked, so it was moved.

"du -ks /opt/sw/oracle" showed 4GB in use.

Whereas "df -k" showed 6GB in use on the "/opt/sw/oracle" mountpoint.

Apparently it's something to do with inodes referring to the original file while it's still in use ... but not sure, which is why I am posting to find out why?

Anyway, to fix the issue, stopping and restarting the process using the file will free up the space.
# 2  
Old 01-08-2008
mv listener.log listener.log.old
name change doesn't matter, the file is already open. Process still writes to what is now listener.log.old

gzip listener.log.old
(listener.log.old.gz is created and listener.log.old is removed)
you removed the name, not the file. Another name change which doesn't matter.

A file will no link to a directory will be removed upon the last close.

What would probably work:
cp listener.log listener.log.old
cp /dev/null listener.log
gzip listener.log.old
# 3  
Old 01-08-2008
Quote:
Originally Posted by Perderabo
A file will no link to a directory will be removed upon the last close.
Is that why I could not see the listener.log.old.gz file when I logged in to check?
If it is removed, then why isn't the space freed?

Thanks for the info btw.
# 4  
Old 01-08-2008
No, I can't explain why the .gz file was missing.
# 5  
Old 01-08-2008
fuser will show open files that have been deleted on a given file system. Until that process is stopped the space will not be freed. Before messing with files make sure no process has it open with fuser.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Safe way to shrink lvm vg_*-lv_swap partition and reclaim freed space on Linux?

Hello, # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom sda 8:0 0 38.2G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 ... (2 Replies)
Discussion started by: centosadmin
2 Replies

2. HP-UX

Files consuming more space in HP-UX

Hi, Could you please provide OS command to find large files in size MB and GB... under specific directory in HP-UX? Regards, Maddy (4 Replies)
Discussion started by: Maddy123
4 Replies

3. Linux

About shrinking LVM and then adding the freed space to another OS on dualboot system

Hi all, Fedora 17, 64bit Ubuntu 12.04 desktop 64bit HD 160G I installed Ubuntu 12.04 on the HD first taking up the whole disc. Later I added/installed Fedora 17 selecting the "Shrink" option and save the bootloader on /dev/sda1 to make them dualboot. Installation is successful with... (0 Replies)
Discussion started by: satimis
0 Replies

4. UNIX for Dummies Questions & Answers

Space utilization for group of files

Hi Is there an easy was to list a group of file (*.txt) and report how much disk space they are using in total? Cheers (2 Replies)
Discussion started by: Grueben
2 Replies

5. UNIX for Dummies Questions & Answers

Three space delimited files

So I have three space delimited files. Each have 90 rows and many columns. I want to merge them by columns. I use paste to merge file 1 and file2 or file 3 and it works. But when I try to merge file 2 and file 3 using paste or merge or cat, I cannot merge them by column, instead they are merged by... (11 Replies)
Discussion started by: evelibertine
11 Replies

6. Programming

Why memory allocated through malloc should be freed ?

Actually for a process to run it needs text, stack , heap and data segments. All these find a place in the physical memory. Out of these 4 only heap does exist after the termination of the process that created it. I want to know the exact reason why this happens. Also why the other process need to... (20 Replies)
Discussion started by: karthiktceit
20 Replies

7. Solaris

Memory usage in Solaris - memory not freed?

Hi, I'm running a multi-process software system on a Solaris 8 machine. When I monitor the memory usage, I see that the free memory is dropping rapidly, but I can't detect a process that uses this memory. I'm using "top" to get the free memory and the memory usage of processes. Thanks. (3 Replies)
Discussion started by: gewurtz
3 Replies

8. UNIX for Dummies Questions & Answers

Multiple Files Renaming with space

Hi, I need help how to renaming multiple file. The original file look like this; Test Monday.txt Test Wednesday.txt Test July.txt I have more than hundred file in the directory. How i want to rename all file to a new file name in one time? The new file maybe the same name e.g.... (13 Replies)
Discussion started by: nazri76
13 Replies

9. UNIX for Dummies Questions & Answers

Space problem in files

Hi, I have a file containing a list of entries. Want to do ls on them. for a in `cat <list.txt>`; do ls $a; done; Now some entries contain spaces. How do i incorporate space in $a. Quoting $a in "" doesn't help. Thanks (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

10. UNIX for Dummies Questions & Answers

when I try to run rm on multiple files I have problem to delete files with space

Hello when I try to run rm on multiple files I have problem to delete files with space. I have this command : find . -name "*.cmd" | xargs \rm -f it doing the work fine but when it comes across files with spaces like : "my foo file.cmd" it refuse to delete it why? (1 Reply)
Discussion started by: umen
1 Replies
Login or Register to Ask a Question