LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Change ownership (https://www.linuxquestions.org/questions/linux-software-2/change-ownership-4175653475/)

Klaas Vaak 05-07-2019 04:49 AM

Change ownership
 
Linux Mint 19.1 XFCE

I have a bunch of folders with files inside that reside in a VeraCrypt volume. I want to copy them all to a USB stick in order to paste them on another computer. A straight copy/paste does not work because permission is denied. I am the only user of the computer, and the user/owner has read/write permission.

I have tried
Code:

sudo chown -R 777 path/to/VC/directory
but nothing happens. I also tried it with "chmod", nothing happens.

The only way I can do the copy procedure is if I open a file manager as root on the source computer and the same for pasting on the receiving computer. But the I can only use the file if I open the file manager as root, which is not the right way to go about this.

I am probably doing something wrong, so how can I achieve the permission change?

fred44nl 05-07-2019 05:06 AM

you are using the wrong command.
what you need is chmod

Code:

sudo chmod -R 777 path/to/VC/directory
https://ss64.com/bash/chmod.html

Klaas Vaak 05-07-2019 05:24 AM

Quote:

Originally Posted by fred44nl (Post 5992494)
you are using the wrong command.
what you need is chmod

Code:

sudo chmod -R 777 path/to/VC/directory
https://ss64.com/bash/chmod.html

I stated that I tried the "chmod" way too, but nothing happens.

fred44nl 05-07-2019 05:46 AM

you are in an encrypted volume
most likely, that the problem lies there.
when copying, did you use sudo or su ??

dc.901 05-07-2019 05:50 AM

Quote:

Originally Posted by Klaas Vaak (Post 5992499)
I stated that I tried the "chmod" way too, but nothing happens.

Please define "nothing happens". When chmod command runs successfully, it will not have any output.

And, if you don't want to change permissions, you can also use

Code:

sudo cp <source> <destination>
sudo rsync <options> <source> <destination>


ehartman 05-07-2019 06:18 AM

Quote:

Originally Posted by Klaas Vaak (Post 5992490)
I want to copy them all to a USB stick in order to paste them on another computer.

What kind of file system is that USB stick?
Note that "Windows" type of fs'es (FAT, NTFS) do not have the concept of "ownership", the owner of the directory and files will be the mounting ID (unless specified different as an option). And there is an attribute for readonly/readwrite, but as there's no owner/group/world concept none for group/others and no X-bits either. All those are simulated at the mount.

So for FAT/NTFS: use i.e. -o uid=<your ID number>,fmask=0133 as mount options.

Klaas Vaak 05-07-2019 06:34 AM

Quote:

Originally Posted by fred44nl (Post 5992501)
you are in an encrypted volume
most likely, that the problem lies there.
when copying, did you use sudo or su ??

sudo

Klaas Vaak 05-07-2019 06:35 AM

Quote:

Originally Posted by dc.901 (Post 5992502)
Please define "nothing happens". When chmod command runs successfully, it will not have any output.

And, if you don't want to change permissions, you can also use

Code:

sudo cp <source> <destination>
sudo rsync <options> <source> <destination>


True, the cp command worked.

Klaas Vaak 05-07-2019 06:45 AM

Quote:

Originally Posted by ehartman (Post 5992511)
What kind of file system is that USB stick?

ext4

Walman 05-07-2019 07:46 AM

you need to make sure that your USB stick is mounted. Once you have done this, you should be able to run the command you are trying to run.

Klaas Vaak 05-07-2019 10:31 AM

Quote:

Originally Posted by Walman (Post 5992529)
you need to make sure that your USB stick is mounted. Once you have done this, you should be able to run the command you are trying to run.

The USB stick gets mounted automatically when I plug it in. I can do the copy command, but not the permissions change.

dc.901 05-08-2019 06:26 AM

Quote:

Originally Posted by Klaas Vaak (Post 5992574)
The USB stick gets mounted automatically when I plug it in. I can do the copy command, but not the permissions change.

In your original post, I see:

Quote:

I want to copy them all to a USB stick in order to paste them on another computer. A straight copy/paste does not work because permission is denied.
So, my question is, do you still need to change permissions since you were successful in copying files to USB?

If so, are you able to change permission of files that were copied to USB?

hydrurga 05-08-2019 06:31 AM

Assuming that the user number (UID) is the same on your source and target machines (which it will probably be for a single-user system, i.e. 1000), all you need to do is ensure that the USB stick's filesystem (ext4) is also fully owned by your user (using chown -R). You can then use it to transfer files from one machine to the other to your heart's content.

Klaas Vaak 05-08-2019 07:01 AM

Quote:

Originally Posted by dc.901 (Post 5992873)
So, my question is, do you still need to change permissions since you were successful in copying files to USB?

If so, are you able to change permission of files that were copied to USB?

No, I don't need to change permissions anymore in this particular case, and yes, I am able to change permission of the copied files, which are now residing in a VeraCrypt container on the new laptop :)
Many thanks for your help.

Klaas Vaak 05-08-2019 07:03 AM

Quote:

Originally Posted by hydrurga (Post 5992874)
Assuming that the user number (UID) is the same on your source and target machines (which it will probably be for a single-user system, i.e. 1000), all you need to do is ensure that the USB stick's filesystem (ext4) is also fully owned by your user (using chown -R). You can then use it to transfer files from one machine to the other to your heart's content.

As you can see from reply to dc.901, I am OK now. You may be right that the ownership of the USB stick might not have been right. What is important for me, for future reference, is that I am able to change ownership and permission, using the right syntax. Many thanks for your help.


All times are GMT -5. The time now is 11:17 AM.