Can't see my external HD shared with SAMBA form certain devices

Hi all,

Just tried to be as descriptive as possible in the title. I’m running Opensuse 11.4, KDE 4.6.5 under Tumbleweed repos.

I have an external HD with two partitions (Argos & Hercules) mounted in fstab as follows:

/dev/disk/by-id/ata-WDC_WD5000BEKT-80KA9T0_WD-WXA1A8011853-part5 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-WDC_WD5000BEKT-80KA9T0_WD-WXA1A8011853-part6 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD5000BEKT-80KA9T0_WD-WXA1A8011853-part7 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-WDC_WD5000BEKT-80KA9T0_WD-WXA1A8011853-part2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-WDC_WD5000BEKT-80KA9T0_WD-WXA1A8011853-part8 /windows/DATA        ntfs-3g    user,users,gid=users,umask=0002  0 0
/dev/disk/by-id/usb-Seagate_FreeAgent_2GEVSAZH-0:0-part1         /media/Argos         ntfs-3g    user,users,gid=users,umask=0002  0 0
/dev/disk/by-id/usb-Seagate_FreeAgent_2GEVSAZH-0:0-part2         /media/Hercules      ntfs-3g    user,users,gid=users,umask=0002  0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

As you can see they are mounted under /media/. The thing is that I wanted to share Hercules in my home network with samba as I have my multimedia there. Everything runs smoothly if I access the files from my wife’s netbook, but a problem arises when I’m trying to get to the shared resource from an android tablet. I’m able to mount with the tablet any directory with cifs except dirs. from the external HD. I mean, I can mount 192.168.1.100/home ; 192.168.1.100/DATA ; 192.168.1.100/(whatever shared folder through SAMBA) EXCEPT a folder form any partitions of the external HD (//192.168.1.100/Hercules). When I do that, it connencts, but I simply get an “empty” directory.

Yes, the problem is weird as I have no problem at all mounting/viewing in the other netbook. The problem seems to be with the android tablet. I thought first it could be an Android problem, or whatever the cifs application… but why I can mount and work with any other shared resource except the external HD?? Also tried two different cifs apps. and same problem.

Maybe I’m missing something in my fstab file… but that’s why I’m asking for a bit of help! I tried to mount to /mnt/ instead to /media/ but I just couldn’t, always mounted to /media.

I’m also attaching my smb.conf just in case, but the shared dirs config’s are all the same:

[global]
workgroup = HOMENET
server string = 
map to guest = Bad User
name resolve order = bcast host lmhosts wins
printcap name = cups
os level = 64
preferred master = Auto
local master = No
usershare allow guests = Yes
cups options = raw
use client driver = Yes
usershare max shares = 100

[Hercules]
path = /media/Hercules/
guest ok = yes
read only = no
force user = Luk

[Argos]
path = /media/Argos/
guest ok = yes
read only = no
force user = Luk

[Luk]
path = /home/Luk/
guest ok = yes
read only = no
force user = Luk

[Docs]
path = /windows/DATA/Documents/
guest ok = yes
read only = no
force user = Luk

I was also reading the Samba HowTo: Mount a CIFS Network Share [Mapped Drive] in openSUSE guide, but I’m a bit confused on how to mount in fstab as I’m wondering if this would be added to the already existing lines, or they replace the actual lines for my external drives but at the same time would give me local access to the drives?

Anyway, hope I was clear enough and also hope somebody can give me a hand with this as I cannot get it to work.

Thanks a lot!

santasemilla,

I am not at home so I dont have any NTFS drives that I can plugin here. My first guess if file permissions. Try setting permissions to the mount point.

chmod 777 /media/Hercules

Dave W

Ok,

I remembered my external does have an NTFS partition. You can see in the automount that only the owner has permissions.


l /media/
total 16
drwxr-xr-x  5 root root   89 Aug 18 07:03 ./
drwxr-xr-x 22 root root 4096 Aug 18 07:01 ../
-rw-r--r--  1 root root  176 Aug 18 07:03 .hal-mtab
-rw-------  1 root root    0 Aug 18 07:03 .hal-mtab-lock
drwx------  1 dave root 4096 Apr 20 15:32 dbwData/
drwxr-xr-x  4 root root 4096 Mar 30 11:40 linuxData/
 drwxr-xr-x  6 root root   60 Jun 29 07:18 multiBoot/

The dbwData is the ntfs partition. You should not use /media as the mount point. Automount uses /media. Move the mount point to /mnt or /windows. And I think you will have to set the permissions each time it is mounted. I am not sure if you can set the mount permissions in fstab, never needed to look into before. It might work if you create the new mount point with 777 permissions.


mkdir /mnt/Argos
 chmod 777 /mnt/Argos

Dave W

To change the mount point.


umount /media/Argos
mkdir /mnt/Argos
chown luk:usres /mnt/Argos
chmod 777 /mnt/Argos
vi /etc/fstab
mount /mnt/Argos

When you edit fstab just change /media to /mnt. Check the permissions after the remount to ensure the user has access.

Dave W

Dave!

Thank you for all your suggestions, I’ll give it a try soon and will let you know. Yes, /media is the place for automount, that’s why I also "smelled΅ troubles there. When first tried to mount into /mnt, I didn’t create the folders, I thought fstab would take care of that if the folders were not there… but yup, sounds pretty logic! (ouch!)

As I said, I’ll give it a try and let you know soon. Thanks a lot!!

Santasemilla

Re Hercules:

The Hercules fstab line:
Try changing the options: user,users,gid=users,umask=0002
to this: uid=Luk,gid=users,umask=0022

Then reboot and the permissions and ownership in the directory will match user Luk, as is required by the way you defined the share in smb.conf.

If that works, do similar for Argos

Hi Dave, swerdna,

I’ve been trying the different options. First created the Hercules dir under /mnt, gave it permissions and changed in fstab the /media/ for /mnt/. No way to get it automounted at start (mmmm…yup, sorry, I forgot to try the manual mount). It’s like i the automount feature could be only achieved using the “External drives app” from KDE in the automount part. Of course I disabled that completely, then tried again the fstab lines… but no mount at login. I’m wondering if I’m not able to see the partitions through samba in my android device because the link is correct… but fstab mapping is somehow wrong. It sounds strange though.

Also tried changing the " uid=Luk,gid=users,umask=0022 " in fstab, but no luck. What I DID noticed is something strange when the machine boots up. Just pressed esc key while the lizard is loading to see the modules and I can see a “fail” regarding ntfs-3g… but I couldn’t read very well. I don’t know if it’s a problem or not as I have perfect access and can read/write locally to all my ntfs partitions… but who knows, I would like to understand also what is that “fail” message. Where can I get the log of the OS starting sequence?

Anyway, by now seems that the “automount” feature only works fine if I automount with the KDE application. Of course it mounts directly to /media. I’m not at home right now to keep testing things… but I was wondering what if I create a link to /media/Hercules in /mnt/Hercules and share that “phantom folder” in samba…? Just wondering, but I think the problem is at fstab and somehow with the fact that it cannot correctly automount the drive at startup.

What do you guys suggest?

Thanks again for your time!!

Try this,Make sure the partition is unmounted. Delete the mount point. Start yast2, goto system and select partitioner. Expand the drive tree and select edit, enter the mount point /mnt/Argos and accept changes. Yast will create the mount point and and the entry in fstab. Once it is auto mounting working we can work on permissions.Dave

On Thu August 18 2011 11:26 am, dwestf wrote:

>
> Try this,Make sure the partition is unmounted. Delete the mount point.
> Start yast2, goto system and select partitioner. Expand the drive tree
> and select edit, enter the mount point /mnt/Argos and accept changes.
> Yast will create the mount point and and the entry in fstab. Once it is
> auto mounting working we can work on permissions.Dave
>
>

[quote=santasemilla]
Yes, the problem is weird as I have no problem at all mounting/viewing
in the other netbook. The problem seems to be with the android tablet. I
thought first it could be an Android problem, or whatever the cifs
application… but why I can mount and work with any other shared
resource except the external HD?? Also tried two different cifs apps.
and same problem.

[quote]
I seriously doubt that this is a permission problem on the external drive as
the OP states that sharing works from the netbook. (What operating system is
on the netbook?) I’m not familiar with Android but I’d be looking there.

It might shed some light if we had the logs.
santademilla;
Add to the [global] section of /etc/samba/smb.conf the following parameter:


log level = 1 auth:3

Restart Samba:


rcsmb restart

Now look at the logs generated when you access a share from the Android:
look at /var/log/samba/log.smbd

This should show Samba authentication. If nothing interesting appears here
the try just:


log level = 3

After restarting Samba look at log.smbd after your Android tries to connect.


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

You know what? You are totally right! I can’t believe how did I forget about the partition tool under Yast2! The trick was that when Yast2 created the line in fstab, the driver is identified as:

/dev/disk/by-id/ata-ST31000333AS_6TE0QSYZ-part2 

before, it was usb, as:

dev/disk/by-id/usb-Seagate_FreeAgent_2GEVSAZH-0:0-part2

now is mounted under /mnt/Hercules and the other one as mnt/Argos. Both are perfectly readable from any device in my local network!

Thanks a lot Dave!

Also, thank you venzkep as the tip on the log creation is very handy! I had no idea to set that. Could be a useful tool for future troubleshooting!

Your welcome, glad to help.