1831406 Members
3349 Online
110025 Solutions
New Discussion

NFS Copy problem

 
SOLVED
Go to solution
Nick Lewers
Advisor

NFS Copy problem

HPUX 11i

I have the following NFS mount:
172.16.20.5:/DB_Backup2 /dbbackup nfs rw,suid,vers=3,timeo=1200 0 0

Trying to copy the following file to a adaptec snap server by cp -pf (file) (destination):
-rw-r--r-- 1 root sys 2147483647 Feb 1 04:51 ghsappl24.bk

I can do it manually, but when I do it from a script it fails with the following error:
cp: bad copy to /dbbackup/hsbackup_copy/ghsappl24.bk: write: File too large

The NFS server for the share is set to:
*(rw,insecure,async)

Also, in my script I exported the ulimt and it is the same as mine when I do the command from the shell.

Any suggestions?
9 REPLIES 9
Robert-Jan Goossens_1
Honored Contributor

Re: NFS Copy problem

Hi Nick,

Sound like a mismatch in NFS versions or largefiles has not been enabled on the BFS server.

http://www12.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c01003430-1

HTH,
Robert-Jan
Nick Lewers
Advisor

Re: NFS Copy problem

Thanks for the reply.

Actually, the file isnt a large one (existed on the server prior to me enabling large files), so I do not belive that would be an issue. The server is either V3 or 4, and I am forcing version 3 on the client.

If it was as you suggest, I would think that I wouldnt be able to complete the copy manually. Its only when the copy is done via the script where it fails. Ive commented everything out of the script so this is all that is left:
#!/usr/bin/ksh
log=/home/nlewers/hsbackup_copy.log
echo "HS Backup starting..." `date` > $log
ulimit >> $log
cp -pf /hsbu2/hsbu/glsappl24.bk /dbbackup/hsbackup_copy >> $log 2>&1
echo "HS Backup complete..." `date` >> $log

if I run it manually from the shell:
cp -pf /hsbu2/hsbu/glsappl24.bk /dbbackup/hsbackup_copy
I do not get the error.
Nick Lewers
Advisor

Re: NFS Copy problem

Thanks for the reply.

Actually, the file isnt a large one (existed on the server prior to me enabling large files), so I do not belive that would be an issue. The server is either V3 or 4, and I am forcing version 3 on the client.

If it was as you suggest, I would think that I wouldnt be able to complete the copy manually. Its only when the copy is done via the script where it fails. Ive commented everything out of the script so this is all that is left:
#!/usr/bin/ksh
log=/home/nlewers/hsbackup_copy.log
echo "HS Backup starting..." `date` > $log
ulimit >> $log
cp -pf /hsbu2/hsbu/glsappl24.bk /dbbackup/hsbackup_copy >> $log 2>&1
echo "HS Backup complete..." `date` >> $log

if I run it manually from the shell:
cp -pf /hsbu2/hsbu/glsappl24.bk /dbbackup/hsbackup_copy
I do not get the error.

Thanks, Nick
OldSchool
Honored Contributor

Re: NFS Copy problem

take a hard look at your ulimit output...
the script starts / runs in ksh, which has a builtin ulimit as opposed to /usr/bin/ulimit.

Also, what shell are you running when you do the "cp" manually?

I'm betting that in the script, when it logs the output of ulimit, you are seeing something like "4194303" which is the number of 512 byte blocks that you're allowed to write. At 2,147,482,136...that would be just smaller than the file size you want.

That seems to be the most it will take. I tried "ulimit 4200000" which didn't generate an error, but didn't appear to work either.

what happens if you use a posix shell instead (/usr/bin/sh)?
Nick Lewers
Advisor

Re: NFS Copy problem

Thanks for the reply. here is what I did:

changed shell to sh (#!/usr/bin/sh) in the script, output of the log:
$ cat hsbackup_copy.log
HS Backup starting... Fri Feb 1 13:14:19 CST 2008
4194303 (ulimit)
Copying file /hsbu2/hsbu/ghsappl24.bk...
cp: bad copy to /dbbackup/hsbackup_copy/ghsappl24.bk: write: File too large
HS Backup complete... Fri Feb 1 13:17:21 CST 2008



From the shell:
neo(root)#echo $SHELL
/usr/bin/ksh
neo(root)#ulimit
4194303
neo(root)#cp -pf /hsbu2/hsbu/ghsappl24.bk /dbbackup/hsbackup_copy
neo(root)#

no errors. When I look at the file, it looks correct after the manual copy.

Nick Lewers
Advisor

Re: NFS Copy problem

Anyone else have any other suggestions?
Dave Olker
Neighborhood Moderator
Solution

Re: NFS Copy problem

Hi Nick,

A couple thoughts...

o Is this a brand new problem or something that has never worked? If it worked at one time and suddenly stopped working, what has changed?

o Are other NFS clients able to run this script against this NFS server? Is this the only client that fails?

o Does the problem only occur writing to that specific NFS server? Can you try using a different NFS server from the same NFS client and see if the problem occurs? You could even take your 11.11 system and export a local filesystem temporarily and mount the filesystem via a loopback NFS mount and run the same test to see if the problem exists when the 11.11 box is both the NFS client and server.

o Are you running the latest patched version of ksh? I know there were problems back in the 11.0 days similar to this that were fixed in ksh patches. The latest 11.11 patch is PHCO_37283. Might be worth a try.

o Since this problem also occurs with the Posix shell, I'd be interested in checking your libc patch too. I see there is an EFBIG fix in libc that could be related to your problem. The latest libc is PHCO_36184. That might be worth a try as well.

o When you run the command in a shell, does the copy even begin and fail at the very end of the file or does the copy never even start and you get EFBIG returned immediately?

Let me know if any of this helps. If not, I'll try to think of what to check next.

Regards,

Dave



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Nick Lewers
Advisor

Re: NFS Copy problem

Sorry for the late response, I didnt get notified of your post.

This is something that never worked, and I actually just found a work around, to use rcp instead of cp. thanks for the replies.
Nick Lewers
Advisor

Re: NFS Copy problem

see thread