INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Converting MC Win Setup To Linux, Synology  (Read 6629 times)

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Converting MC Win Setup To Linux, Synology
« on: May 19, 2017, 07:46:48 am »

An acquaintance of mine has a Synology server with a Windows share set up with all of his music on it, with a dedicated Windows laptop to play music (only) from the share using MC. He uses an I-Pad w/JRemote to control the laptop player, never touching the laptop unless reboot or other action is needed.

He is currently having issues with the little W10 laptop (good ol' updates, etc), and I would like to eventually convert his laptop to Linux for long term stability.

I am relatively new to Linux but have successfully installed Mint 18 and Ubuntu with MC a few times. I have  researched connecting with Windows shares via SMB, but can't seem to find a user friendly way to do it, especially for permanent connection.

He is a computer novice and had the server and laptop set up by other folks. If any changes to the server (such as share type) are needed I am hoping documentation is available for passwords, etc.

Any advice for either accessing Windows shares using Mint permanently, or would it be easier to possibly convert the Synology share config to type NFS, CIFS, or other for Linux access?

Thanks.
Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5241
  • "Linux Merit Badge" Recipient
Re: Converting MC Win Setup To Linux, Synology
« Reply #1 on: May 19, 2017, 08:34:54 am »

First, SMB shares are essentially CIFS shares (one is an implementation of the other), and they work perfectly fine on Linux; no need to alter a working system.  To permanently mount a NAS SMB share you want to add a single line to the client computer's /etc/fstab file.  I use this to mount SMB shares on my linux boxes on boot and it works a treat.  In outline you want a line like this

Code: [Select]
//ip.address.of.NAS/share_name   /local/mount_point   cifs   noauto,x-systemd.automount,credentials=/home/your_user/samba-credentials  0  0


To explain the syntax a little, the line is composed of six entries separated by spaces. The first entry is what is being mounted (i.e. the ip address of the NAS and the name of the share).  The second entry is where it's being mounted locally (i.e. something like /mnt/media).  You need to make sure the local mountpoint exists first (i.e. if /mnt/media is your mountpoint, make sure the directory /mnt/media already exists).  The third entry is the filesystem type of the mount (cifs). 

The fourth entry contains options separated by commas with no spaces after the commas.  These options automatically mount the share, but wait until something tries to access the share before mounting it.  This will make sure that the system doesn't try to mount the share before the network is up (for example), but is seamless to programs (i.e. the first program trying to access it after boot might experience a very brief delay on a normal network connection).  The last option points to a file containing the login credentials for the share.  If the share has no credentials (i.e. a guest share) remove that option.  If the share does have credentials, put your user's name in the path, and make a file in the user's home directory called "samba-credentials." In the file, put two lines like this, substituting the real credentials

Code: [Select]
username=your_username
password=your_password

The last two entries tell the system not to try and assess the validity of the share and not to wait for it to mount during boot.

There are other ways to do it, but this way is (in my experience) ironclad, and always puts the share in a predictable location on boot.

Here's some additional reference:
https://wiki.archlinux.org/index.php/Fstab
Logged

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: Converting MC Win Setup To Linux, Synology
« Reply #2 on: May 19, 2017, 08:39:50 am »

In all my years tinkering with Linux, that's the best explanation of how to mount a share folder I've ever read. Awesome stuff.

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Converting MC Win Setup To Linux, Synology
« Reply #3 on: May 19, 2017, 08:43:41 am »

Hear! Hear!

Thanks mwillems! I'll give it a shot at home tonight on my system. You folks are just plain awesome.....
Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5241
  • "Linux Merit Badge" Recipient
Re: Converting MC Win Setup To Linux, Synology
« Reply #4 on: May 19, 2017, 09:58:00 am »

Thanks for the kind words guys. 

In all my years tinkering with Linux, that's the best explanation of how to mount a share folder I've ever read. Awesome stuff.

In defense of your years of tinkering, the systemd automount option has only been around on most distros for three or four years. So this method didn't exist until recently (at least in Linux terms)  ;D
Logged

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Converting MC Win Setup To Linux, Synology
« Reply #5 on: May 20, 2017, 05:23:52 pm »

Works like a champ! Thanks again.
Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Converting MC Win Setup To Linux, Synology
« Reply #6 on: May 25, 2017, 08:29:02 am »

I have been tinkering with this a bit at home.

Although the "noauto" option is on, it appears my windows shares do in fact automount, since they show up as folders on the desktop after boot with no software attempting to access them. This works consistently.

Also, if my windows share computer is not on at time of boot, making shares unavailable, it not only takes longer to boot (expected), but my external USB drive does not auto-mount as it should, and it will not auto-mount even when unplugging/plugging in after Linux is loaded. If I comment out the relative fstab lines and reboot the USB drive works as it should.

I am using the latest Mint Cinnamon 18.1 64bit with all updates and default kernel.
Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5241
  • "Linux Merit Badge" Recipient
Re: Converting MC Win Setup To Linux, Synology
« Reply #7 on: May 25, 2017, 09:30:34 am »

I have been tinkering with this a bit at home.

Although the "noauto" option is on, it appears my windows shares do in fact automount, since they show up as folders on the desktop after boot with no software attempting to access them. This works consistently.

Also, if my windows share computer is not on at time of boot, making shares unavailable, it not only takes longer to boot (expected), but my external USB drive does not auto-mount as it should, and it will not auto-mount even when unplugging/plugging in after Linux is loaded. If I comment out the relative fstab lines and reboot the USB drive works as it should.

I am using the latest Mint Cinnamon 18.1 64bit with all updates and default kernel.

That's odd; I don't use Mint, and Gnome doesn't have a "desktop" that shows files, but my guess would be that your OS or file manager are essentially polling all drives at login, which is auto-mounting the shares at login, but not necessarily at boot.  I can think of a few ways to test that, but in any case that part sounds as though it's still working more or less as intended.

For the boot delay/failure to remount subsequently that's tougher.  For starters it shouldn't be delaying boot at all in any meaningful way (unless there's some odd interaction with trying to mount the USB drive).  If you have an fstab entry for the USB drive try adding these two options: x-systemd.device-timeout=2,nofail 

Those will tell the os not to worry about failing to mount it and try again later, and to only wait 2 seconds or so if it's not present.  If that resolves the boot delay when the smb shares are missing, it's clearly an interaction between mounting the usb drive and the smb shares.

If you haven't added the usb drive to the fstab, try adding those options to the samba mounts.  It should at least speed up the failure case.

For the usb drive failing to mount, that's indeed very odd.  Do you have it setup in the fstab to mount somewhere specific?  Or is the OS just auto-mounting it?  I ask because if the two mountpoints overlap that would obviously cause problems (i.e. if they both mount to the same point, or if the USB drive's mountpoint is inside the smb shares mountpoint).  When the USB drive is mounted successfully, where is it mounted? (if you're not sure how to answer that question, the output of the "lsblk" command when the USB drive is mounted should tell us)
Logged

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Converting MC Win Setup To Linux, Synology
« Reply #8 on: May 25, 2017, 02:35:59 pm »

Thanks for the quick response mwillems....

I already tried the device-timeout feature, and it helped with boot delay but the USB drive still doesn't auto-mount if the shares aren't available. I don't have an fstab entry for the USB drive, it's an os feature. The USB drive mounts under /media.

I can live with this hiccup for sure, as this little Lenovo 11E laptop is purely experimental and for learning use of MC with Linux. I have it set up dual boot with a fresh install of Win10, and Linux is set up for auto-login.

I am impressed with the stability and efficiency of using MC for music in Linux, highly recommended for running a simple music server or player, especially with a low power pc. It is really nice to have the USB Audio 2.0 driver available, all DAC's tested just "work" without hassling with 3rd party drivers. It would probably run uninterrupted until a failed piece of hardware, power, or other insurmountable issue arose not related to Linux or MC.

I have two separate lines in the fstab for mounting the shares in separate folders created under /home, so no conflicts there. I will add the USB drive mounting line as recommended.

I will be testing it more over the next week and advise.



Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.

Zhillsguy

  • Galactic Citizen
  • ****
  • Posts: 325
Re: Converting MC Win Setup To Linux, Synology
« Reply #9 on: June 06, 2017, 10:38:37 am »

As a follow up, I ended up using the following line in fstab:

//(server.ip.add)/sharename /home/username/Music cifs auto,user,credentials=/home/username/samba-credentials 0 0

With my set up it seems to work well. This mounts the music share in my system /Music folder so music apps see it by default. This auto-mounts the share, and if it isn't there no biggie. You can also substitute the server name for the ip address, and name the credentials file to something else so long as it matches what's in fstab.

Different distros (and flavors/versions thereof) operate differently. I would advise all fellow newbs to find one that works to your liking and stick with it. Updating to the latest and greatest version isn't always the best choice.

Case in point, I installed (added) XFCE desktop as a "lighter" option to Mint. XFCE doesn't auto-mount the USB drive at boot like Cinnamon, but there is a launcher on the desktop and it mounts if unplugged/plugged. I can't find any settings within XFCE to make it auto-mount. Minor hiccup, will figure it out.
Logged
Ryzen 5 W11 x64 MC 29 HTPC/Server and HP G2 Mini Elitedesk W11 MC 29 (music only zone), various Android Phones and Tablets for control of both, powering two lanai surround systems, 5.1 and 4.1 respectively.
Pages: [1]   Go Up