Links to all my notes (includes mini-projects and source code etc)
(+) 0001 How do I change the Pi System partition size ?
(+) 0100 Device tree settings
(+) 0201 Power over Ethernet - (PoE)
(+) 0202 Solar Power - (with WiFi)
(+) 0203 Power Bank pass through
(+) 0400 Accessing the SDHC card system image
(-) 0401 Accessing PC shares from the Pi
Mounting a network 'share' on the Pi
It is, apparently, quite possible to access a Windows PC 'share' from the Pi by simply 'mounting' it = and this is a LOT simpler than trying to install 'samba' and dealing with all the "Could not resolve 'mirrordirector.raspbian.org'" errors (which is required before you can see Pi shares on a PC)
You should, in fact, be able to 'mount' any existing 'share' on your LAN, including your NAS / Server 'back-up' folders etc.
You start by creating the 'share' on your LAN (eg 'share' a folder on your PC / NAS / Server). You will need to note the share name and the details of a user account (on the PC/NAS etc) that has access to the share.
At the Pi command line, start by creating a 'directory' to act as the mount point:- sudo mkdir mount-point-dir Now connect to the Windows share using the mount command:- sudo mount -t cifs -o username=username,password=password //server-name/share-name mount-point-dir NB. the PC's IP address can be used in place of 'server-name'
You can now treat the directory (mount-point-dir) just like any other folder on the Pi (ls to list the contents, cd to move to a different folder, cp to copy files etc.)
To unmount the Windows share, use the umount command: sudo umount mount-point .. or just reboot the Pi
If you want the 'share' to be mounted automatically after a re-boot (i.e. when you log on), you'll need to add the mount details to fstab :-
You need to create a mount point in /mnt for the PC share point. sudo mkdir /mnt/share-mount Now edit your fstab: sudo nano /etc/fstab Add a new entry in the following format: //pc-server/pc-share /mnt/share-mount cifs defaults,rw,username=pc-username,password=pc-user-password,domain=pc-workgroup-name 0 0Where : pc-server is the IP address (or NetBIOS name) of your PC, pc-share is the name of the share that you created on your PC share-mount is the name of the mount point you have just created. pc-username and pc-user-password are a valid account on the PC (that has access to the Windows share). The 'domain' is used the Windows domain or workgroup (i.e. not specifically a domain) = note this is required in fstab (a manual mount at the command line will work without the domain keyword)
To avoid rebooting, you can 'refresh' the shares from the command line :-
sudo mount -av
This note last modified: 17th Sep 2016 08:10.