Samba allows to access data via a Windows drive. There are two ways: the shared drive can be on the Raspberry or on the Windows machine.
First samba needs to be added to the Raspberry https://www.raspberrypi.com/documentation/computers/remote-access.html#samba-smbcifs:
sudo apt install samba samba-common-bin smbclient cifs-utils
The configuration is in /etc/samba/smb.conf and can/should be verified with testparm
testparm -v -s returns all the global parameters without prompt for the dump
The Raspberry might run as server 24h a day whereas the window laptop might be turned on occasionally. So the Raspberry should host the shared network drive.
To let the Windows PC know what they will see modify /etc/samba/smb.conf to have something as:
workgroup = <RASPISERVERWORKGROUP>
sudo smbpasswd -a <username> is used to set a samba password for a user. Without samba passwords anonymous logn might work but access user home directories fail.
smbclient -L localhost -U% executed on the Raspberry will test the samba server without asking for a password. smbclient -L localhost will do the same but as user and asking for the samba password.
Finally there is also sudo smbstatus
It is more native to use NFS for Linux systems, but using samba might be a good test before trying to connect Windows to Linux.
If the two usernames (=sharenames) are the same, the users home directory on the samba server can be accessed by the client as: smbclient //192.168.1.<x>/<username>
A prompt appears were help list the commands, cd, ls lets browsing in the share names directory
mount -t cifs //192.168.1.<x>/<username> /mnt/<some name> -o uid=<n>, gid=<m>, username=<username>, password=<escaped password> mounts it
Passwords usually contain special characters as $, those characters need to be escaped as \$
umount /mnt/<some_name> unmounts it
Adding a share is straight forward, just adding ip address and sharename \\192.168.1.<x>\<username> as network drive or network address.
Adding a share is straight forward, just adding ip address and sharename \\192.168.1.<x>\<username> as network drive or network address.