Dean Posted June 8, 2016 Posted June 8, 2016 I've spent a day going crazy trying to sort this and am failing. I want to share an NTFS USB hard drive via samba to a windows machine. At the moment I have shared the home directory which works fine but whenever I try to access the NTFS USB drive I get a permission error from the Windows machine. As far as I can glean it's to do with mounting permissions on the NTFS drive but how do I sort this when armbian automounts the drive?
Gravelrash Posted June 13, 2016 Posted June 13, 2016 I hope im not too late in offering assistance, i can help there. can you post me up your /etc/samba/smb.conf and i will check it over. first question, are you doing this as: a standalone server? part of a windows domain?as a Domain Controller?
tkaiser Posted June 14, 2016 Posted June 14, 2016 armbian automounts the drive? Armbian does not automount anything. Armbian is a build framework using one of 4 different Debian based distros (some of them showing auto-mount capabilities in some installation variants, some not). So please tell us which distro you're exactly using and then I fear the necessary steps to prevent auto-mounting (and putting correct parameters in /etc/fstab) are just one web search away?
Dean Posted June 14, 2016 Author Posted June 14, 2016 I hope im not too late in offering assistance, i can help there. can you post me up your /etc/samba/smb.conf and i will check it over. first question, are you doing this as: a standalone server? part of a windows domain? as a Domain Controller? Thanks for your help. smb.conf: [global] workgroup WORKGROUP security = user interfaces = lo eth0 bind interfaces only = true map to guest = bad user usershare allow guests = yes [Public] path = /media/orangepi/Backup writable = yes browsable = yes guest ok = yes guest account = orangepi public = yes read only = no create mask = 0775 directory masj 0775 [home] path = /home/orangepi writeable = yes public = yes only guest = yes As far as I'm aware I'm trying to use the share as a standalone server, as stated the 'home' share works but it's the 'public' share which fails. Armbian does not automount anything. Armbian is a build framework using one of 4 different Debian based distros (some of them showing auto-mount capabilities in some installation variants, some not). So please tell us which distro you're exactly using and then I fear the necessary steps to prevent auto-mounting (and putting correct parameters in /etc/fstab) are just one web search away? I'm using Armbian_5.10_Orangepih3_Debian_jessie_3.4.112_desktop. You're probably right with it being a search away but when you can't see the wood for all the trees and you don't know you're looking at the wood, it's a bit hard.
tkaiser Posted June 14, 2016 Posted June 14, 2016 I'm using Armbian_5.10_Orangepih3_Debian_jessie_3.4.112_desktop. So did you already try to add this specific drive to /etc/fstab (preferrably using the UUID that blkid outputs?). This way you can specify mount options and this should also prevent auto-mounting later.
Dean Posted June 14, 2016 Author Posted June 14, 2016 So did you already try to add this specific drive to /etc/fstab (preferrably using the UUID that blkid outputs?). This way you can specify mount options and this should also prevent auto-mounting later. No, because I don't know what I'm doing. I've added: UUID=01D1C0AE8B1ED070 /media/orangepi/Backup/ ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0 0 which seems to still mount the drive but I don't know whether it's the automount or the updated fstab which is mounting the drive. The share still doesn't work.
tkaiser Posted June 14, 2016 Posted June 14, 2016 I've added: UUID=01D1C0AE8B1ED070 /media/orangepi/Backup/ ntfs-3g auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0 0 which seems to still mount the drive but I don't know whether it's the automount or the updated fstab which is mounting the drive. The share still doesn't work. Ok, some things to mention (and we really need to update our documentation since most if not all 'userland' problems are not Armbian specific but in this case just 'plain Debian jessie' which might help finding solutions since users realize that this is nothing specific to Armbian but the installed distro variant instead). /etc/fstab only gets consulted at boot time or if you issue a 'sudo mount -a' (since I'm not familiar with desktop stuff I don't know whether it's necessary to 'eject' the mounted drive before) the UUID might not be correct so starting with the exact device -- most probably /dev/sda1 -- that 'cat /etc/mtab' outputs should ensure that you use the correct options Creating a different mountpoint than the one the automount used might be a good idea (again: No idea about Linux but in OS X this is highly recommended to do static mounts not below /Volumes where automatic mounts happen). So maybe doing an 'sudo mkdir -p -m2777 /media/static/Backup' and switching to this path in /etc/fstab and smb.conf will succeed Once this is resolved potential smb.conf issues should be addressed.
zador.blood.stained Posted June 14, 2016 Posted June 14, 2016 @Dean First, please check your permissions on directory and files you are trying to share (i.e. "ls -la /media/orangepi/Backup") Assuming user "orangepi" (uid 1000 from fstab mount options) has read access, try adding force user = orangepi to your [Public] section and restarting samba Also you may want to fix the typo directory masj 0775 and I would not recommend using create mask = 0775 for security reasons, 0664 would be better IMO I don't know whether it's the automount or the updated fstab which is mounting the drive. The share still doesn't work. You can check output of "mount" to see if options from fsbab were applied to this mount point
Dean Posted June 14, 2016 Author Posted June 14, 2016 Ok, some things to mention (and we really need to update our documentation since most if not all 'userland' problems are not Armbian specific but in this case just 'plain Debian jessie' which might help finding solutions since users realize that this is nothing specific to Armbian but the installed distro variant instead). /etc/fstab only gets consulted at boot time or if you issue a 'sudo mount -a' (since I'm not familiar with desktop stuff I don't know whether it's necessary to 'eject' the mounted drive before) the UUID might not be correct so starting with the exact device -- most probably /dev/sda1 -- that 'cat /etc/mtab' outputs should ensure that you use the correct options Creating a different mountpoint than the one the automount used might be a good idea (again: No idea about Linux but in OS X this is highly recommended to do static mounts not below /Volumes where automatic mounts happen). So maybe doing an 'sudo mkdir -p -m2777 /media/static/Backup' and switching to this path in /etc/fstab and smb.conf will succeed Once this is resolved potential smb.conf issues should be addressed. Thanks, managed to mount it in a static directory. @Dean First, please check your permissions on directory and files you are trying to share (i.e. "ls -la /media/orangepi/Backup") Assuming user "orangepi" (uid 1000 from fstab mount options) has read access, try adding force user = orangepi to your [Public] section and restarting samba Also you may want to fix the typo directory masj 0775 and I would not recommend using create mask = 0775 for security reasons, 0664 would be better IMO You can check output of "mount" to see if options from fsbab were applied to this mount point Fixed the error and forced the user and now I connect to the share and I can create files etc. Many thanks to you all for helping me out.
Gravelrash Posted June 14, 2016 Posted June 14, 2016 @all you guys dont hang about! I have just logged on to attempt to answer/assist and its all fixed. @Dean it may be a good idea for you to write up the steps you took to install and configure the "simple" samba setup you are using. From finding the blkid / setting static mount etc. I will gladly proof read it for you and advise where any corrections may be necessary For the following reasons. 1 - as a "newbie" your instructions and experience will match the experience of most people new to samba and this will save a lot of people a lot of headaches 2 - It will help you should you ever need to do this again 3 - It will add to the instantly available knowledge on the forum 4 - It will save me doing it :D
Dean Posted June 15, 2016 Author Posted June 15, 2016 I *think* this is the procedure but someone may have to confirm the steps. Put in your external NTFS drive into a USB port and make sure it works Create a new mount point for the NTFS drive sudo mkdir -p -m2777 /media/static/Backup find the name of your NTFS drive cat /etc/mtab find your user id in and note the gid and uid id Edit fstab sudo nano /etc/fstab to (dev/sda1 is your name that you noted above, /media/static/Backup is the mountpoint you created and uid and gid is your user details) /dev/sda1 /media/static/Backup/ ntfs auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0 0 Install Samba apt-get install libcups2 samba samba-common cups Open Samba configure nano /etc/samba/smb.conf remove everything and alter it to (change 'orangepi' to your username) [global] workgroup WORKGROUP security = user interfaces = lo eth0 bind interfaces only = true map to guest = bad user usershare allow guests = yes force user = orangepi [Public] path = /media/static/Backup writable = yes browsable = yes guest ok = yes guest account = orangepi public = yes read only = no create mask = 0775 directory mask 0664 [home] path = /home/orangepi writeable = yes public = yes only guest = yes Reboot and test
Wolf2000 Posted June 15, 2016 Posted June 15, 2016 Hi Dean which is also used: apt-get install ntfs-configapt-get install ntfs-3g
Recommended Posts