Samba
Samba is a re-implementation of the SMB/CIFS networking protocol, an MS Windows alternative to NFS.
Contents |
Installation
Kernel
You need to activate the following kernel options:
File Systems --->
[*] Network File Systems --->
[*] CIFS support (advanced network filesystem, SMBFS successor)--->
[*] CIFS Statistics
[*] Extended Statistics
[*] CIFS Extended Attributes
[*] CIFS POSIX Extentions
Software
If you don't really want the full samba package, you can install only the net-fs/cifs-utils package:
root # emerge --ask cifs-utilsUsage
When your client is fully configured, you can access the shares like this:
Create the mount point
root # mkdir -p /mnt/My-Disk/{Media,Shared}Mount the exported folders
root # mount.cifs //O2-Foobar/Media /mnt/My-Disk/Media -o guestroot # mount.cifs //O2-Foobar/Shared /mnt/My-Disk/Shared -o guestIf you want to automatically mount your shares on every boot, then edit your fstab to look like this:
//O2-Foobar/Media /mnt/My-Disk/Media cifs guest //O2-Foobar/Shared /mnt/My-Disk/Shared cifs guest
Troubleshooting
The following problems may pop up when trying to mount your shiny new CIFS shares:
Cannot resolve <server-name>
And more specifically, the actual error looks like this
root # mount.cifs ...
"mount error: could not find target server. TCP name foo/bar not found. No ip
address specified and hostname not found"
This can easily be fixed by editing /etc/nsswitch and appending wins next to hosts entry
hosts: files dns wins
If this does not work, you can use the NFS server's IP address instead of the O2-Foobar hostname. You can use the nmblookup utility (provided by net-fs/samba) to find out the IP address of an NFS host
root # nmblookup O2-FoobarIn case your system fails to shutdown or reboot properly, then you need to make sure you umount the cifs shares before udev tries to stop.
The easy way is to create a local.d script:
root # echo "umount -a -t cifs -f" > /etc/local.d/cifs.stop