Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: fstab syntax with mounting network cifs drives

  1. #1

    Default 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:
    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.

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    23,048

    Default Re: fstab syntax with mounting network cifs drives

    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)

  3. #3
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,086

    Default Re: fstab syntax with mounting network cifs drives

    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

  4. #4
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    11,210

    Default Re: fstab syntax with mounting network cifs drives

    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!

  5. #5

    Default Re: fstab syntax with mounting network cifs drives

    Quote Originally Posted by DenverD View Post

    .. . .[blahblah],gid=users,comment=systemd.automount 0 0
    .. . .[blahblah],comment=systemd.automount,gid=users 0 0
    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.

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    11,210

    Default Re: fstab syntax with mounting network cifs drives

    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!

  7. #7

    Default Re: fstab syntax with mounting network cifs drives

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

  8. #8
    Join Date
    Oct 2011
    Location
    California
    Posts
    41

    Default Re: fstab syntax with mounting network cifs drives

    Quote Originally Posted by DenverD View Post
    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 DD Caveat
    openSUSE®, the "German Engineered Automobiles" of operating systems!
    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?
    ASUS G73JH * Intel Core i7 Q740, 6GB DDR3 * ATI Radeon HD5870 * OpenSUSE 12.1/Gnome 3

  9. #9
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    616

    Default Re: fstab syntax with mounting network cifs drives

    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).

  10. #10
    Join Date
    Oct 2011
    Location
    California
    Posts
    41

    Default Re: fstab syntax with mounting network cifs drives

    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.
    ASUS G73JH * Intel Core i7 Q740, 6GB DDR3 * ATI Radeon HD5870 * OpenSUSE 12.1/Gnome 3

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •