Operating System - Linux
1752796 Members
5722 Online
108789 Solutions
New Discussion юеВ

failed to preserve ownership operation not permitted.

 
yogesh kumar_2
Frequent Advisor

failed to preserve ownership operation not permitted.

Hi i have written one backup script in linux workstation.The backup script will do zipping files and moved to the backup directory(i,e /net/ts-bcn/sb_backup/sand).

#So while moving zipped files to the backup directory i am getting some error like this

error:mv:failed to preserve ownership /net/ts--bcn/sb_backup/sand operation not permitted.

8 REPLIES 8
Suraj K Sankari
Honored Contributor

Re: failed to preserve ownership operation not permitted.

Hi,

This is a HP forum so better ask only HP related questions.

For your script check with proper permission is there or not to zipping those files.

Suraj
Matti_Kurkela
Honored Contributor

Re: failed to preserve ownership operation not permitted.

The /net/ in the directory path suggests that NFS might be involved.

Even if you are running the script as root on the local host, your root privileges may not apply to NFS-mounted directories: normally the NFS server maps the root user of the NFS client machine to "nobody" or "nfsnobody" user, which has no privileges at all.

When your script is moving the file to the NFS-mounted directory, the file ownership will change. At the end of the move operation, the mv command will attempt to set the ownership and permissions back to the original values - but setting the ownership fails because the NFS server won't allow the "nfsnobody" to do that.

MK
MK
yogesh kumar_2
Frequent Advisor

Re: failed to preserve ownership operation not permitted.

ya i am getting the file owner and group owner as nfsnobody for the zipped files.

Is there any other way to prevent that error while moving zipped files to the /net directory.
Dennis Handly
Acclaimed Contributor

Re: failed to preserve ownership operation not permitted.

>Is there any other way to prevent that error

By exporting with root as root option: root=
yogesh kumar_2
Frequent Advisor

Re: failed to preserve ownership operation not permitted.

Before zipping the files are belongs to the particular user.

# F.own G.own file name
for ex: rajiv users ras_record.c
Dennis Handly
Acclaimed Contributor

Re: failed to preserve ownership operation not permitted.

>Before zipping the files are belongs to the particular user.

The user that is running the backup script?
Does that user/group exist on the NFS server?

You may just want to give this up and tar the zipped file. That way it remembers the original owner.
yogesh kumar_2
Frequent Advisor

Re: failed to preserve ownership operation not permitted.

I have written a script as a user(yogesh), after that i copied the file from yogesh user to root user.I changed the ownership as user=root group=root
Johnson Punniyalingam
Honored Contributor

Re: failed to preserve ownership operation not permitted.

Hi Yogesh,

I strongly agree with "Dennis" reply , had some experience , like this before "after Creating "User & group" on the NFS Server ,
file's carried their approperiate "Owner & rights"



must recommended action would be (create user & group on the NFS Server,
)

Thanks,
Johnson
Problems are common to all, but attitude makes the difference