Basic file sharing using nemo

I used ‘gnome-disk-utility’ to mount the partition and each time I changed the ‘Identify As’ it added a new line! (I thought it would overwrite the previous entry?) I since removed all the lines related to that partition and now there is only one.

Before I completely change the way to mount the partition as per your instruction, I wanted to try one more thing.
I had a thought - as sharing the ‘Home’ folder works perfectly fine, what if I mount the partition under ‘/home/my-username/Datalaptop’ instead of /mnt/Datalaptop? So I tried that and it worked!
Now when I connect from the desktop to ‘home’ on the laptop I also have ‘Datalaptop’ (as a sub-folder of home)!
I’m glad after all that time and trying many permutations, It finally works.
But I’m annoyed that I could not get it to work under /mnt/ and I don’t know why???

Because you should never use /mnt as starting point for your persisting mount points - when using a system folder it is almost certain that you will get permission issues.

Why is it that you ask for help and when given instructions that work you do something completely different?

You just got lucky - you have not learned how to do it right…

1 Like

It’s been app 6 weeks since I first ask for help with sharing across the network. You provided links to ‘How to’ posts. I read them several times (and many others)
Samba and the ‘sharing thing’ was new to me so I took some time to understand the concept. I tried many suggestions, but just never got it (the sharing part) to work. I suspect it’s an issue with permissions and/or ownership… I also read the excellent very concise and detailed article by ‘Aragorn’ on “Understanding and working with UNIX filesystems and permissions” I learned quite a bit, but my problem is ‘retention’… I take notes and bookmark articles, but I’m just a home user, I don’t work in IT, I don’t manage a server, etc…
Anyway, you’re right the mounting using ‘.mount files’ is superior to using ‘fstab’ so I gonna undo the sharing and mounting of ‘Datalaptop’ and use your instruction to mount and then share ‘Datalaptop’
If you could just clarify a few points in your instruction:

  1. The ‘a’ in /a/Datalaptop is just a folder under root? I can give it an other mane like ‘data’
  2. In smb.conf ‘CHAMEU’ is just your suggestion for the name of the workgroup? and the text in the ‘server string’ is just a description of the share? and I can use something else?

As I said I’m just a home user - so I would like to have full permission and ownership of both computers ‘Home’ partitions and the mounted ‘Datalaptop’ partition when shared. So should I have ‘guest ok = yes’? thanks

Yes.
/a is a directory under / which you create - use any other name you like

/a/Datalaptop is a subdirectory - also one which you create - use any other name you like

Hi aarhus,
I followed the first part of your instruction changing only /a/Datalaptop to /Data/Datalaptop
I had 2 issues

  1. When creating the mount unit
touch /etc/systemd/system/ Data-Datalaptop.mount

I expected it to be in /etc/systemd/system/ but it was not there? I found it in /home/my-username/ Is that what was expected? Anyway, I opened the empty file and added the text as per your instructions.

  1. When doing point 6 ‘Start the mount unit’ I got an error message ‘file not found’ I sort off expected that as I could not find the file in that location!
    I then moved the .mount file to etc/systemd/system/ and run the command again - this time I had no error.

When I look in nemo I can’t see the folder ‘Data’ or ‘Datalaptop’ on the left pan nor under ‘home’ I do find it under ‘File System’ and I can access the content on the laptop - so the mounting part seems to be Ok.
In relation to the sharing part, the modification of ‘smb’

  1. do i have to change the ‘global section’ on both the laptop and desktop (server and client) how about the ‘home section’? and do I leave the ‘printer sections’ as is?
    Thanks

should be

touch /etc/systemd/system/Data-Datalaptop.mount

my fault - I didn’t notice the space - not even when proof reading - my output error

Yes, because there is a space in there, which means that touch — or any other command — will see that as being two separate targets, the second one being in the current working directory.

If you want to include spaces in filenames or path names, then you must escape them, either by typing a backslash (“\”) in front of the space, or by enclosing the whole string in quotes.

Hi aarhus, The mounting part of your instructions worked fine (after I moved the .mount file to where it should have been /etc/systemd/system/) I can access it on the laptop on /Data/
But the sharing part doesn’t? I changed the smb.conf as per your instruction in point 7
The only 2 changes I did to your instructions were:
in [global] I left workgroup = WORKGROUP
in [Datalaptop] i changed path = /Data/Datalaptop
everything else (except for [home]) I commented out with #

 
[global]
   workgroup = WORKGROUP
   Server string = workgroup samba service
  #dns proxy = no
   log file = /var/log/samba/%m.log
   max log size = 50
  #client min protocol = SMB3
   server role = standalone server
  #passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
   pam password change = yes
   map to guest = Bad Password
  #usershare allow guests = yes
  #name resolve order = lmhosts bcast host wins
  #security = user
   guest account = nobody
  #usershare path = /var/lib/samba/usershares
  #usershare max shares = 100
  #usershare owner only = yes
  #force create mode = 0070
  #force directory mode = 0070
  #load printers = no
  #printing = bsd
  #printcap name = /dev/null
  #disable spoolss = yes
  #show add printer wizard = no

[homes]
   comment = Home Directories
   browseable = yes
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S

#[printers]
  #comment = All Printers
  #browseable = no
  #path = /var/spool/samba
  #printable = yes
  #guest ok = no
  #read only = yes
  #create mask = 0700

#[print$]
  #comment = Printer Drivers
  #path = /var/lib/samba/printers
  #browseable = yes
  #read only = yes
  #guest ok = no

[Datalaptop]
    comment = Share of datelaptop from x230
    path = /Data/Datalaptop
    browseable = yes
    read only = no
    guest ok = no
    inherit permissions = no

After the changes, I could no longer access the laptop’s ‘home’ from the desktop

 smb://WORKGROUP;jp@192.168.178.38/jplaptopx230/

nor could I share ‘Datalaptop’
I reinstated the un-modified smb.conf and sharing of [home] works again
maybe I misunderstood and I was not meant to comment out everything else? can you advice?
I guess I can always edit the mounting from /Data to /home/username/Data as I did before.
Thanks

Usually you won’t need to share the complete home folder - only a few relevant folders - and even that can be quite dangerous - if one hit delete while on the wrong folder.

If it is relevant it can be achieved by creating folder in the share tree, share the folder and inside the folder create symbolic link to the home folders - again - assuming it is a single user system.

For multi user one should really be careful with the permissions.

I hear your warning - I promise to be careful. You may have mist it, but in my initial post I said that I am the only user of both computers

In hindsight ‘Samba shares’ was probably overkill! all I needed was a way to synchronize a few directories in the home folder and access that ‘Data’ partition that still eludes me!
But now that I have ‘Samba’ working and the default smb.conf works at least to share [homes], I keep trying (hopefully with some help from this forum) to share that Data partition. Help please… Thanks

I remember that - especially the partner part - and Windows 11 - which will require you to create an additional user on your manjaro system, to be able to share files to your partning.

You can create a user which only has access to the samba share by being a member of smbusers group.

sudo useradd -G smbusers <windows-username>
sudo smbpasswd -a <windows-username>

I may have another option for you.

I’ve long kept my devices synchronized using samba and grsync (a GUI front-end for rsync). It works, but it is far more than what I need, and thus, complexifies what should be a simple task.

In short, it seemed like using an excavator when all I need to do is transplant a few bulbs.

Earlier this week, due to coverage of a new release, I learned about syncthing. Also this week, I added (yet another) laptop to the fleet. So it seemed like a good time to try something new.

Last night I spent a few minutes—maybe an hour—installing Syncthing, then a few hours watching it sync several terabytes over the LAN to the new-to-me laptop. While that was happening, I added my existing two laptops and watched them scan their drives, then sync a handful of files each.

Just marvelous!

What I have are needs similar to yours:

  • I’m the only one who ever uses my computers. No heavy security requirements.
  • I don’t particularly need to open files from another device. I only want to keep things synchronized so I always have the most-recent copy on every device.
  • When I add or change a file anywhere, it gets synced everywhere with a minimum of fuss and without me having to remember what I added or changed and where.
  • I don’t have to have every device on, any two at a time will do. Asynchronous syncing, as it were.

What I don’t have for you is a step-by-step recipe for setting this up. Sorry.

I have only about a hour’s worth of actual experience it setting it up. I made, and recovered from, a few mistakes along the way. Mainly misinterpreting stuff. I’m not sure if it’s set up optimally for my needs, and I haven’t explored all its options.

Yet—yet, it still works well enough that if I were to do nothing else (Ha! Like that could happen.) it meets my requirements.

I also don’t have a Windows box in the house, but Syncthing has versions for Windows, Mac and interestingly, Android.

The Android version will get some attention here because I’ve found syncing my photos with KDE Connect to be tedious. I currently sync my pictures through ProtonDrive, (part of the Proton VPN family, not to be confused with the Proton that gamers use). Which, although simple on the phone end, still requires me to remember to transfer the photos on the PC end. And I’ve been copying music to the phone with a USB cable.

Anyway, what I offer is another avenue of investigation.

syncthing is in the official repositories (Extra) and the documents are here: Welcome to Syncthing’s documentation! — Syncthing documentation

Thanks Brucew, looks interesting I will check it out and see if it can do what I’m looking for.

The windows 10/11 sharing is of low priority and not essential, I haven’t even tried to share windows yet - I want to get sharing between Linux working correctly before I even consider sharing with windows…
I have tried many permutation of smb.conf, I followed examples from this forum and other sources, but nothing works! it’s very frustrating given that sharing the ‘Home’ folder seems to works fine?? So why can’t I get sharing working without mounting under ‘Home’??
if I do

/Data/Datalaptop 

it doesn’t work! depending which way I try to connect, it’s either ‘folder does not exist’ or ‘you have no permission to access…’
both folder Data and Datalaptop are owed by my user ‘jp’ and have read, write and execute permissions??

if I do

/home/jp/Data/Datalaptop

it works - I can access Data/Datalaptop as a sub-folder of home!

Are there any logs or terminal command results I could upload to the forum so you could see any clues to what is wrong??

I can only offer some advice based upon pure logic and my experiences at using Windows 3.11 on MS-DOS 6.22 at work in 1995, whereby we used two Samba shares on a UNIX (OSF/1) midrange server.

As I understand it, you will need to define the second share separately, because DOS/Windows needs to assign a separate drive letter to each.

Also, if Windows is not an issue — but it does appear to be a consideration in your case — then the better way to set up a network share would be by way of nfs, which is the UNIX-native way of setting up a file server.

I cannot say why it does not work on your system.

Do you by any chance have apparmor enabled in the default grub cmdline? I recall it was default added at some point.

Or have setup selinux on your system ?

Both can interfere with sharing.

I can replicate a working installation at will and my guides has been created from my notes - they have been tested from scratch using raspberry pi test devices running Manjaro Linux ARM - so I know the basic configuraton works.

I recently banged my head at Samba using a Fedora server - I found that I had to configure selinux to be able access the shares - that made me go back to using Manjaro on my server.

Fedora is the iteration before RedHat Enterprise - so I understand their need to use selinux to harden the services.

I completely fail to don’t understand why you cannot get it work …

If you could provide (it will print the permissions on the content of the folder)

ls -la /Data

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.