$sudo mv /mnt/disk/dir/* /mnt/disk/dir2/ Operation not allowed

Status
Not open for further replies.

JSunny

Cadet
Joined
Oct 14, 2014
Messages
9
Dear Community,

i moved to FreeNAS and enjoyed the encryption feature so far.
Now, i try to reorder my stuff in new ZFS Datasets. I tried to move over the shell files within on disk but somehow i am not allowed to do so as root. "Operation not allowed", "Permission error"

The dir has root:wheel.

I never saw such an error message with a root user :D
Could someone help me?

Thank you for your help.

best regards
JSunny
 
L

L

Guest
Yea, i know how you feel... not really root if it won't let you things :)

My guess is you are trying to change or move the name of the dataset itself. Can you give us a sampling of command?
 

JSunny

Cadet
Joined
Oct 14, 2014
Messages
9
hmm...
e.g.
$sudo mv /mnt/disk/dir/* /mnt/disk/dataset/

where the disk is the overall (volume) dataset and dataset is ... a dataset :)
 
Last edited:
L

L

Guest
what happens if you go into the /mnt/disk/dataset and just try to touch a file? $sudo touch file
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I tried to reproduce this and couldn't get it to give me operation not permitted. Could you give use the output of an "ls -l" on the dir, dataset and files? I suspect there might be acl's on the dataset?
 
L

L

Guest
would it just be a typo? should it be

instead of

$sudo mv /mnt/disk/dir/* /mnt/disk/dataset/

$sudo mv /mnt/disk/dir/* /mnt/disk/dir/dataset/
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
The problem is probably because you are trying to move files from a dataset that uses unix permissions to one that uses ACLs. Because of how ACLs work (and the fact that unix permissions will clobber ACLs) it is expressly forbidden to allow that. So you get an operation not permitted after the move command finishes moving the file and tries to match the permissions.

The files will effectively be 'copied' to the destination with the ACLs being 'whatever they will be for conditions'.

For example, if you are moving files from a dataset that is UNIX type to one that is of Windows type, you will get these errors.
 

JSunny

Cadet
Joined
Oct 14, 2014
Messages
9
thanks for all of your input:

Linda Kateley, Yesterday at 6:17 PM
what happens if you go into the /mnt/disk/dataset and just try to touch a file? $sudo touch file


[root@storage] /mnt/main/DATASET# sudo touch test
Sorry, user root is not allowed to execute '/usr/bin/touch test' as root on storage.local.​

without sudo works fine.

[root@storage] /mnt/main/DIR# touch test
[root@storage] /mnt/main/DIR#https://forums.freenas.org/index.php?members/sweetandlow.34238/


SweetAndLow, Yesterday at 7:05 PM
I tried to reproduce this and couldn't get it to give me operation not permitted. Could you give use the output of an "ls -l" on the dir, dataset and files? I suspect there might be acl's on the dataset?


[root@storage] /mnt/main/DIR# ls -l
total 583
drwxrwxrwx 29 root wheel 30 Oct 16 00:58 ./
drwxr-xr-x 15 root wheel 15 Oct 16 00:53 ../
drwxrwxrwx 15 root wheel 15 Oct 16 00:57 test3/


[root@storage] /mnt/main/DATASET# ll
total 60
drwxrwxr-x+ 7 root wheel 8 Oct 16 00:57 ./
drwxr-xr-x 15 root wheel 15 Oct 16 00:53 ../
-rw-r--r-- 1 root wheel 0 Oct 14 14:53 .windows
drwxrwxr-x+ 2 root wheel 3 Oct 16 00:54 test/
drwxrwxr-x+ 2 root wheel 3 Oct 16 00:54 test3/
Linda Kateley, Yesterday at 8:53 PM
would it just be a typo?


hmm.. no i tripple checked it.

cyberjock, Today at 1:16 AM
The problem is probably because you are trying to move files from a dataset that uses unix permissions to one that uses ACLs. Because of how ACLs work (and the fact that unix permissions will clobber ACLs) it is expressly forbidden to allow that. So you get an operation not permitted after the move command finishes moving the file and tries to match the permissions.
The files will effectively be 'copied' to the destination with the ACLs being 'whatever they will be for conditions'.
For example, if you are moving files from a dataset that is UNIX type to one that is of Windows type, you will get these errors.


yeah, that could actually be the case. Very interesting. I noticed this also when using wget /mget that files would be copied but not removed.
but when i use my laptop (via Windows) with Strg +x & Strg+v it works fine. Probably, because of a different protocoll?

Is there a way simulate a "mv" over different permission sets? something like "cp + rm" ? :D
Or can i simple change the permission set of the volume without loosing any data?

thank you all!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I had to do this with 11TB of data for a friend last weekend. The only way I know of is to copy the data from source to destination, then delete the original copy. Unfortunately he only had like 6TB of free space, so I had to copy his data in chunks. Instead of it being a single command that would finish in 10 hours or so it took 4 days and about 30 commands. :(

There is a way to force the dataset to change, but its very hacky and not something I'd recommend for someone that isn't an expert with ACLs. Even I didn't do it, if that's any consolation.
 
Status
Not open for further replies.
Top