LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   CIFS not automounting at boot (https://www.linuxquestions.org/questions/linux-networking-3/cifs-not-automounting-at-boot-564195/)

mattd7591 06-24-2007 03:36 PM

CIFS not automounting at boot
 
Just recently my CIFS shares in fstab are not being automounted at boot. However it does mount if I use mount -a as root.
It was working fine unil recently, Im not sure if it happened after an update.

I am using Debian Lenny
Here is my fstab

Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
/dev/sda2      /              ext3    defaults,errors=remount-ro 0      1
/dev/hda4              none              swap  sw              0      0
/dev/hdc        /media/cdrom0  udf,iso9660 user,noauto    0      0
/dev/hdd        /media/cdrom1  udf,iso9660 user,noauto    0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0      0

#Windows
/dev/sda1      /mnt/windows    ntfs    ro,noauto      0      0

#Removable devices
/dev/hdc        /media/cdrom0  udf,iso9660 user,noauto    0      0
/dev/hdd        /media/cdrom1  udf,iso9660 user,noauto    0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0      0

/dev/sdb1      /media/usb0    auto    rw,noauto,user, 0      0
/dev/sdc1      /media/usb1    auto    rw,noauto,user, 0      0

#Samba Shares
#//ALLOFUS/MUSIC                /mnt/music      smbfs  user,ro,auto,username=matt,password=linux,uid=matt,gid=matt    0      0
#//ALLOFUS/MSD          /mnt/msd        smbfs  user,rw,auto,username=matt,password=linux,uid=matt,gid=matt    0      0
#//DEBRA-PC/Public      /mnt/mom        smbfs  user,ro,auto,username=matt,password=linux,uid=matt,gid=matt    0      0
#//ALLOFUS/backupmsd    /mnt/backupmsd  smbfs  user,rw,auto,username=matt,password=linux,uid=matt,gid=matt    0      0

#cifs Shares
ALLOFUS:MUSIC          /mnt/music      cifs    user,ro,auto,pass=a,noperm,uid=matt,gid=matt    0      0
ALLOFUS:MSD            /mnt/msd        cifs    user,ro,auto,pass=a,noperm,uid=matt,gid=matt    0      0
DEBRA-PC:Public        /mnt/mom        cifs    user,ro,noauto,pass=a,noperm,uid=matt,gid=matt  0      0
ALLOFUS:backupmsd      /mnt/backupmsd  cifs    user,ro,auto,pass=a,noperm,uid=matt,gid=matt    0      0

I am aware the samba section is commented out, it is old.

jschiwal 06-24-2007 05:02 PM

Try adding the "_netdev" option.
quote from man mount:
Quote:

_netdev

The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).
Quote:

I am aware the samba section is commented out, it is old.
The cifs filesystem is superceding the smb filesystem. You could delete the commented lines. There are some more options listed in "man cifs.mount" that you might find useful:
Code:

credentials=filename
  specifies a file that contains a username and/or password. The format of the file is:

            username=value
            password=value
  This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab.
Be sure to protect any credentials file properly.

uid=arg
  sets the uid that will own all files on the mounted filesystem.  It may be specified as
either a username or a  numeric uid. This parameter is ignored when the target server
supports the CIFS Unix extensions.

gid=arg
  sets the gid that will own all files on the mounted filesystem.  It may be specified as
either a groupname or a numeric gid. This parameter is ignored when the target server
supports the CIFS Unix extensions.

ip=arg
  sets the destination host or IP address.

domain=arg
  sets the domain (workgroup) of the user

port=arg
  sets the port number on the server to attempt to contact to negotiate CIFS support.
  If the CIFS server is not listening on this port or if it is not specified, the
  default ports will be tried i.e. port 445 is tried and if no response then port 139
  is tried.

Using a credentials file is better then putting the password in /etc/fstab.

If the owner of the files in the target system has their username/password setup the same using the smbpasswd program, maybe the uid and gid options aren't necessary, unless it is a fat32 filesystem being shared.

The ip= argument might help if the target services don't show up via browsing. This is like entering smb://192.168.1.100/allofus instead of smb://targetpc/allofus in konqueror. It is a bandaid approach if there is a browsing timeout problem. The IP addresses need to be persistant to be able to do this.

If the target share is on a Windows 98 computer, or if an XP host has the old style browsing system enabled, explicitly indicating port 139 might speed up the process.

Also make sure that the workgroup entry in smb.conf wasn't reset during an upgrade. I doubt that this is the case, since "mount -a" will work later on. That makes me think that it is a timing or timeout issue.

mattd7591 06-24-2007 08:34 PM

The password is fake so that doesn't matter
It is a fat32 being shared so uid and gid are needed, even though that doesn't work (something with unix extensions)
It does show up when browsing in Konqueror
smb.conf is for server, and right workgroup is set

Ill try the port 139

jschiwal 06-25-2007 12:28 AM

What about the "_netdev" option?

mattd7591 06-25-2007 08:46 AM

I don't see that in the manual page. How would I use this?

jschiwal 06-25-2007 09:24 AM

It is one of the generic options listed under -o description, before the filesystem specific options are listed.

You just include _netdev in the comma separated list of options in the /etc/fstab entry for the mount.

mattd7591 06-25-2007 09:27 AM

oh ok, I did a man mount.cifs, so that's why I didn't see it. I give that a try

mattd7591 06-25-2007 10:45 AM

Nope. I tried it and it still doesn't work

jschiwal 06-25-2007 11:58 PM

Try hitting the logs. The log entries from samba or dmesg may indicate what the problem is.


All times are GMT -5. The time now is 07:12 PM.