Page 1 of 1

Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 6:33 am
by pmccarty
Hi!

I've had this issue with other iterations of Linux, but your documentation says it should work and I'd LIKE it to work, so I'm giving it a try. :-)

I am trying to mount three external USB drives and then locate shares on them. They are mounted via fstab and visible from the command line. I can create a share on them but it is inaccessible from any client, windows, mac or linux. The error is 'The operation can't be completed because the original item for "MintBackup" can't be found' on the Mac. It is similar on all other OS'es.

Workgroup is 'home' and consistent throughout.

My hda-diskmount output:

Ignoring /dev/sda3 - already mounted
Ignoring /dev/sda3 - already in /etc/fstab as UUID=2ae91fdb-d243-4ad7-aef2-8d3254b39e1e
****************************************************************
/usr/sbin/hda-diskmount: line 220: pmount: command not found
Mounted /dev/sdb1 as '/var/hda/files/drives/drive1' (read-write)
You may want your system to mount it every time you boot.
To do so, add this line VERY CAREFULLY to /etc/fstab and reboot:
UUID=6b57cfa9-5807-4830-90d4-bac37da38b41 /var/hda/files/drives/drive1 ext4 defaults 1 2
****************************************************************
/usr/sbin/hda-diskmount: line 220: pmount: command not found
Mounted /dev/sdc1 as '/var/hda/files/drives/drive2' (read-write)
You may want your system to mount it every time you boot.
To do so, add this line VERY CAREFULLY to /etc/fstab and reboot:
UUID=fabd24c5-23fb-4da0-a527-99a4cd73ee59 /var/hda/files/drives/drive2 ext4 defaults 1 2
****************************************************************
/usr/sbin/hda-diskmount: line 220: pmount: command not found
Mounted /dev/sdd1 as '/var/hda/files/drives/drive3' (read-write)
You may want your system to mount it every time you boot.
To do so, add this line VERY CAREFULLY to /etc/fstab and reboot:
UUID=d4208447-b011-4c61-af0c-d6aeb1d36cd5 /var/hda/files/drives/drive3 ext4 defaults 1 2
****************************************************************

The lines [copied from above] added to my /etc/fstab

UUID=6b57cfa9-5807-4830-90d4-bac37da38b41 /var/hda/files/drives/drive1 ext4 defaults 1 2
UUID=fabd24c5-23fb-4da0-a527-99a4cd73ee59 /var/hda/files/drives/drive2 ext4 defaults 1 2
UUID=d4208447-b011-4c61-af0c-d6aeb1d36cd5 /var/hda/files/drives/drive3 ext4 defaults 1 2

making my /etc/fstab look like this:


#
# /etc/fstab
# Created by anaconda on Sat Mar 17 15:04:36 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=2ae91fdb-d243-4ad7-aef2-8d3254b39e1e / ext4 defaults 1 1
UUID=29584210-badc-46f6-a644-d68129ec6ca1 /boot ext3 defaults 1 2
UUID=8b58015c-ac86-4d09-9df6-fd0bde36cfd1 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=6b57cfa9-5807-4830-90d4-bac37da38b41 /var/hda/files/drives/drive1 ext4 defaults 1 2
UUID=fabd24c5-23fb-4da0-a527-99a4cd73ee59 /var/hda/files/drives/drive2 ext4 defaults 1 2
UUID=d4208447-b011-4c61-af0c-d6aeb1d36cd5 /var/hda/files/drives/drive3 ext4 defaults 1 2

It mounts properly and is visible on the command line:

[root@localhost MintBackup]# pwd
/var/hda/files/drives/drive1/MintBackup
[root@localhost MintBackup]# ls -l
total 4
drwxr-xr-x 62 1000 1000 4096 Feb 17 00:13 patrick
[root@localhost MintBackup]#

And the share created via the webui:

Access: visible
Permissions: All users and Writeable
Tags: None selected
location: /var/hda/files/drives/drive1/MintBackup
extra parameters: none

Regardless of what I change the permissions to - it doesn't change the end result.

I am aware of the issue of sharing an external USB drive via SMB in other variations of Linux and have used all the tricks I can find to make this work. I have also been all the way through the sharing troubleshooting sheet several times. I have also searched through this forum and made Google my best friend.

Thoughts??

Best regards,

Patrick

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 7:22 am
by bigfoot65
Did you check ownership of the directories? It should be your firstadminuser:users and permissions should be at least 775. Make sure you apply them recursively to all sub directories and files.

Have you rebooted since adding these drives? Maybe there is something that is not quite in sync that a reboot might correct. Could try restarting Samba as well to ensure it picked up everything. There is a web app called Webmin (http://www.amahi.org/apps/webmin)that might help with this as well. It allows you to modify Samba info and many of the system settings. It is a bit advanced, so have to be careful using it.

Hope this helps.

Re: Mounting external USB drives and locating shares on them

Posted: Wed Mar 21, 2012 8:41 am
by pmccarty
Hi!

Thanks for the response!

I used chmod -R 777 * on the root of these drives - a little more permissive than I'm comfortable with but helps with the troubleshooting. As below patrick is the first admin user.

drwxrwxrwx 3 patrick users 4096 Feb 19 00:26 MintBackup

I restarted smbd, via smbd restart, at first and failing that rebooted the box. On the reboot all the drives mounted properly.

[root@localhost drive1]# mount
/dev/sda3 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext3 (rw)
/dev/sdb1 on /var/hda/files/drives/drive1 type ext4 (rw)
/dev/sdc1 on /var/hda/files/drives/drive2 type ext4 (rw)
/dev/sdd1 on /var/hda/files/drives/drive3 type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

Same result. :-(

This architecture [sharing via SMB external USB hard drives] has been an issue with previous releases of Debian and CentOS, but I was encouraged to see that people had done it here as it is something that I've wanted to do [and I'd assumed it been worked out with the tip of mounting the drives at boot time].

Webadmin I've used years ago - I don't know if it's changed significantly but I'm comfortable with the smb.conf file and vi. My gut is that it isn't SMB though as shares on sda1 work perfectly.

More thoughts? :-)

Best regards,

Patrick

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 9:23 am
by bigfoot65
Have you seen this thread in the forums?

http://forums.amahi.org/viewtopic.php?f ... rive#p8554

I have not tried to mount a USB hard drive myself, so not sure what else could be going on. Sorry I am not much help, but hopefully someone else will be able to assist.

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 3:21 pm
by pmccarty
Thank you!

I think we've solved it.

I moved the mount points to /mnt/drive1, etc. I then changed the permissions to 777 [an issue, I know but one I can then tune appropriately]. Finally I created the share in the webui. Browsing from my mac, linux and windows works beautifully.

Will this forum serve as documentation for the next person who stumbles upon this issue?

See below for changes.

Best regards,

Patrick

Last three lines of my /etc/fstab:

UUID=6b57cfa9-5807-4830-90d4-bac37da38b41 /mnt/drive1 ext4 defaults 1 2
UUID=fabd24c5-23fb-4da0-a527-99a4cd73ee59 /mnt/drive2 ext4 defaults 1 2
UUID=d4208447-b011-4c61-af0c-d6aeb1d36cd5 /mnt/drive3 ext4 defaults 1 2

mount -a

Set permissions set on the three directories:

[root@localhost ~]# ls -dl /mnt/*
drwxrwxrwx 6 1000 1000 73728 Feb 19 00:26 /mnt/drive1
drwxrwxrwx 5 1000 1000 4096 Jan 27 22:50 /mnt/drive2
drwxrwxrwx 4 1000 1000 4096 Jan 31 13:43 /mnt/drive3
[root@localhost ~]#

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 3:24 pm
by pmccarty
And cheers to Bigfoot65 as his link gave me the lead!

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 3:26 pm
by bigfoot65
This would be a great thing to add to the wiki. If you have time, we would greatly appreciate it if you could document for other users.

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 4:17 pm
by pmccarty
I'd love to. Is there a template or something I need to do so?

Best regards,

Patrick

Re: Mounting external USB drives and locating shares them.

Posted: Wed Mar 21, 2012 7:34 pm
by bigfoot65
Make a new page for USB Hard Drive or add to the existing page at the bottom as a tip for USB Hard Drives.

http://wiki.amahi.org/index.php/Adding_ ... o_your_HDA