Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Installation of packages
- ```
- sudo apt-get install usbmount
- sudo apt-get install samba samba-common-bin
- sudo apt-get install ntfs-3g
- ```
- ### Setup Samba
- ```
- sudo vi /etc/samba/smb.conf
- ```
- Add the below configuration at the end of the file. Not secure as the below share drives as universal (rwx)
- ```
- # usbmount - /media share
- [USBDrives]
- Comment = RPI
- Path = /media
- Browseable = yes
- Writeable = Yes
- only guest = no
- create mask = 0777
- directory mask = 0777
- Public = yes
- Guest ok = yes
- ```
- #### Setup samba user and restart the service
- ```
- sudo smbpasswd -a pi
- sudo /etc/init.d/samba restart
- ```
- ### USBMount configuration
- Edit `udevd.service` to modify the `MountFlags`
- under `[Service]` change `MountFlags=shared` from `MountFlags=slave`
- ```
- sudo vi /lib/systemd/system/systemd-udevd.service
- ...
- MountFlags=shared
- ```
- Below configuration required to mount the drives under default `pi` user
- `FILESYSTEMS` to include `ntfs fuseblk`, `FS_MOUNTOPTIONS` to update `uid,gid,fmask,dmask`
- ```
- sudo vi /etc/usbmount/usbmount.conf
- FILESYSTEMS="vfat ext2 ntfs fuseblk ext3 ext4 hfsplus"
- #FS_MOUNTOPTIONS="-fstype=ntfs-3g,nls=utf8,uid=1000,gid=1000,dmask=0000,fmask=0000 -fstype=fuseblk,nls=utf8,uid=1000,gid=1000,dmask=0000,fmask=0000 -fstype=vfat,uid=1000,gid=1000,dmask=0000,fmask=0000"
- FS_MOUNTOPTIONS="-fstype=vfat,umask=0000,uid=1000,gid=1000"
- ```
- ### Notes
- I could not get the NTFS drives mounted with USBMount. Mounts the drive, but with question marks (`?????`) for `ls -l` and `Transport endpoint is not connected` error when I try to `cd` in to drive
- Temporary solution seems to be `umount /dev/sda1` via `ssh` and `mount /dev/sda1 /media/ntfsdir` manually.
- Also somehow, OS X do not work as expected via `smb://`, wasted many hours!
- So the workaround with mac is to use `Filezilla`. In case of android phone `ES File explorer` and `VLC` works as expected.
Add Comment
Please, Sign In to add comment