how to auto mount hotpluged usb drive?

Ask questions about Arch Linux ARM. Please search before making a new topic.

how to auto mount hotpluged usb drive?

Postby mmoalem » Mon Jul 01, 2013 9:24 pm

hi there all - running my server on pro. linux automounts usb drives as i plug them in but samba doesnt - anyway i can get samba to automatically share drives as they are plugged in?
mmoalem
 
Posts: 19
Joined: Tue Sep 04, 2012 1:06 pm

Re: how to auto mount hotpluged usb drive?

Postby moonman » Tue Jul 02, 2013 8:28 am

You can share the directory where the drives mount (/media ?). The only drawback is that samba will report the free space of your roots partition and not the mounted drive so if you have less free space in that partition than the the size of the batch of files you are trying to write - it will fail ( unless things have changed since samba 3)
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: how to auto mount hotpluged usb drive?

Postby WarheadsSE » Tue Jul 02, 2013 2:43 pm

You would have to have a script that triggers to restart samba after managing some sort of default-config-per-folder addition/removal logic.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: how to auto mount hotpluged usb drive?

Postby jeajea » Tue Jul 02, 2013 4:04 pm

The mount point name(s) are based on the partition labels and are case sensitive.
For the boot drive I label the second partition Linux-sda2.
I label a data drive ArchLinux with a sub directories 0Quick and 0Movies.
As a catch all I create a share for /run/media/root.

$this->bbcode_second_pass_code('', '# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765

[share]
path = /run/media/root/Linux-sda2
public = yes
writeable = yes
guest ok = yes

[movies]
path = /run/media/root/ArchLinux/0Movies
public = yes
writeable = yes
guest ok = yes

[share1]
path = /run/media/root/ArchLinux
public = yes
writeable = yes
guest ok = yes

[share2]
path = /
public = yes
writeable = no
guest ok = yes

[share3]
path = /run/media/root
public = yes
writeable = yes
guest ok = yes

[quick]
path = /run/media/root/ArchLinux/0Quick
public = yes
writeable = yes
guest ok = yes

#')
Jim Anderson
3 Dockstars, 3 Pogoplug V2 and a Zyxel NSA325
Treasure Island, Fl
jeajea
 
Posts: 121
Joined: Wed Aug 25, 2010 4:00 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 10 guests