Red Hat - Mounting CIFS Filesystems

Using /etc/fstab

By creating entries in /etc/fstab you can mount CIFS filesystems automatically at boot time, or mount multiple CIFS file systems on one or more CIFS Servers, with a single command entered manually. The format for such entries is:

server:/share mount_point cifs defaults 0 0

Then, to mount all CIFS entries in /etc/fstab manually, enter:

$ mount -aF cifs

To unmount all currently mounted CIFS filesystems, enter:

$ umount -aF cifs

These commands will occur automatically, at bootup and shutdown, if the system is configured to start the CIFS Client at bootup, as explained above.

How to Mount and Login in One Step

The root user has the option to mount a CIFS filesystem and login to the CIFS Server in one step, obviating the need to explicitly issue the cifslogin command. Using the names from the examples above:

$ mount -F cifs -o username=x,password=y buildsys:/source home/dev1/source

where x and y are the name and password pair recognized by the server.