0
I have a Raspberry Pi which is using samba
and ntfs-3g
in order to share a USB external hard drive on my home network. On the hard drive, there are some files which are marked with the "Hidden" Windows file attribute. However, when I access the share on a Windows PC, the files do not show as hidden. As a result, I see many hidden files such as desktop.ini
, thumbs.db
, as well as directories like $RECYCLE.BIN
and System Volume Information
, even though my Windows setting in Folder Options is set to not show hidden files.
I know that samba
is not correctly transferring the Hidden attribute because if I view the Properties of a file that should be hidden, the Hidden check-box is not selected:
These are the current contents of my smb.conf
file:
#### GLOBAL CONFIG #####
workgroup = WORKGROUP
netbios name = raspberrypi
server string = %h
wins support = yes
dns proxy = no
security = share
null passwords = yes
guest account = nobody
interfaces = eth0 lo
bind interfaces only = yes
#### PUBLIC SHARE #####
[Mazda6]
comment = Media Drive
path = /media/HDD
browseable = yes
guest ok = yes
writeable = yes
public = yes
available = yes
create mask = 0666
directory mask = 0777
How can I have files that are marked with the Hidden file attribute on the NTFS drive to be shown as Hidden when viewed through the samba
share on a Windows PC?
I added
map hidden = yes
to the configuration, and every file is hidden now, even ones without the hidden attribute. Usinghide files
seems to be working though. If nobody suggests a better alternative I will accept your answer. – bdr9 – 2014-04-29T23:34:34.803Check the permissions in Linux on your host itself, I've noticed frequently that NTFS file systems in particular are frequently read by the system as having the "other execute" bit set for every single file, which coupled with how Samba maps the Windows hidden file attribute sounds like exactly what you've encountered here. – Kromey – 2014-04-29T23:48:57.343
The .jpg pictures on my drive are showing as having
-rwxrwxrwx
permissions. I don't know much about Linux permissions though. Does this confirm your theory? – bdr9 – 2014-04-29T23:59:18.927It seems to, yes -- it's at least consistent with it. Try running the command
chmod a-x <filename.jpg>
on one of those .jpg files -- just one, though, for now -- and see if that makes it "pop into existence" when viewed from Windows via Samba. When used in conjunction with themap hidden
option, of course. – Kromey – 2014-04-30T00:02:14.293When I run
chmod a-x <filename>
on a file on the NTFS drive, the permissions do not change, they are still-rwxrwxrwx
. As such the files are still hidden whenmap hidden = yes
is included in the configuration. – bdr9 – 2014-04-30T02:15:28.413I was afraid that's what would happen. NTFS is very Windows-centric; short of moving all your data to a drive that is formatted with a different file system, I guess the
hide files
option is really your only option. – Kromey – 2014-04-30T14:21:53.880Thank you for your help. The
hide files
option works well enough for me because most of the hidden files I want to hide all have the same name, so I will accept your answer. – bdr9 – 2014-05-01T13:56:32.180