Automatically mount a windows share at boot time with Linux
This document (7000932) is provided subject to the disclaimer at the end of this document.
Windows or Samba Share available on the network.
//<Winserver>/<Share> <Mountpoint> <FileSystemType> <Options> 0 0
Here's an example, setting the group ID and the permissions to allow those in the group users read and write access to the share:
//winserver/share /mnt/winshare cifs gid=users,file_mode=0664,dir_mode=0775,auto,username=john,password=johnpass 0 0
This example assumes the following values (includes explanation where needed):
//winserver/share (Windows Share)
The Windows system (winserver) could be identified as a DNS hostname or IP address.
/mnt/winshare (Mount Point)
This is the already existing directory on the SLED local file system which will become the access point to the remote Windows share. It can be created anywhere on the system; modify the command appropriately.
cifs (File System Type)
This used to be smbfs but the smbfs module is no longer being developed and is no longer supported.
All files and directories on the remote system (including the mount point) will be assigned the group users.
All existing files on the remote system will be assigned permissions of rw-rw-r--.
All existing directories (including the mount point) on the remote system will be assigned rwxrwxr-x.
Automatically mount on system boot.
Windows user to connect with: john
John's Password: johnpass
Indicates that this file system should not be dumped.
Indicates that this file system should not be checked by fsck.
If the share is not getting mounted, try to mount the share manually, as the root user, to see if there are any errors. Here's the command:
mount -t cifs -o username=<WindowsUserID>,password=<UserPassword> //<WinServer>/<Share> /<Mountpoint>
Following our example:
mount -t cifs -o username=john,password=johnpass //winserver/share /mnt/winshare
If the password is omitted from the mount command it will be asked for after issuing the command.
The following 2 lines should be in the credential text
file (replacing <bracketed> items with your
On SLES10, the package samba-client needs to be installed manually and started on bootup to mount Samba-shares automatically on boot.
This can be achieved by running the following commands:
# zypper in samba-client
# insserv smbfs
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7000932
- Creation Date: 15-Jul-2008
- Modified Date:03-Mar-2020
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: email@example.com