fstab syntax with mounting network cifs drives

I have upgraded to OpenSUSE 12.1 and my network drives do not mount any more automatically. I can initiate the mount by “sudo mount --all” but I would like to bypass this step.

I had not heard of any differences from 11.4 to 12.1 regarding this until I saw this new article: openSUSE News regarding systemd configuration.

I also found this openSUSE:Systemd status - openSUSE which is great.

From both articles I gather that I need a line added to my /etc/fstab:

comment=systemd.automount

However I’m at a loss as to WHERE this is supposed to be added! Anywhere? At the end of each network drive line??

What is the proper syntax?

Currently my lines look like this:

//IP/folder/   /home/user/dir_private   cifs   credentials=/home/user/.scripts/.creds,_netdev,uid=username,gid=users   0 0
//IP/folder/ /home/user/dir_public cifs   guest,_netdev,uid=username,gid=users   0 0 

Thanks.

On 2011-12-30 01:46, kahu wrote:
> -However- I’m at a loss as to WHERE this is supposed to be added!

In the options field, separated with a comma from the others.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On Thu December 29 2011 06:46 pm, kahu wrote:

>
> I have upgraded to OpenSUSE 12.1 and my network drives do not mount any
> more automatically. I can initiate the mount by “sudo mount --all” but I
> would like to bypass this step.
>
> I had not heard of any differences from 11.4 to 12.1 regarding this
> until I saw this new article: ‘openSUSE News’
> (http://tinyurl.com/bw7gp9k) regarding systemd configuration.
>
> I also found this ‘openSUSE:Systemd status - openSUSE’
> (http://tinyurl.com/3g7kboh) which is great.
>
> From both articles I gather that I need a line added to my /etc/fstab:
>
> Code:
> --------------------
> comment=systemd.automount
> --------------------
>
>
> -However- I’m at a loss as to WHERE this is supposed to be added!
> Anywhere? At the end of each network drive line??
>
> What is the proper syntax?
>
> Currently my lines look like this:
>
> Code:
> --------------------
> //IP/folder/ /home/user/dir_private cifs
credentials=/home/user/.scripts/.creds,_netdev,uid=username,gid=users 0 0
> //IP/folder/ /home/user/dir_public cifs
guest,_netdev,uid=username,gid=users 0 0
> --------------------
>
> Thanks.
>
>
kahu;

This HowTo should be helpful to you in setting up your mount via fstab.
See: http://opensuse.swerdna.org/susesambacifs.html

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 12/30/2011 02:08 AM, Carlos E. R. wrote:
> In the options field, separated with a comma from the others.

like:

… . .[blahblah],gid=users,comment=systemd.automount 0 0
… . .[blahblah],comment=systemd.automount,gid=users 0 0


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

Great! That is very explicit and helpful to know exactly where to put it in-line with the other parts. I’ll try that.

I’ve been hearing more and more about /etc/mtab also lately. Should I be looking into that for any particular reason? I’m not familiar with what mtab is, or what the difference is between fstab and mtab (but I see it has some similar lines). From what I can gather it is the log notes of what is mounted through fstab, but is not intended to be added to.

On 12/30/2011 07:56 PM, kahu wrote:
>
> I’ve been hearing more and more about /etc/mtab also lately. Should I
> be looking into that for any particular reason? I’m not familiar with
> what mtab is, or what the difference is between fstab and mtab (but I
> see it has some similar lines). From what I can gather it is the log
> notes of what is mounted through fstab, but is not intended to be added
> to.

fstab is a plan laid prior to booting which outlines what should be
mounted–it changes only when you (or someone/thing) changes it…

on the other hand mtab is file which shows what is currently
mounted…so, if you look at mtab then manually mount a partition/drive
and look again it will have changed…

back in the old dayz (of last century) a ‘trick’ was to manually mount a
drive and then copy paste that drive’s mtab line into fstab, and on the
next boot the new line would cause the previously manually mounted drive
to be mounted during boot…


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

Thank you again, my last boot automounted my network drives!

Thank you! This solves one of the problems with my cifs mounts since I had to reinstall OpenSUSE the other day!

To make a short story long, I had to reinstall Windows on my dual-boot laptop a few days ago. Since my laptop lacked a normal setup disk, reinstalling Windows requires reimaging the entire hard drive. For whatever stupid reason, when I restored my Linux partitions after this (after I reinstalled GRUB), my computer wouldn’t boot (I’d get a blank screen with the word “GRUB” on it), so I had to reinstall OpenSUSE all over again. Not a big deal since I had a separate /home partition, and that restored okay. Anyway, my original OpenSUSE install was 12.1 beta 5 which I had zypper dup’d all the way through each update to RTM. I have a cifs mount which I had in my fstab, and never had a problem with it, until I had to reinstall.

The “comment=systemd.automount” trick worked to get my cifs mount working again, but I still have another related problem: The cifs drive does not show up on my desktop - at least, not without some prodding. I am running Gnome 3.2, with the file manager set to handle the desktop, so I can have desktop icons. I also have it set to show mounted drives, which used to include my cifs mount. Now, the mount doesn’t show up anywhere. In order to get it to appear, I have to open /etc/fstab and save it, which causes the icon to appear (and the corresponding notification that a removable drive had been mounted, with the option to view files or eject the drive). Mounting my Windows partition will also cause my cifs mount to show up, with the same notification.

Does anyone know what is causing this bizarre behavior, and - even better - how to fix it so my cifs mount shows up properly without prodding?

I could be completely wrong, as I have not tested this and have no MS systems on mmy network. But I have read/listned to the fstab man and systemd documentation at https://wiki.archlinux.org/index.php/Systemd#Automount.

I do not think that your cifs directory is being mounted at boot. Because it has an fstab entry it is offered for mount when you try to access it. Check this by examining /etc/mtab after boot and before accessing the cifs mount.

The raison d’être of systemd.automount appears to be to allow the boot process to proceed while a non-essential file system (such as /home) is undergoing fsck, being mounted once the check has completed. Routinely running fsck on a remote file system seems inappropriate and is disabled by the “0” in the sixth fstab field. Hence the mount will not occur at boot.

You could remove the comment=systemd.automount and place the cifs entry last in fstab to ensure that its mount attempt is after /home is available. Or make it user mountable and do whatever Gnome requires to mount after login (I am a KDE user where it would involve a one-liner in ~/.kde4/Autostart).

Thanks for the reply. What you say makes sense, particularly with the automount comment. I think the reason it’s working for me is that it delays the mount until my wireless network connection comes alive, whereas before it would attempt to mount the cifs share before the wireless connection was made and would silently fail.

I just rebooted and checked again – my cifs network share is being mounted and is immediately accessible upon boot. It’s listed in mtab, and everything shows up as it should at its assigned mount point. It’s just simply not showing up on the desktop, and doesn’t until I either touch /etc/fstab, mount my Windows partition, or plug in a thumbdrive. When I do any one of these things, the icon shows up, along with a notification from whatever handles removable devices. So this seems to be an issue with the removable devices handler not seeing the mounted cifs share until something else invokes the handler.

I really don’t know about this, but isn’t there something about lanman and nmb broadcasting available “shares” on TCP/IP port 445 or 139.

Could you do something like:
ls /home/user/dir_public > /dev/null
at login to silently force the initial connection?

On 01/01/2012 10:46 AM, briandoe wrote:
> It’s just simply not showing up on the desktop

i now assume that you think it should show up “on the desktop” at boot
up and i’m not sure that is a good assumption on your part…now, i’ve
never used gnome3 but i have heard it is kinda aimed at portable devices
(which i take to mean like small tablets or ‘smartphones’) and i’m not
certain the ‘old’ ideas of everything lying on the desktop ready to be
click accessed is necessarily a good thing to assume…

is it?

i mean, do each and every one of your hard drive partitions, inserted
smart cards, mounted USB drives, connected phones, USB keyboards, and
networked resources show up on the desktop at boots end???

that they can be user directed to the desktop i don’t doubt, but
should they all land on the desktop, in default gnome3 boot?

just asking.


DD
openSUSE®, the “German Engineered Automobiles” of operating systems!

All good questions. I do know that the Gnome developers have developed Gnome 3 with emphasis on a minimalist desktop and, if they have their way, they may one day eliminate the ability to have icons on the desktop. If that happens, I may well become a KDE convert. But for now, Gnome 3 does have the ability to have icons on the desktop, and there is a setting in the Gnome 3 Tweak Tool (Applications -> Accessories -> Advanced Settings -> Desktop) for showing mounted volumes on the desktop. As has always been the case with Gnome 2, this does not include mounted local Linux partitions, so there are no icons for my / and /home partitions, as they are accessible through the “Computer” and “File System” icons, but there is an icon for my local Windows partition.

On 01/01/2012 07:36 PM, briandoe wrote:
there is a setting in the Gnome 3 Tweak Tool (Applications ->
Accessories -> Advanced Settings -> Desktop) for showing mounted
volumes on the desktop.

mounted local and networked volumes?

i am asking because i don’t have a clue if it should show as you
expect or it if is a bug…maybe you have discovered a bug, in which
case you should document it here: openSUSE:Submitting bug reports - openSUSE Wiki

and, once you do maybe the devs can find a work-around for you, until
they solve the bug…

please return the bug number/URL to here so others who google in seeking
a fix will be able to find the bug and track its status…thanks in
advance.


DD http://tinyurl.com/DD-Caveat
openSUSE®, the “German Engineered Automobiles” of operating systems!

All removable volumes (CD’s, thumbdrives, etc). Windows partitions and network shares are regarded as removable volumes as far as this issue goes. Everything worked fine before I reinstalled OpenSUSE 12.1, so I’m thinking there was some difference between my previous installation, which started off from 12.1 RC1 Gnome Live CD and zypper-dup’d through RC2, Gold, up to current version, and what is currently offered in the installation DVD and Gnome Live ISOs.

Access Denied or Access Denied (Bugzilla burped and kept throwing gateway timeout errors as I tried submitting the report, so this managed to get entered twice).