Mounting SMB drives

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Mounting SMB drives

Postby rodgoslin » Jun 3rd, '17, 04:01

I feel that I've been here before. I need to mount two external devices to my machine running Mga6rc. It's not difficult, I've done it many times. But problems cropped up im Mga 5. This is done in Network Sharing, in the Control Centre, Access Windows (SMB) shared drives. Find servers will (usually) find any drives on the system. Clicking on a drive, brings up the setup. Select a mount point (Usually defined) then, in Options, enter the user name and password. It's at this point were the problem lay in Mga5. There was no option to enter a password, and without it, the drive would not be mounted. oddly, it only affected x86-64 systems. In 32 bit systems the password option was there.
The change, I gathered, was that the password was in clear, in /etc/fstab. So a change was made to have the password entered in a different location only readable by root. All well and good. Unfortunately, in 64 bit machines. the required changes to create this was not implemented, but were in 32 bit machines. So, the old system was gone and there was no new system to replace it. Getting to the point, when I tried this in Mga6rc, it didn't work in 32 bit machines either. I can't, at this point say that it doesn't work in 64 bit machines, since none of them have yet been upgraded. I worked it out on Mga 5 by looking at how it had been implemented for 32 bit, and manually added/edited the required files in /etc and /etc/samba, and it worked. Whether it still works is another matter
I'm, at this point, not sure that this is the place to put this post, or whether to submit it as a bug
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby doktor5000 » Jun 3rd, '17, 23:12

Well, the part about the password has not been fixed, see e.g. https://bugs.mageia.org/show_bug.cgi?id=16185#c12
Not sure what you are referring about "manually added/edited the required files in /etc and /etc/samba"

As an alternative, if you don't need the drives to be mounted during bootup, why not just set up connections to those via your file manager, e.g. dolphin works just fine for that.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mounting SMB drives

Postby rodgoslin » Jun 3rd, '17, 23:49

As Mga 5 the entry for such mounts in fstab which used to end with the username= and password=, have been replaced with:-
Code: Select all
//drobo-fs/Public /mnt/Public cifs credentials=/etc/samba/auth.drobo-fs.'someusername' 0 0
//transporter/Transporter /mnt/Transporter cifs credentials=/etc/samba/auth.transporter.'someusername' 0 0

/etc/samba has the two files quoted, which contain two entries username= someusername and password=somepassword. These two files are read/write only to root. With the absence in share smb drives, of an option to add the passwords, this file structure is not created. If memory serves me correctly, in the absence of this, the user is prompted, at bootup, for the password(s). Since the idea of the change is to keep the identity of the passwords hidden, there is no point in having the user to enter the very password the change is meant to hide.
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 00:59

Well, nothing is simple. The solution to this problem seemed to be to simply copy the existing entries in fstab, on one of the Mga5 machines onto the Mga 6 machine, and the two auth* files similarly into /etc/samba. I did this copy/paste via a thumb drive, so, no typo's. Set all required ownership and permissions. Running mount -a failed to mount the two drives, as did a re-boot. I'll have look for the boot log and see how it failed. In Mga5, I did have one instance that worked, and copying this to all the other machines, they too worked, but here I've no working example to copy. Unless I'm missing something, the required protocol for mounting external drives, in this manner, seems to have changed from Mga5 to Mga6.
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby doktor5000 » Jun 4th, '17, 01:19

I think you're overcomplicating this quite a bit. You can also directly add username and password directly in fstab, instead of the credentials stanza (which points to a file that contains exactly the same information, although with the added benefit that you can set that to read/write only for root, whereas fstab is also readable by others, hence other users on the machine could read the plaintext passwords).

Also, it does not matter where the credentials file is located, also it does not have to have the hostname or the username as part of its filename. And it most certainly should not have single quotes as part of the filename. Just read the first part of the mount.cifs man page on that. And there's not really a special protocol for mounting, the mount command is just a wrapper for the actual mount commands like mount.cifs in your case.

And if you cannot do a mount -a to mount the drives then surely they will not be mounted during boot. Best just as root do a
Code: Select all
mount -v /mnt/Public
mount -v /mnt/Transporter

and post the complete output here (minus sensible information like password/username)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 01:32

OK, here's the boot.log file from the working Mga5 machine, where all is well for mounting the two SMB drives:-
Code: Select all
[rod@up log]$ more boot.log

Welcome to Mageia 5!

[  OK  ] Reached target Login Prompts.
[  OK  ] Set up automount Arbitrary Executable File Formats File System Automount Point.
[  OK  ] Reached target Encrypted Volumes.
         Expecting device dev-disk-by\x2duuid-d8ecff33\x2dcc51\x2d4995\x2da028\x2ddc16668959c4.d
evice...
         Expecting device dev-disk-by\x2duuid-944bcb55\x2d44df\x2d4560\x2db986\x2d4a18bc540a86.d
evice...
         Expecting device dev-disk-by\x2duuid-bfcfa9b1\x2d5a12\x2d4e59\x2d96e7\x2da8bbddfecc9f.d
evice...
[  OK  ] Created slice Root Slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Delayed Shutdown Socket.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Listening on Journal Socket.
[  OK  ] Created slice System Slice.
         Mounting RPC Pipe File System...
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-systemd\x2dfsck.slice.
         Starting Remount Root and Kernel File Systems...
         Mounting Temporary Directory...
         Starting Create list of required static device nodes for the current kernel...
         Mounting Huge Pages File System...
         Mounting POSIX Message Queue File System...
         Mounting Debug File System...
         Starting Load Kernel Modules...
         Starting udev Coldplug all Devices...
         Starting Setup Virtual Console...
         Starting Load legacy module configuration...
         Starting Journal Service...
[  OK  ] Reached target Slices.
[  OK  ] Mounted RPC Pipe File System.
[  OK  ] Mounted Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted Temporary Directory.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Create list of required static device nodes for the current kernel.
[  OK  ] Started Load Kernel Modules.
[  OK  ] Started udev Coldplug all Devices.
         Starting udev Wait for Complete Device Initialization...
         Starting Apply Kernel Variables...
         Starting Configure read-only root support...
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
         Starting udev Kernel Device Manager...
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Setup Virtual Console.
         Starting Show Plymouth Boot Screen...
[  OK  ] Started Load legacy module configuration.
[  OK  ] Started Show Plymouth Boot Screen.
[  OK  ] Started Configure read-only root support.
         Starting Load/Save Random Seed...
[  OK  ] Reached target Sound Card.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Found device ST3000DM001-1ER166 5.
         Activating swap /dev/disk/by-uuid/d8ecff33-cc51-4995-a028-dc16668959c4...
[  OK  ] Found device ST3000DM001-1ER166 7.
         Starting File System Check on /dev/disk/by-uuid/944bcb55-44df-4560-b986-4a18bc540a86...

[  OK  ] Activated swap /dev/disk/by-uuid/d8ecff33-cc51-4995-a028-dc16668959c4.
[  OK  ] Reached target Swap.
[  OK  ] Found device ST3000DM001-1ER166 6.
         Starting File System Check on /dev/disk/by-uuid/bfcfa9b1-5a12-4e59-96e7-a8bbddfecc9f...

[  OK  ] Started File System Check on /dev/disk/by-uuid/944bcb55-44df-4560-b986-4a18bc540
a86.
         Mounting /home...
[  OK  ] Started File System Check on /dev/disk/by-uuid/bfcfa9b1-5a12-4e59-96e7-a8bbddfec
c9f.
         Mounting /home2...
[  OK  ] Mounted /home2.
[  OK  ] Mounted /home.
[  OK  ] Started udev Wait for Complete Device Initialization.
         Starting Wait for storage scan...
[  OK  ] Started Wait for storage scan.
[  OK  ] Reached target Local File Systems.
         Starting Tell Plymouth To Write Out Runtime Data...
         Starting Reconfigure the system on administrator request...
         Starting Save boot dmesg content...
[  OK  ] Started Tell Plymouth To Write Out Runtime Data.
Starting netprofile:  [  OK  ] Started Save boot dmesg content.
The default is the current profile.
--More--(42%)                                                                                  [
Checking for new hardware[  OK  ] Started Journal Service.
         Starting Trigger Flushing of Journal to Persistent Storage...
[   12.440887] systemd-fsck[632]: /dev/sda7: clean, 70590/134217728 files, 482402373/536869881 b
locks
[   12.441072] systemd-fsck[638]: /dev/sda6: clean, 4416/45473792 files, 156887021/181863351 blo
cks
[  OK  ] Started Trigger Flushing of Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Initialization.
[  OK  ] Reached target Paths.
[  OK  ] Listening on RPCbind Server Activation Socket.
[  OK  ] Listening on CUPS Scheduler.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Timers.
         Starting Manage Sound Card State (restore and store)...
[  OK  ] Started Manage Sound Card State (restore and store).
[  OK  ] Reached target System Time Synchronized.
 -More--(55%)                                                                                  [
[  OK  ] Started Reconfigure the system on administrator request.
[  OK  ] Reached target Basic System.
         Starting Daemon for power management...
         Starting Adapt Mageia theme to the monitor resolution...
         Starting ACPI Event Daemon...
         Starting Configure CPU power related settings...
         Starting Daemon which manages cryptographic hardware tokens for the openCryptoki packag
e...
         Starting Login Service...
         Starting LSB: Nameserver information manager...
         Starting Avahi mDNS/DNS-SD Stack...
         Starting D-Bus System Message Bus...
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
         Starting Network Service...
         Starting iptables Firewall for IPv4...
         Starting ip6tables Firewall for IPv6...
[  OK  ] Started ACPI Event Daemon.
[  OK  ] Started Configure CPU power related settings.
[  OK  ] Started LSB: Nameserver information manager.
[  OK  ] Started Daemon for power management.
[  OK  ] Started Login Service.
         Starting irqbalance daemon...
[  OK  ] Started irqbalance daemon.
[  OK  ] Started Adapt Mageia theme to the monitor resolution.
[  OK  ] Started Daemon which manages cryptographic hardware tokens for the openCryptoki
package.
[  OK  ] Started ip6tables Firewall for IPv6.
[  OK  ] Started iptables Firewall for IPv4.
         Starting LSB: Bring up/down networking...
[  OK  ] Started Network Service.
[  OK  ] Started LSB: Bring up/down networking.
         Starting Network Name Resolution...
         Starting LSB: Checks if a partition is close to full up...
         Starting LSB: Enables MSEC security policy on boot...
[  OK  ] Started LSB: Enables MSEC security policy on boot.
[  OK  ] Started Network Name Resolution.
[  OK  ] Started LSB: Checks if a partition is close to full up.
         Starting Initialize hardware monitoring sensors...
[  OK  ] Started Initialize hardware monitoring sensors.
         Starting Sensor Information Logging...
         Starting LSB: Locks NumLock key at init runlevel change...
[  OK  ] Started LSB: Locks NumLock key at init runlevel change.
         Starting LSB: Wait for the hotplugged network to be up...
[  OK  ] Started Sensor Information Logging.
[*     ] A start job is running for LSB: Wait for the hotplugged network to be up (18s
[  OK  ] Started LSB: Wait for the hotplugged network to be up.
[  OK  ] Reached target Host and Network Name Lookups.
         Starting NFSv4 ID-name mapping daemon...
[  OK  ] Reached target Network.
         Starting Shorewall IPv6 firewall...
         Starting Xinetd A Powerful Replacement For Inetd...
         Starting Dropbear SSH Server Daemon...
         Starting Shorewall IPv4 firewall...
         Starting MySQL database server...
         Starting PostgreSQL database server...
         Starting RPC bind service...
         Starting CUPS Scheduler...
[  OK  ] Reached target Network is Online.
         Starting OpenSSH server daemon...
         Mounting /mnt/Transporter...
         Mounting /mnt/Public...
[  OK  ] Started Xinetd A Powerful Replacement For Inetd.
[  OK  ] Started Dropbear SSH Server Daemon.
[  OK  ] Started OpenSSH server daemon.
[  OK  ] Started NFSv4 ID-name mapping daemon.
[  OK  ] Started RPC bind service.
         Starting NFS file locking service....
[  OK  ] Reached target RPC Port Mapper.
[  OK  ] Started NFS file locking service..
[  OK  ] Reached target Network File System Client and Server Support.
[  OK  ] Mounted /mnt/Public.
[  OK  ] Mounted /mnt/Transporter.
[  OK  ] Reached target Remote File Systems.
         Starting The Apache HTTP Server...
         Starting Permit User Sessions...
         Starting Manage, Install and Generate Color Profiles...
[  OK  ] Started Permit User Sessions.
         Starting Command Scheduler...
[  OK  ] Started Command Scheduler.
         Starting Wait for Plymouth Boot Screen to Quit...
         Starting Display Manager...
[  OK  ] Started Display Manager.
[  OK  ] Started Manage, Install and Generate Color Profiles.
[  OK  ] Started PostgreSQL database server.
[  OK  ] Started CUPS Scheduler.
         Starting Make remote CUPS printers available locally...
[  OK  ] Started Make remote CUPS printers available locally.
[  OK  ] Started The Apache HTTP Server.


And here's a section of the boot.log file from the mga6 machine, and it's suggestion to run systemctl :-

Code: Select all
[  OK  ] Reached target Remote File Systems (Pre).
         Mounting /mnt/Public...
         Mounting /mnt/Transporter...
[FAILED] Failed to mount /mnt/Public.
See 'systemctl status mnt-Public.mount' for details.
[DEPEND] Dependency failed for Remote File Systems.
[FAILED] Failed to mount /mnt/Transporter.
See 'systemctl status mnt-Transporter.mount' for details.
         Starting Permit User Sessions...
         Starting The Apache HTTP Server...
[  OK  ] Started Permit User Sessions.
[root@thinkpad log]# systemctl status mnt-Public.mount
● mnt-Public.mount - /mnt/Public
   Loaded: loaded (/etc/fstab; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2017-06-03 23:35:58 BST; 29min ago
    Where: /mnt/Public
     What: //drobo-fs/Public
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1689 ExecMount=/usr/bin/mount //drobo-fs/Public /mnt/Public -t cifs -o credentials=/etc/samba/auth.drobo-fs

Jun 03 23:35:58 thinkpad systemd[1]: Mounting /mnt/Public...
Jun 03 23:36:04 thinkpad mount[1689]: mount: wrong fs type, bad option, bad superblock on //drobo-fs/Public,
Jun 03 23:36:04 thinkpad mount[1689]:        missing codepage or helper program, or other error
Jun 03 23:36:04 thinkpad mount[1689]:        (for several filesystems (e.g. nfs, cifs) you might
Jun 03 23:36:04 thinkpad mount[1689]:        need a /sbin/mount.<type> helper program)
Jun 03 23:36:04 thinkpad mount[1689]:        In some cases useful info is found in syslog - try
Jun 03 23:36:04 thinkpad mount[1689]:        dmesg | tail or so.
Jun 03 23:35:58 thinkpad systemd[1]: mnt-Public.mount: Mount process exited, code=exited status=32
Jun 03 23:35:58 thinkpad systemd[1]: Failed to mount /mnt/Public.
Jun 03 23:35:58 thinkpad systemd[1]: mnt-Public.mount: Unit entered failed state.


Sorry, the single quotes were merely to indicate a substitution for the actual entry. I do believe I tried the old way in Mga5 but it did not work. . Which is why I went for the new option (credentials). The filename structure, I understand is just to relate the particular file to the particular drive, for the human eye.
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 01:54

The latest developments. I decided to go back to the beginning, and start again, the 'proper' way. In the SMB drive share option in the Control Centre, the Drobo option was persistent in it's absence. This is nothing new, the search servers option frequently fails to find things, going back some years. But it did find the transporter. Going through the whole process, password excepted, ends in an option to add the details to /etc/fstab. All very normal. A search in fstab certainly found an appropriate entry, but less the password option. Again, nothing unusual. The mount -a option, as I recall will call for any required password on processing the command. However, on this occasion the mount failed in EXACTLY the same fashion, with the same dialogue, as the entry with the Credentials option. From this, can I assume that the SMB drive share is broken, and to mount an SMB drive is not possible?
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby doktor5000 » Jun 4th, '17, 12:07

Well, do you have mount.cifs installed at all ?

doktor5000 wrote:Best just as root do a
Code: Select all
mount -v /mnt/Public
mount -v /mnt/Transporter

and post the complete output here (minus sensible information like password/username)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 21:19

what/where is mount.cifs?
Note, since the 'search servers' option in Windows Shares did not find the Drobo-fs, but did find the Transporter, there's no entry for this in fstab. Hence the failure for this device. The error message that derived for the Transporter, is the same for all attempts to mount this drive.

Code: Select all
[code][rod@thinkpad ~]$ su
Password:
[root@thinkpad rod]# mount -v /mnt/Public
mount: can't find /mnt/Public in /etc/fstab
[root@thinkpad rod]# mount -v /mnt/Transporter
mount: wrong fs type, bad option, bad superblock on //transporter/Transporter,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
[root@thinkpad rod]#
[/code]
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 21:39

Further research. No, there is no mount.cifs in /sbin. How does one add it?
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 22:10

More research. I found out the how, from a Ubuntu forum question. It comes with cifs-utils. Installed that. /sbin now has mount.cifs. That changed the error messages, to a problem with the address. An old friend, this one. Mageia, in setting up the fstab entry uses the devices name rather than its IP address. I have a standard /etc/hosts file for my entire LAN. Copied that over, and all is fine. The command mount -v /mnt/Transporter worked. It did ask for the password, which given resulted in a successful mount. Presumably then, writing an entry into fstab for the drobo-fs, either in password free style, or in the old clear password style, or in the newer 'Credentials' style will work, too. [Sigh] On to the next problem, then.
Last edited by rodgoslin on Jun 4th, '17, 22:50, edited 1 time in total.
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 22:15

Just a thought. I've just had a look into /sbin on one of the Mga5 machines. That does not have /sbin/mount.cifs, but the mount command still works. if mount.cifs is the critical factor in Mga6, should cifs-utils not be in the list of default installs?
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31

Re: Mounting SMB drives

Postby doktor5000 » Jun 4th, '17, 22:55

Why should it be in the default install, not everyone needs CIFS mounts. If you go by that logic one could put each and every package in the default install by the logic "maybe somebody might need it some time".
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18056
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mounting SMB drives

Postby rodgoslin » Jun 4th, '17, 23:39

I've amended the /etc/fstab file in the 'Credentials' fashion (As is the norm in my other machines) to mount the Drobo and Transporter on boot. Unmounting the Transporter, and removing it's command line from fstab, and then executing the command mount -a, successfully mounted both. A quick look confirmed that they were there and could be navigated. I'll close the thread in a while.
rodgoslin
 
Posts: 523
Joined: Nov 19th, '11, 01:31


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron