Operating System - HP-UX
1752590 Members
3229 Online
108788 Solutions
New Discussion юеВ

Trouble Moving and copying files on NFS mounted FS

 
Randy Brown_1
Frequent Advisor

Trouble Moving and copying files on NFS mounted FS

I have a user that is trying to extract files from tape using tar to an NFS mounted filesystem. When he tries to do this, he gets a series of "permission denied" errors for the files. The directory structure is created and the file name is created, but every file is "0" bytes and has no permissions, e.g.,

---------- 1 bjackson users 0 Dec 7 15:31 xmrg072000WG.tar

The filesystem is being exported rw, it is mounted rw. I can cd to the filesystem and create new files, but I cannot mv or cp files to this filesystem from anywhere without having the above described problems.

The mount point is owned by root:
drwxr-xr-x 3 root sys 3864 Dec 11 12:05 rfcdata

It contains a subdirectory that now has 777 perms to try to figureout this problem and is owned by the user extracting the files from tape.

I will gladly provide more infomation as needed. I hope it's just something stupid I'm overlooking. :)

Thanks in advance for any assistance.

Randy
14 REPLIES 14
Pete Randall
Outstanding Contributor

Re: Trouble Moving and copying files on NFS mounted FS

What type of system (Unix/Windoze/etc.) is this FS exported from and how is it exported (what permissions)?


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Trouble Moving and copying files on NFS mounted FS

Are the UID's and GID's unified across the client and server systems so that user 'bjackson' has identical UID's on client and server? Ditto for group?

One of the first things that I would do is unexport the filesystem and umount the filesystem on the server. Next examine the permissions on the mountpoint. You may have very restrictive permissions on the mountpoint. This can cause problems even when the permissions of the mounted filesystem look fine.

You should also try one of your cp commands that fail.

cp myfile /aaa/bbb/myfile
STAT=${?}
echo "Status: ${STAT}"

The value returned should offer a clue as to what is really the problem.

If it ain't broke, I can fix that.
Randy Brown_1
Frequent Advisor

Re: Trouble Moving and copying files on NFS mounted FS

The UIDs and GUIDs are the same across the board.

I will check the perms on the original mount point on the server.

The storage is an iscsi SAN that is connected to two clustered hosts running Centos 5 and it's clustering suite to serve the NFS mounts to our network.

The client machines are a mixture of RHEL 3, 4, 5 and HP-UX 11i, 10.20 (I know, that should be offline. I'm trying. ;-) )and Solaris 7 and 8.
Randy Brown_1
Frequent Advisor

Re: Trouble Moving and copying files on NFS mounted FS

More info.

Here is the relevant entry from /etc/exports

/rfcdata clifford(rw,no_root_squash) frisky(rw,no_root_squash)

This are the perms on the mount point on the server:
drwxr-xr-x 2 root root 1024 Nov 27 09:11 rfcdata

The perms for the client side mount point are:
drwxr-xr-x 2 root sys 96 Nov 27 11:09 rfcdata

There is a directory under /rfcdata called archived which has these perms:

drwxrwxrwx 34 bjackson users 3864 Dec 12 08:57 archived

Using 777 here just for toubleshooting. I would normally set this to 755.
Dennis Handly
Acclaimed Contributor

Re: Trouble Moving and copying files on NFS mounted FS

---------- 1 bjackson users 0 Dec 7 15:31 xmrg072000WG.tar

Is this the tarfile he is extracting from?
Or does your tape tar file contain sub-tar files?

>The directory structure is created and the file name is created, but every file is "0" bytes and has no permissions,
>but I cannot mv or cp files to this filesystem from anywhere without having the above described problems.

This is odd. If you can't create a file, you shouldn't be able to create a directory either.

You don't have a bad umask of 777 do you?
A. Clay Stephenson
Acclaimed Contributor

Re: Trouble Moving and copying files on NFS mounted FS

You should still run the cp command and report the exit status ${?} because that will reveal much about the underlying problem.
If it ain't broke, I can fix that.
Randy Brown_1
Frequent Advisor

Re: Trouble Moving and copying files on NFS mounted FS

umask is set correctly. I have nfs mounts coming from another source that work fine.

The tape contains tar files, .Z files, .gz files, among other things.

The user could not directly extract the tape's data to the nfs mounted /rfcdata file system. So, he is extracting the tape to another location and then trying to copying/mv to the /rfcdata partition. cp, mv, and the tape extraction to /rfcdata give the permission denied error.

I am now going to run a cp, and a tape extraction and will report the exit status "${?}" to this.

Thanks,
Randy
Randy Brown_1
Frequent Advisor

Re: Trouble Moving and copying files on NFS mounted FS

Here is the output of an attempted copy:

[clifford_bjackson]$cp -rp /fs/hdsb6/histdata/rfcdata_temp/200112 .
cp: cannot create ./200112/abrfc/data/db_tables/grum/grum122001AB.tar: Permission denied
cp: cannot create ./200112/abrfc/data/db_tables/hdpradar/HDPradar122001AB.Z: Permission denied
cp: cannot create ./200112/abrfc/data/db_tables/loc/LOCATION.122001AB.tar: Permission denied
cp: cannot create ./200112/abrfc/data/db_tables/radarloc/RADARLOC.122001AB.tar: Permission denied
...
"[clifford_bjackson]$STAT=${?}"
[clifford_bjackson]$echo "Status: ${STAT}"
Status: 130


Here is the output of a tape extraction attempt to this same file system:

[clifford_bjackson]$pwd
/rfcdata/archived/200202
[clifford_bjackson]$tar xvpf /dev/rmt/0m
Tar: blocksize = 1
tar: rfcdata5/abrfc/data/grum02122002AB.Z - cannot create
tar: rfcdata5/abrfc/data/CO022002AB.tar - cannot create
tar: rfcdata5/abrfc/data/HDPradar022002AB.Z - cannot create
tar: rfcdata5/abrfc/data/LOCATION.02122002AB.Z - cannot create
tar: rfcdata5/abrfc/data/RADARLOC.02122002AB.Z - cannot create
x rfcdata5/abrfc/data/SiiSTAT022002AB.Z, 654351 bytes, 1279 tape blocks
tar: chown failed: Not owner
x rfcdata5/abrfc/data/vl022002AB.Z, 45620037 bytes, 89102 tape blocks
tar: chown failed: Not owner
tar: rfcdata5/abrfc/data/FFGBIN1.022002AB.12Z.tar - cannot create
tar: rfcdata5/abrfc/data/FFGBIN3.022002AB.12Z.tar - cannot create
...

[clifford_bjackson]$cd rfcdata5/abrfc/data
[clifford_bjackson]$ll
total 90664
-r--r--r-- 1 bjackson users 0 Dec 13 07:39 CO022002AB.tar
-r--r--r-- 1 bjackson users 0 Dec 13 07:52 FFGBIN1.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 07:52 FFGBIN3.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 07:52 FFGBIN6.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 07:49 HDPradar022002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 07:49 LOCATION.02122002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 07:49 RADARLOC.02122002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 07:53 Si022002ABraw.tar
-rw-r--r-- 1 bjackson users 654351 Apr 23 2002 SiiSTAT022002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 07:52 Siii022002AB.tar
-r--r--r-- 1 bjackson users 0 Dec 13 07:39 grum02122002AB.Z
-rw-r--r-- 1 bjackson users 45620037 Apr 5 2002 vl022002AB.Z
"[clifford_bjackson]$ STAT=${?}"
[clifford_bjackson]$echo "Status: ${STAT}"
Status: 0

Interestingly enough, the two files that generated the "chown failed" message, have content and have the correct permissions.

Same test as previous but without the "p" in the tar command.
[clifford_bjackson]$tar xvf /dev/rmt/0m
Tar: blocksize = 1
tar: rfcdata5/abrfc/data/grum02122002AB.Z - cannot create
tar: rfcdata5/abrfc/data/CO022002AB.tar - cannot create
tar: rfcdata5/abrfc/data/HDPradar022002AB.Z - cannot create
tar: rfcdata5/abrfc/data/LOCATION.02122002AB.Z - cannot create
tar: rfcdata5/abrfc/data/RADARLOC.02122002AB.Z - cannot create
x rfcdata5/abrfc/data/SiiSTAT022002AB.Z, 654351 bytes, 1279 tape blocks
x rfcdata5/abrfc/data/vl022002AB.Z, 45620037 bytes, 89102 tape blocks
tar: rfcdata5/abrfc/data/FFGBIN1.022002AB.12Z.tar - cannot create
tar: rfcdata5/abrfc/data/FFGBIN3.022002AB.12Z.tar - cannot create
tar: rfcdata5/abrfc/data/FFGBIN6.022002AB.12Z.tar - cannot create
tar: rfcdata5/abrfc/data/Siii022002AB.tar - cannot create
tar: rfcdata5/abrfc/data/Si022002ABraw.tar - cannot create
"[clifford_bjackson]$STAT=${?}"
[clifford_bjackson]$echo "Status: ${STAT}"
Status: 130
[clifford_bjackson]$cd rfcdata5/abrfc/data/
[clifford_bjackson]$ll
total 90664
-r--r--r-- 1 bjackson users 0 Dec 13 08:16 CO022002AB.tar
-r--r--r-- 1 bjackson users 0 Dec 13 08:24 FFGBIN1.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 08:24 FFGBIN3.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 08:24 FFGBIN6.022002AB.12Z.tar
-r--r--r-- 1 bjackson users 0 Dec 13 08:20 HDPradar022002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 08:20 LOCATION.02122002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 08:20 RADARLOC.02122002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 08:24 Si022002ABraw.tar
-rw-r--r-- 1 bjackson users 654351 Apr 23 2002 SiiSTAT022002AB.Z
-r--r--r-- 1 bjackson users 0 Dec 13 08:24 Siii022002AB.tar
-r--r--r-- 1 bjackson users 0 Dec 13 08:16 grum02122002AB.Z
-rw-r--r-- 1 bjackson users 45620037 Apr 5 2002 vl022002AB.Z


The "p" doesn't seem to have made any difference, although the status value changed.

I hope this is helpful. Maybe it's the tapes?

Thanks,
Randy




OldSchool
Honored Contributor

Re: Trouble Moving and copying files on NFS mounted FS

"clifford_bjackson]$pwd
/rfcdata/archived/200202
[clifford_bjackson]$tar xvpf /dev/rmt/0m
Tar: blocksize = 1
tar: rfcdata5/abrfc/data/grum02122002AB.Z - cannot create
tar: rfcdata5/abrfc/data/CO022002AB.tar - cannot create"

Ok...you do realize you've been looking at the permissions in the wrong directory all along don't you?

all of your efforts noted previously have been directed at rfcdata/archive?????

the archive appears to want to write to rfcdata5/abrfc/data and doesn't have permissions to that, it doesn't exist or some such.

tar -tvf on the archive. it's probably got an absolute path. In which case, if you want to restore it somewhere else, it needs to be recreated w/ relative paths