Command rm deletes filename but not the blocks


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Command rm deletes filename but not the blocks
# 8  
Old 01-16-2012
Even "tail -f" can cause these symptoms. More likely that you have a process which periodically writes to the file and sometimes gets caught by the "rm".
If it is a suitable process, maybe consider nulling the file (>filename) instead of deleting it. If this is a standard system file like "wtmp", please tell us. (I have never heard the term "scan file").

Last edited by methyl; 01-16-2012 at 10:11 AM..
# 9  
Old 01-16-2012
It is the output of a drum scanner. The scanner writes the file on the UNIX disk and I copy it to a NT machine. When it is done I have to delete the file to have space for the next scan.
# 10  
Old 01-16-2012
Has the load changed lately on your intergraph station? Now it may be too late to look at since you rebooted...
This issue only happens when files are open... So it leaves you with either write not completed, or copy to NT stayed pending (network issue?).
reset the file to zero size as suggested by methyl may be a good alternative
# 11  
Old 01-16-2012
Depending on the OS version, you can still user fuser. Fire it in against the filesystem, often with flags -duV and it might give you process and userid holding open deleted files.



I hope that this helps.


Robin
Liverpool/Blackburn
UK
# 12  
Old 01-16-2012
Quote:
Originally Posted by hausi2012
For 20 years there was no reason to use "fuser". Smilie
Keeping things on disk like this is a standard feature on most UNIX systems for a very long time -- files in use won't be freed from disk until they're actually closed.

If you don't have fuser, but your system has /proc/fd/, you might try looking for processes which have files open that have zero hardlinks. Those will be open files that're no longer present on the filesystem...

Last edited by Corona688; 01-16-2012 at 12:18 PM..
# 13  
Old 01-17-2012
There is /proc on the machine but no /proc/fd. In /proc there are files like 00345. Are they to delete?
# 14  
Old 01-17-2012
Do not delete files from /proc . Judging from Google results this is likely to be unix System V release 3.

You need to find the process which is holding the file open.
You mentioned a process which copies the file to a Windows NT server. How does that work?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Can I run repair on lot of blocks with single command ?

Hi, I have Solaris-10 OS on T5220. Both local disks were mirrored under SVM. Somehow when one disk gone bad (c0t1d0), other disk (c0t0d0) also got lot of bad block. We have readable data only on c0t0d0, but as soon as server comes after, it hangs when I run few commands because of read errors,... (1 Reply)
Discussion started by: solaris_1977
1 Replies

2. UNIX for Dummies Questions & Answers

sed command that deletes lines with 3-5 digit strings

Hello! My final exam in my Linux class is tomorrow, and I was just reviewing the grep and sed commands. I came across an example, by which I got stumped: it asks to provide a sed command that deletes all lines that contain exactly 3 to 5 digit strings, from a file. In this case, I created a... (3 Replies)
Discussion started by: kalpcalp
3 Replies

3. Shell Programming and Scripting

Row blocks to column blocks

Hello, Searched for a while and found some "line-to-column" script. My case is similar but with multiple fields each row: S02 Length Per S02 7043 3.864 S02 54477 29.89 S02 104841 57.52 S03 Length Per S03 1150 0.835 S03 1321 0.96 S03 ... (9 Replies)
Discussion started by: yifangt
9 Replies

4. Slackware

Thunderbird 3.1.9 deletes from drafts

I am using Tbird as it came with Slackware 13.37 and everytime I send something I get a message 1 or 2 drafts deleted. Should it be doing that? If not has this been reported ? How can I find out if it was reported? I have no drafts to delete. (2 Replies)
Discussion started by: slak0
2 Replies

5. Shell Programming and Scripting

Why sed command deletes last line in a file if no carriage return?

Hi I am using sed command to make SCORE=somevalue to SCORE=blank in a file. Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line. cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies

6. Shell Programming and Scripting

A script that deletes files.

I want to write a script that deletes files inside the dir. However, the script should also allow the user to confirm by pressing (d) key before deleting files.. #!/bin/bash for file in $1/* do size='ls -l $file | cut -f 5 -d " "' name='ls -l $file | cut -f 9 -d " "' ... (1 Reply)
Discussion started by: herberwz
1 Replies

7. Shell Programming and Scripting

how to split this file into blocks and then send these blocks as input to the tool called Yices?

Hello, I have a file like this: FILE.TXT: (define argc :: int) (assert ( > argc 1)) (assert ( = argc 1)) <check> # (define c :: float) (assert ( > c 0)) (assert ( = c 0)) <check> # now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Discussion started by: paramad
5 Replies

8. UNIX for Dummies Questions & Answers

Convert 512-blocks to 4k blocks

I'm Unix. I'm looking at "df" on Unix now and below is an example. It's lists the filesystems out in 512-blocks, I need this in 4k blocks. Is there a way to do this in Unix or do I manually convert and how? So for container 1 there is 7,340,032 in size in 512-blocks. What would the 4k block be... (2 Replies)
Discussion started by: rockycj
2 Replies

9. Shell Programming and Scripting

Help with Script using Command Blocks

Hello, I am trying to create a shell script that use command block (donīt really know if this is the correct way to say it), but while one version works fine, the other one is not working at all. So let me show an example of this "command block" Iīm using and its working ok: cat << _EOF_ `echo... (7 Replies)
Discussion started by: Alexis Duarte
7 Replies

10. UNIX for Dummies Questions & Answers

Multi line deletes

I would like to be able to delete the first n lines of a file from inside of a ksh script. I am not sure how to achieve this or if it is possible. Could someone please help. Thanks in advance. (5 Replies)
Discussion started by: rehoboth
5 Replies
Login or Register to Ask a Question