Sponsored Content
Full Discussion: Removing ".nfs" files
Special Forums Hardware Filesystems, Disks and Memory Removing ".nfs" files Post 19643 by Perderabo on Monday 15th of April 2002 07:10:10 AM
Old 04-15-2002
In unix, it is ok to create a file, then unlink it, and continue to read and write to it. When you remove the last link to a file, it becomes a file with zero names. But the inode will not be freed until all processes close it. This is often done with temporary files. If the process aborts, the file will go with it.

It is hard to implement this in an nfs environment. If a nfs client gets a request from a local process to delete a file, it checks to see if any local processes still have that file open, if so, it renames the file to a .nfs<something> file. And after the last local process closes the file, the nfs client will actually issue the delete.

If you are running a process on a nfs client and that process attempts a unlink() system call on a open file, the above scenario plays out. But the process still has the file open. You should be glad that .nfs file is still around. You must be holding the file open in order to eventually do i/o to it. If this is not the case, the process has a bug. It should close the file if the file is no longer needed. If the process is going to run for days or weeks and it is opening files that it will never close, the file table will eventually fill.

The .nfs files should not really cause any trouble unless they are very large. Some people run a cron job on the nfs server that finds .nfs files that have not been accessed in the past two weeks and deletes them.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

removing the "\" and "\n" character using sed or tr

Hi All, I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example... this is a test line #1\ should be concatenated with line #2\ and line number 3 when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies

2. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

3. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

4. Solaris

Removing "Failed none for" error messages from sshd logs files

We have a number of system running the same patch level, OS version and sshd version. The systems also have the same sshd config and syslog.conf entries , however one of the systems keeps logging the following message everytime someone logs in: Nov 16 09:36:02 server389 sshd: Failed none for... (3 Replies)
Discussion started by: Mr_Webster
3 Replies

5. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

8. Shell Programming and Scripting

Removing "^M" from the end of a String (i.e. "Ctrl+M")?

Hello All, I have an Expect script that ssh's to a remote server and runs some commands before exiting. One of the commands I run is the "hostname" Command. After I run this command I save the output using this line in the code below... Basically it executes the hostname command, then I... (2 Replies)
Discussion started by: mrm5102
2 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
MOUNT.NFS(8)						      System Manager's Manual						      MOUNT.NFS(8)

NAME
mount.nfs, mount.nfs4 - mount a Network File System SYNOPSIS
mount.nfs remotetarget dir [-rvVwfnsh ] [-o options] DESCRIPTION
mount.nfs is a part of nfs(5) utilities package, which provides NFS client functionality. mount.nfs is meant to be used by the mount(8) command for mounting NFS shares. This subcommand, however, can also be used as a standalone command with limited functionality. remotetarget is a server share usually in the form of servername:/path/to/share. dir is the directory on which the file system is to be mounted. Under Linux 2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions. Under earlier Linux kernel versions, mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2. OPTIONS
-r Mount file system readonly. -v Be verbose. -V Print version. -w Mount file system read-write. -f Fake mount. Don't actually call the mount system call. -n Do not update /etc/mtab. By default, an entry is created in /etc/mtab for every mounted file system. Use this option to skip making an entry. -s Tolerate sloppy mount options rather than fail. -h Print help message. nfsoptions Refer to nfs(5) or mount(8) manual pages. NOTE
For further information please refer nfs(5) and mount(8) manual pages. FILES
/etc/fstab file system table /etc/mtab table of mounted file systems SEE ALSO
nfs(5), mount(8), AUTHOR
Amit Gud <agud@redhat.com> 5 Jun 2006 MOUNT.NFS(8)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy