:: Re: [DNG] For all you automounter p…
Góra strony
Delete this message
Reply to this message
Autor: Steve Litt
Data:  
Dla: dng
Temat: Re: [DNG] For all you automounter programmers
On Tue, 26 Apr 2016 15:36:52 -0400
Hendrik Boom <hendrik@???> wrote:

> On Tue, Apr 26, 2016 at 02:08:33PM -0400, Steve Litt wrote:
> > Hi all,
> >
> > It seems like everyone in the Devuan community has written his or
> > her own usb drive automounter, and I've just discovered something
> > that will help us all.
> >
> > The thumb drive you buy at the store is formatted with a Windows
> > file system, and that's a good thing because it's mountable pretty
> > much by any device or computer. Sneakernet at its best.
> >
> > But you must be root to mount it unless it's declared in /etc/fstab,
> > which is a bad idea for a number of reasons. And if you mount it as
> > root, normally the owner is root, and with its (typical) 755
> > permissions, a normal user can't write to it. Defeating its whole
> > purpose.
> >
> > What you really want is for anyone in a certain group to be able to
> > write to it. I used group "floppy", because a USB drive is a pretty
> > good analog to a floppy, and floppies aren't even used much
> > anymore. So do the mount like this:
> >
> > mount -o gid=floppy,fmask=113,dmask=002 /dev/sdd1 /mnt/thumb
> >
> > or
> >
> > mount -o gid=floppy,fmask=113,dmask=002 /dev/sdd1 /mnt/sdd1
> >
> > The gid= means the thumb drive and all its files are group "floppy",
> > and the fmask and dmask make directories 775 and 664 respectively,
> > so group "floppy" can write.
> >
> > I haven't yet tried this on a genuine ext4 formatted thumb drive,
> > so I don't know whether it would have any downside there. If so, the
> > different mount options would only appear if the thumb drive was
> > determined to be vfat/fat/msdos etc.
>
> I have a USB backup drive. I have root mount it, It's formatted
> ext3, and I have no problems doing so. It even allows me to use my
> systems's user IDs, though I expect it'll get confused if I were to
> use it on several systems with different UIDs.
>
> I just mount it as mount /dev/sdb1 /usbackup


Yes. Ext(2,3,4) formatted thumb drives need no special sauce to be
written by a normal user. My instructions were for a windows formatted
thumb drive. The reason you would sometimes use a Windows formatted
thumb is to do things like operate a scanner in the "direct to usb
drive" mode and sneakernet to the computer, which on most printers, is
much easier than sane. Or trade files with your Windows buddies.

My experience is that if I'm going to use the thumb drive for archive
or backup, *of course* I'll format it ext4 for performance reasons.

SteveT

Steve Litt
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21