Guest User

Untitled

a guest
Jun 13th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. # Installation of packages
  2.  
  3. ```
  4. sudo apt-get install usbmount
  5. sudo apt-get install samba samba-common-bin
  6. sudo apt-get install ntfs-3g
  7. ```
  8.  
  9. ### Setup Samba
  10.  
  11. ```
  12. sudo vi /etc/samba/smb.conf
  13. ```
  14.  
  15. Add the below configuration at the end of the file. Not secure as the below share drives as universal (rwx)
  16.  
  17. ```
  18. # usbmount - /media share
  19. [USBDrives]
  20. Comment = RPI
  21. Path = /media
  22. Browseable = yes
  23. Writeable = Yes
  24. only guest = no
  25. create mask = 0777
  26. directory mask = 0777
  27. Public = yes
  28. Guest ok = yes
  29. ```
  30.  
  31. #### Setup samba user and restart the service
  32.  
  33. ```
  34. sudo smbpasswd -a pi
  35. sudo /etc/init.d/samba restart
  36. ```
  37.  
  38. ### USBMount configuration
  39.  
  40. Edit `udevd.service` to modify the `MountFlags`
  41.  
  42. under `[Service]` change `MountFlags=shared` from `MountFlags=slave`
  43.  
  44. ```
  45. sudo vi /lib/systemd/system/systemd-udevd.service
  46.  
  47. ...
  48.  
  49. MountFlags=shared
  50.  
  51. ```
  52.  
  53. Below configuration required to mount the drives under default `pi` user
  54.  
  55. `FILESYSTEMS` to include `ntfs fuseblk`, `FS_MOUNTOPTIONS` to update `uid,gid,fmask,dmask`
  56.  
  57. ```
  58. sudo vi /etc/usbmount/usbmount.conf
  59.  
  60. FILESYSTEMS="vfat ext2 ntfs fuseblk ext3 ext4 hfsplus"
  61.  
  62. #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"
  63.  
  64. FS_MOUNTOPTIONS="-fstype=vfat,umask=0000,uid=1000,gid=1000"
  65. ```
  66.  
  67.  
  68. ### Notes
  69.  
  70. 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
  71.  
  72. Temporary solution seems to be `umount /dev/sda1` via `ssh` and `mount /dev/sda1 /media/ntfsdir` manually.
  73.  
  74. Also somehow, OS X do not work as expected via `smb://`, wasted many hours!
  75.  
  76. 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