Samba sharing a FAT32 external HD

ZIYAD A. M. AL-BATLY zamb at saudi.net.sa
Sat Jun 18 16:41:37 UTC 2005


On Sat, 2005-06-18 at 12:11 -0400, Ben Novack wrote:
> On 6/18/05, ZIYAD A. M. AL-BATLY <zamb at saudi.net.sa> wrote:
> > On Fri, 2005-06-17 at 21:29 -0400, Ben Novack wrote:
> > > On 6/17/05, Ben Novack <bennovack at gmail.com> wrote:
> > > > I've got an external USB2 hard drive formatted as FAT32 that contains,
> > > > among other things, all of my music; I want the other systems on my
> > > > network (specifically, a Mac PowerBook) to have unrestricted
> > > > read/write access to it. Sharing my home directory works fine; the
> > > > external drive shows up when browsing the network, but neither XP nor
> > > > the PB can actually view it. Is there a way to get it properly shared
> > > > without reformatting it into something more Unixy - something I very
> > > > much want to avoid, since I frequently use it on XP systems?
> > > >
> > > > (The HD's plugged into a Hoary desktop, for the record.)
> > >
> > > Something else that just came up as I was investigating a workaround:
> > > If I copy the library to the shared folder on my hard drive, the Mac
> > > can't use it as its library folder because it lacks write permissions.
> > > Is there a way I can change its contents, recursively down the tree,
> > > to be rwx for everyone?
> > >
> > To change the permission recursively pass the "-R" option to
> > "chmod" (bare the security risk!  Everyone will have read/write
> > permissions):
> >   chmod -R a+rwX /path/to/directory
> > 
> > 
> > And about your original problem, to fix it you need to mount your drive
> > with the "dmask=000,fmask=111" options.  In "/etc/fstab" add the line:
> >   /dev/sda1  /media/sda1  auto  defaults,noauto,users,dmask=000,fmask=111
> > 
> > (In the above, I'm assuming that your USB HDD is "/dev/sda" and it has
> > only one partition.  Create the directory "/media/sda1" if needed.
> > Configure SAMBA to share "/media/sda1".  Again: Bare the security risks
> > imposed by such actions!).
> > 
> > If you need anything else, just ask here again.
> > Ziyad.
> > 
> 
> Well, right now the external drive isn't mounting with fstab; it just
> gets automounted as a USB drive. If I switch to fstab'ing it, will I
> still be able to remove and reattach it at will? Will automount simply
> ignore a device listed in fstab?
It would still work¹.  Auto mounting devices is done by “pmount”¹.
Here's a quote from the manual:
  The mount will succeed if all of the following conditions are met:
      * device is a block device in /dev/
      * device is not in /etc/fstab (if it is, pmount executes mount
        device as the calling user to handle this transparently)
      * device is not already mounted according to /etc/mtab
        and /proc/mounts
      * if the mount point already exists, there is no device already
        mounted at it and the  directory is empty
      * device is removable (USB or FireWire device,
        or /sys/block/drive/removable is 1)
      * device is not locked

(point #2 is the one important to our discussion.)


There's one catch:  If you attached your USB HDD and it got assigned a
device name other than “/dev/sda”.  I've read that you could ensure that
would not happen if you fiddled with “udev” configuration but I don't
know how.

In general, every time you connect your USB HDD it will be assigned the
first “/dev/sd?” device available and that would be “/dev/sda” if you
don't have other external hot-plugged devices.

Just give it a try.  If it didn't work for you, you can always go back
by removing (or commenting out) that line.

Notes:
     1. Under Hoary “5.04” (and maybe Breezy “5.10” and to be released
        hopefully in two or three months).  Warty “4.10” is another
        story (it doesn't have “pmount” for starter).


Ziyad.




More information about the ubuntu-users mailing list