LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2019, 04:49 AM   #1
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Rep: Reputation: 2
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?
 
Old 05-07-2019, 05:06 AM   #2
fred44nl
Member
 
Registered: Aug 2018
Location: the Netherlands
Distribution: Debian 9 - Stretch
Posts: 34

Rep: Reputation: Disabled
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
 
Old 05-07-2019, 05:24 AM   #3
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by fred44nl View Post
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.
 
Old 05-07-2019, 05:46 AM   #4
fred44nl
Member
 
Registered: Aug 2018
Location: the Netherlands
Distribution: Debian 9 - Stretch
Posts: 34

Rep: Reputation: Disabled
you are in an encrypted volume
most likely, that the problem lies there.
when copying, did you use sudo or su ??
 
Old 05-07-2019, 05:50 AM   #5
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Klaas Vaak View Post
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>
 
Old 05-07-2019, 06:18 AM   #6
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by Klaas Vaak View Post
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.
 
Old 05-07-2019, 06:34 AM   #7
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by fred44nl View Post
you are in an encrypted volume
most likely, that the problem lies there.
when copying, did you use sudo or su ??
sudo
 
Old 05-07-2019, 06:35 AM   #8
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by dc.901 View Post
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.
 
Old 05-07-2019, 06:45 AM   #9
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by ehartman View Post
What kind of file system is that USB stick?
ext4
 
Old 05-07-2019, 07:46 AM   #10
Walman
Member
 
Registered: Jun 2004
Location: Venezuela
Distribution: RHEL ,Ubuntu, Slax, Kali
Posts: 95

Rep: Reputation: 15
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.
 
Old 05-07-2019, 10:31 AM   #11
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Walman View Post
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.
 
Old 05-08-2019, 06:26 AM   #12
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by Klaas Vaak View Post
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?
 
Old 05-08-2019, 06:31 AM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
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.
 
Old 05-08-2019, 07:01 AM   #14
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by dc.901 View Post
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.

Last edited by Klaas Vaak; 05-08-2019 at 07:05 AM.
 
Old 05-08-2019, 07:03 AM   #15
Klaas Vaak
Member
 
Registered: Feb 2019
Distribution: Mint
Posts: 253

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by hydrurga View Post
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.

Last edited by Klaas Vaak; 05-08-2019 at 07:05 AM. Reason: used dc91 instead of dc.901
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Root ownership vs wheel ownership StupidNewbie Linux - Security 2 08-08-2012 12:52 PM
Cannot change ownership jamaso Slackware 11 11-08-2010 11:01 AM
Howto change the ownership of mounted smb resource?? sys7em Linux - Newbie 4 12-23-2004 02:48 PM
change ownership Johng Linux - General 4 04-06-2004 02:24 AM
How can an ordinary user change a file's ownership? garymansell Red Hat 1 04-01-2004 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration