mounting smb shares with WRITE capability [SOLVED]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

mounting smb shares with WRITE capability [SOLVED]

Post by lewtwo »

argh ....
All I want to do is backup some files from one computer to another and both are running Linux Mint 19.2

Target machine is //srv9521.local
Target share is /private
Target user is lewis (that would be me)
Target System folder
Target System folder
target system share
target system share
No matter what I do it tells me I do not have permission to write to a file, create or delete files:
I have tried both of the following ...

Code: Select all

sudo mkdir /mnt/private
sudo chmod 777 /mnt/private
sudo mount //srv9521.local/private /mnt/private -w -o username=$LOGNAME

sudo mkdir /media/$LOGNAME/private
sudo chmod 777 /media/$LOGNAME/private
sudo mount //srv9521.local/private /media/$LOGNAME/private -w -o username=$LOGNAME
result
result
A simple file share should not be this difficult and a read-only file system is the next thing to useless.
Last edited by lewtwo on Tue Nov 05, 2019 10:23 pm, edited 1 time in total.
"Engineering is the art of planning and forethought."
http://www.keywild.com
altair4
Level 20
Level 20
Posts: 10211
Joined: Tue Feb 03, 2009 10:27 am

Re: mounting smb shares with WRITE capability

Post by altair4 »

Seems to me you have two possible issues.

[1] Despite you issuing a sudo chmod 777 /media/$LOGNAME/private it's permissions are 755. That will happen if you are mounting a fat32 or ntfs partition and you didn't do it correctly.

[2] What is the relationship between $LOGNAME and the user:lewis. Only $LOGNAME can get to the "private" folder so unless the two are the same it's irrelevant what the permissions on "private" happen to be.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: mounting smb shares with WRITE capability

Post by lewtwo »

[2] What is the relationship between $LOGNAME and the user:lewis. Only $LOGNAME can get to the "private" folder so unless the two are the same it's irrelevant what the permissions on "private" happen to be.
They are the same .... I do not have multiple personality disorder.

FYI: The "data" partition is Ext4.
"Engineering is the art of planning and forethought."
http://www.keywild.com
User avatar
Larry78723
Level 8
Level 8
Posts: 2447
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: mounting smb shares with WRITE capability

Post by Larry78723 »

Try using this:

sudo mkdir /media/$USER/private
sudo chmod 777 /media/$USER/private
sudo mount //srv9521.local/private /media/$USER/private -w -o username=$USER

OR

sudo mkdir /mnt/$USER/private
sudo chmod 777 /mnt/$USER/private
sudo mount //srv9521.local/private /mnt/$USER/private -w -o username=$USER

Depending on where you want to mount it.
Image
altair4
Level 20
Level 20
Posts: 10211
Joined: Tue Feb 03, 2009 10:27 am

Re: mounting smb shares with WRITE capability

Post by altair4 »

And what does this do:

Code: Select all

sudo mount -t cifs //srv9521.local/private /media/$LOGNAME/private -o username=$LOGNAME,uid=lewis
A CIFS mount always mounts with owner=root. uid=lewis replaces root as owner with you.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: mounting smb shares with WRITE capability

Post by lewtwo »

altair4 wrote:
Tue Nov 05, 2019 6:46 pm
And what does this do:

Code: Select all

sudo mount -t cifs //srv9521.local/private /media/$LOGNAME/private -o username=$LOGNAME,uid=lewis
A CIFS mount always mounts with owner=root. uid=lewis replaces root as owner with you.

Code: Select all

$ sudo mount -t cifs //srv9521.local/private /media/$LOGNAME/private -o username=$LOGNAME,uid=lewis
[sudo] password for lewis:        
Password for lewis@//srv9521.local/private:  *******
$ ll /media/$LOGNAME/private/*
/media/lewis/private/backup:
total 167936
drwxr-xr-x 2 lewis root       0 Nov  5 13:54  ./
drwxr-xr-x 2 lewis root       0 Nov  5 13:57  ../
-rwxr-xr-x 1 lewis root    3389 Jul 31  2016  62-bluezhid2hci.rules*
-rwxr-xr-x 1 lewis root 2884321 Jul 26  2018  AA3_backup.pdf*
-rwxr-xr-x 1 lewis root   40628 Sep 26  2018  AA3.pdf*
-rwxr-xr-x 1 lewis root   12288 Jan 31  2019 'Affidavit Letter Blank.doc'*
-rwxr-xr-x 1 lewis root   12288 Jan 31  2019 'Affidavit Letter.doc'*
-rwxr-xr-x 1 lewis root  159516 Apr  8  2016  Amazon.pdf*
-rwxr-xr-x 1 lewis root  109177 Jul 16 13:36 'Amazon Return Label 1_backup.pdf'*
-rwxr-xr-x 1 lewis root  168898 Jul 16 13:36 'Amazon Return Label 1.pdf'*
....
That works ... thank thee :D
"Engineering is the art of planning and forethought."
http://www.keywild.com
User avatar
lewtwo
Level 3
Level 3
Posts: 177
Joined: Wed Oct 29, 2014 8:33 pm
Location: Houston, Texas

Re: mounting smb shares with WRITE capability

Post by lewtwo »

Larry78723 wrote:
Tue Nov 05, 2019 6:43 pm
Try using this:

sudo mkdir /media/$USER/private
sudo chmod 777 /media/$USER/private
sudo mount //srv9521.local/private /media/$USER/private -w -o username=$USER

OR

sudo mkdir /mnt/$USER/private
sudo chmod 777 /mnt/$USER/private
sudo mount //srv9521.local/private /mnt/$USER/private -w -o username=$USER

Depending on where you want to mount it.
Not much difference

Code: Select all

$ echo $USER
lewis
$ echo $LOGNAME
lewis
$ 
"Engineering is the art of planning and forethought."
http://www.keywild.com
Post Reply

Return to “Newbie Questions”