Re: [DNG] For all you automounter programmers

2016-05-04 Thread fsmithred
Someone said they wanted a non-gui way to mount removable devices by
label. Here it is. Let me know if it works for you or not. (It's working
well here.)

I'll add support for labels in the gui pmounter, too.

https://gist.github.com/fsmithred/81a4e1585175c377c32ed2f670ab9ef3

-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-04 Thread fsmithred
On 05/04/2016 05:58 AM, Boruch Baum wrote:
> On 2016-05-02 08:12, fsmithred wrote:
>> No support for file system labels at this time. If someone can tell me a
>> reliable way for unprivileged user to get the labels, I'll add it. Feel
>> free to use these scripts as they are or as motivation to create something
>> better.
> Are you looking for?:
> 
>   ls -l /dev/disk/by-label
> 

Yes, I am, thank you! I thought I looked in /dev/disk/by- and didn't find
that. OK, now I feel like I was looking for my glasses, and you let me
know they were in my hand.

This works:

ls -l /dev/disk/by-label |  awk -v pattern=${device##*/} '$0 ~ pattern {
print $9 }'

Back in business. Thanks.
-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-04 Thread Didier Kryn

Le 04/05/2016 11:58, Boruch Baum a écrit :

On 2016-05-02 08:12, fsmithred wrote:

No support for file system labels at this time. If someone can tell me a
reliable way for unprivileged user to get the labels, I'll add it. Feel
free to use these scripts as they are or as motivation to create something
better.

Are you looking for?:

   ls -l /dev/disk/by-label




Good point! It is exactly to fill that directory and 
/dev/disk/by-uuid that udev/vdev invoke blkid.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-04 Thread Boruch Baum
On 2016-05-02 08:12, fsmithred wrote:
> No support for file system labels at this time. If someone can tell me a
> reliable way for unprivileged user to get the labels, I'll add it. Feel
> free to use these scripts as they are or as motivation to create something
> better.
Are you looking for?:

  ls -l /dev/disk/by-label

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-04 Thread Didier Kryn

Le 03/05/2016 19:12, fsmithred a écrit :

@Didier - try pulling out the usb stick and replacing it with a different
one. When I do that, the cache does not get updated.

didn't try that. will do tonight :-)

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-03 Thread fsmithred
On 05/03/2016 08:46 AM, Jim Murphy wrote:
> On Tue, May 3, 2016 at 7:28 AM, Didier Kryn  wrote:
>> Le 03/05/2016 14:06, Jim Murphy a écrit :
>>>
>>> On Tue, May 3, 2016 at 4:04 AM, Didier Kryn  wrote:

 Le 02/05/2016 14:12, fsmithred a écrit :
>
> No support for file system labels at this time. If someone can tell me a
> reliable way for unprivileged user to get the labels, I'll add it. Feel
> free to use these scripts as they are or as motivation to create
> something
> better.
>
> -fsr
>
>
> On 04/28/2016 01:52 PM, fsmithred wrote:
>>
>> On 04/27/2016 08:28 PM, fsmithred wrote:
>>>
>>> You could get the label from lsblk, do 'pmount label' and it will be
>>> mounted at /media/label. Every time you plug in a thumb drive labeled
>>> backup, it'll go to the same place. If you unmount the drive,
>>> /media/label
>>> will no longer exist, so you could even have the backup script check
>>> to
>>> make sure it's there.
>>>
>>> -fsr
>>>
>> Correction - Only root can get the label from lsblk. User can get the
>> label from '/sbin/blkid -s LABEL', but only after root has run blkid at
>> least once. Other than that, I've now got a script that will handle the
>> labels... sometimes.
>>
>> -fsr
>>
>>
 kryn@apcnb98:~$ /sbin/blkid /dev/sda5
 /dev/sda5: LABEL="/" UUID="d91acaa3-5fdc-49e9-9f2b-ba7f3efb33f9"
 UUID_SUB="6a0c80cd-5dc6-4135-8018-575686e7e11e" TYPE="btrfs"
 kryn@apcnb98:~$ /sbin/blkid /dev/sda6
 /dev/sda6: LABEL="/usr" UUID="05f9f811-b8b1-445f-ac8c-9537a202a9f9"
 UUID_SUB="52b8e1b8-7080-4696-94e1-8f7580005871" TYPE="btrfs"

  Didier
>>>
>>> Problem, blkid uses a cache that is only updated when root runs blkid.
>>> Any changes are not automatically updated.  A user only sees the cache.
>>>
>>> The issues is, fsr is trying to do everything as a "user" so tools like
>>> lsblk and blkid don't work for this case. For blkid, the cache will not
>>> be up to date when say a flash-drive is add/or removed.
>>>
>>> Jim
>>
>>
>> I cannot reproduce what you describe. I just tried it with a usb stick:
>> kryn@apcnb98:~$ /sbin/blkid /dev/sdb2
>> /dev/sdb2: LABEL="Didier-Kryn-2" UUID="64f73abe-34b9-4d4c-bac7-6dd85f0e4696"
>> TYPE="reiserfs"
>>
>> This was done on debian-wheezy, from the console, without any DE
>> running, and even display manager stopped, and after a fresh reboot. If
>> blkid, invoked by normal user, runs from cache, then it means it has been
>> invoked by root after insertion - I suspect udev and consider it a good
>> thing, and I can tell you that vdev does systematically invoke blkid for
>> every block device.
>>
>> Didier
>>
> 
> Not sure where the change took place, wheezy is 2.20, I'm look at 2.25 right
> now on grm(rebuild my other system right now)l and there has been changes.
> Not sure why they changed it. Even the man page states you have to be root
> to update the cache.  fsr is reporting the same issue.  You are correct on
> wheezy it does appear to work.
> 
> Jim

I first learned of the problem in August 2014 with util-linux-2.25 in
jessie/testing when 'fdisk -l' stopped working for user in a script.
(refracta2usb)  In the first jessie-based refracta isos, we had util-linux
pinned to the wheezy version (2.20).

@Didier - try pulling out the usb stick and replacing it with a different
one. When I do that, the cache does not get updated.

-fsr


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-03 Thread Jim Murphy
On Tue, May 3, 2016 at 7:28 AM, Didier Kryn  wrote:
> Le 03/05/2016 14:06, Jim Murphy a écrit :
>>
>> On Tue, May 3, 2016 at 4:04 AM, Didier Kryn  wrote:
>>>
>>> Le 02/05/2016 14:12, fsmithred a écrit :

 No support for file system labels at this time. If someone can tell me a
 reliable way for unprivileged user to get the labels, I'll add it. Feel
 free to use these scripts as they are or as motivation to create
 something
 better.

 -fsr


 On 04/28/2016 01:52 PM, fsmithred wrote:
>
> On 04/27/2016 08:28 PM, fsmithred wrote:
>>
>> You could get the label from lsblk, do 'pmount label' and it will be
>> mounted at /media/label. Every time you plug in a thumb drive labeled
>> backup, it'll go to the same place. If you unmount the drive,
>> /media/label
>> will no longer exist, so you could even have the backup script check
>> to
>> make sure it's there.
>>
>> -fsr
>>
> Correction - Only root can get the label from lsblk. User can get the
> label from '/sbin/blkid -s LABEL', but only after root has run blkid at
> least once. Other than that, I've now got a script that will handle the
> labels... sometimes.
>
> -fsr
>
>
>>> kryn@apcnb98:~$ /sbin/blkid /dev/sda5
>>> /dev/sda5: LABEL="/" UUID="d91acaa3-5fdc-49e9-9f2b-ba7f3efb33f9"
>>> UUID_SUB="6a0c80cd-5dc6-4135-8018-575686e7e11e" TYPE="btrfs"
>>> kryn@apcnb98:~$ /sbin/blkid /dev/sda6
>>> /dev/sda6: LABEL="/usr" UUID="05f9f811-b8b1-445f-ac8c-9537a202a9f9"
>>> UUID_SUB="52b8e1b8-7080-4696-94e1-8f7580005871" TYPE="btrfs"
>>>
>>>  Didier
>>
>> Problem, blkid uses a cache that is only updated when root runs blkid.
>> Any changes are not automatically updated.  A user only sees the cache.
>>
>> The issues is, fsr is trying to do everything as a "user" so tools like
>> lsblk and blkid don't work for this case. For blkid, the cache will not
>> be up to date when say a flash-drive is add/or removed.
>>
>> Jim
>
>
> I cannot reproduce what you describe. I just tried it with a usb stick:
> kryn@apcnb98:~$ /sbin/blkid /dev/sdb2
> /dev/sdb2: LABEL="Didier-Kryn-2" UUID="64f73abe-34b9-4d4c-bac7-6dd85f0e4696"
> TYPE="reiserfs"
>
> This was done on debian-wheezy, from the console, without any DE
> running, and even display manager stopped, and after a fresh reboot. If
> blkid, invoked by normal user, runs from cache, then it means it has been
> invoked by root after insertion - I suspect udev and consider it a good
> thing, and I can tell you that vdev does systematically invoke blkid for
> every block device.
>
> Didier
>

Not sure where the change took place, wheezy is 2.20, I'm look at 2.25 right
now on grm(rebuild my other system right now)l and there has been changes.
Not sure why they changed it. Even the man page states you have to be root
to update the cache.  fsr is reporting the same issue.  You are correct on
wheezy it does appear to work.

Jim
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-03 Thread Didier Kryn

Le 02/05/2016 14:12, fsmithred a écrit :

No support for file system labels at this time. If someone can tell me a
reliable way for unprivileged user to get the labels, I'll add it. Feel
free to use these scripts as they are or as motivation to create something
better.

-fsr


On 04/28/2016 01:52 PM, fsmithred wrote:

On 04/27/2016 08:28 PM, fsmithred wrote:

You could get the label from lsblk, do 'pmount label' and it will be
mounted at /media/label. Every time you plug in a thumb drive labeled
backup, it'll go to the same place. If you unmount the drive, /media/label
will no longer exist, so you could even have the backup script check to
make sure it's there.

-fsr



Correction - Only root can get the label from lsblk. User can get the
label from '/sbin/blkid -s LABEL', but only after root has run blkid at
least once. Other than that, I've now got a script that will handle the
labels... sometimes.

-fsr






kryn@apcnb98:~$ /sbin/blkid /dev/sda5
/dev/sda5: LABEL="/" UUID="d91acaa3-5fdc-49e9-9f2b-ba7f3efb33f9" 
UUID_SUB="6a0c80cd-5dc6-4135-8018-575686e7e11e" TYPE="btrfs"

kryn@apcnb98:~$ /sbin/blkid /dev/sda6
/dev/sda6: LABEL="/usr" UUID="05f9f811-b8b1-445f-ac8c-9537a202a9f9" 
UUID_SUB="52b8e1b8-7080-4696-94e1-8f7580005871" TYPE="btrfs"


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-05-02 Thread fsmithred
I rewrote the usbpmount script so that it handles sd/mmc and cd/dvd
devices as well as usb. Get usbpmount3.tar.gz from
https://sourceforge.net/projects/refracta/files/testing

These are standalone scripts. None of the notification stuff is included,
but they could be made to work with it.

usbpmoun3.sh and usb-unmount use yad or zenity as a graphical frontend to
pmount.

thumb-pick3.sh is the command-line equivalent.

All of the scripts use hwinfo and pmount. The gui scripts need yad or zenity.

No support for file system labels at this time. If someone can tell me a
reliable way for unprivileged user to get the labels, I'll add it. Feel
free to use these scripts as they are or as motivation to create something
better.

-fsr


On 04/28/2016 01:52 PM, fsmithred wrote:
> On 04/27/2016 08:28 PM, fsmithred wrote:
>>
>> You could get the label from lsblk, do 'pmount label' and it will be
>> mounted at /media/label. Every time you plug in a thumb drive labeled
>> backup, it'll go to the same place. If you unmount the drive, /media/label
>> will no longer exist, so you could even have the backup script check to
>> make sure it's there.
>>
>> -fsr
>>
> 
> 
> Correction - Only root can get the label from lsblk. User can get the
> label from '/sbin/blkid -s LABEL', but only after root has run blkid at
> least once. Other than that, I've now got a script that will handle the
> labels... sometimes.
> 
> -fsr
> 
> 


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Steve Litt
On Thu, 28 Apr 2016 16:04:42 + (UTC)
Go Linux <goli...@yahoo.com> wrote:

> On Thu, 4/28/16, Rob Owens <row...@ptd.net> wrote:
> 
>  Subject: Re: [DNG] For all you automounter programmers
>  To: dng@lists.dyne.org
>  Date: Thursday, April 28, 2016, 9:44 AM
>  
> - Original Message -
> > From: "Steve Litt" <sl...@troubleshooters.com>  
> 
> > Do you happen to know a corresponding utility to read/write the
> > label on an ext4 formatted thumb drive partition?
> >  
> e2label /dev/sdXY my_label
> 
> 
> 
> Steve, I know it's a tool you probably wouldn't use but labels can
> also be created with gparted.
> 
> golinux

I view parted, gparted, fdisk, sfdisk, and all of those as straight
razors: One wrong move and I'm seriously wounded (or my partitions
are). I only use those to create new partitions, never to label
something. I'd rather go without a label than risk running those
partition making programs to create the label. But thanks to e2label and
dosfslabel, I don't have to. The best of both worlds!

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Didier Kryn

Le 28/04/2016 16:07, Steve Litt a écrit :

Didier Kryn  wrote:



>  But there are tools on Linux to add a label to a filesystem;
>here is the first thing I do to a new usb stick:
>
>  /sbin/dosfslabel /dev/sdb1 $my_name
>
>  Very usefull when exchanging sticks.
>
>Didier

Very, very nice!

I've been looking for something like that for a long time.

Do you happen to know a corresponding utility to read/write the label
on an ext4 formatted thumb drive partition?

apt-get install e2fsprogs

Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Rob Owens
- Original Message -
> From: "Matthew Melton" 

> A brief aside.
> Although not an automounter I remember using bbsmount on blackbox. I can't
> remember how to configure it but it sat in the blackbox dock and  if I 
> remember
> and showed icons for all the drives you wanted to show. A click would mount 
> the
> drive and another click would unmount it. I used it for ages , after 
> abandoning
> gnome, as an alternative to  automounting. I believe it works with other 
> window
> managers too, Judging from the man page here
> https://manned.org/bbsmount/d797faf8
> 
> I believe it was a blackbox add-on http://blackboxwm.sourceforge.net/ but the
> add on page is currently showing a 503 service unavailable so can't check.
> The code, if it can be obtained, might prove useful as an alternative or
> optional addition to a slimline CLI automounter. The idea of which I like the
> sound of a lot.

pcmanfm does this as well, though it relies on udisks2 and that now requires
systemd (on Debian, anyway).  I believe Thunar had very similar functionality.
spacefm, as some have mentioned here, also has this functionality but it allows
the use of different backends for performing the mounts.  As I recall, the 
choices were pmount, udevil, udisks, udisks2, and possibly others.

-Rob
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread fsmithred
On 04/27/2016 08:28 PM, fsmithred wrote:
> 
> You could get the label from lsblk, do 'pmount label' and it will be
> mounted at /media/label. Every time you plug in a thumb drive labeled
> backup, it'll go to the same place. If you unmount the drive, /media/label
> will no longer exist, so you could even have the backup script check to
> make sure it's there.
> 
> -fsr
> 


Correction - Only root can get the label from lsblk. User can get the
label from '/sbin/blkid -s LABEL', but only after root has run blkid at
least once. Other than that, I've now got a script that will handle the
labels... sometimes.

-fsr


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Matthew Melton
A brief aside.
Although not an automounter I remember using bbsmount on blackbox. I can't 
remember how to configure it but it sat in the blackbox dock and  if I remember 
and showed icons for all the drives you wanted to show. A click would mount the 
drive and another click would unmount it. I used it for ages , after abandoning 
gnome, as an alternative to  automounting. I believe it works with other window 
managers too, Judging from the man page here 
https://manned.org/bbsmount/d797faf8 

I believe it was a blackbox add-on http://blackboxwm.sourceforge.net/ but the 
add on page is currently showing a 503 service unavailable so can't check.
The code, if it can be obtained, might prove useful as an alternative or 
optional addition to a slimline CLI automounter. The idea of which I like the 
sound of a lot.

Matt 

If anyone needs me I'll be lurking under my rock...  


> -Original Message-
> From: Dng [mailto:dng-boun...@lists.dyne.org] On Behalf Of Noel Torres
> Sent: Thursday, April 28, 2016 7:50 AM
> To: dng@lists.dyne.org
> Subject: Re: [DNG] For all you automounter programmers
> 
> Didier Kryn <k...@in2p3.fr> escribió:
> >> This isn't just a theoretical thing, lots of people don't label their
> >> thumb drives.
> >>
> >> Another issue is a lot of thumb drives have the same label. I bet
> >> there are millions with the label "backup".
> >>
> >>
> > But there are tools on Linux to add a label to a filesystem; here
> > is the first thing I do to a new usb stick:
> >
> > /sbin/dosfslabel /dev/sdb1 $my_name
> >
> > Very usefull when exchanging sticks.
> >
> >   Didier
> 
> All my sticks are labeled, and I labeled none of them.
> 
> They all just came factory formatted as fat and factory labeled with the
> producer's name. This is my EMTEC stick (at /media/EMTEC) , this my BASF
> stick (at /media/BASF)... useful enough, since I do not use to plug several
> sticks at the same time, and even less several of the same brand.
> 
> Regards
> 
> Noel
> er Envite

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Go Linux
On Thu, 4/28/16, Rob Owens <row...@ptd.net> wrote:

 Subject: Re: [DNG] For all you automounter programmers
 To: dng@lists.dyne.org
 Date: Thursday, April 28, 2016, 9:44 AM
 
- Original Message -
> From: "Steve Litt" <sl...@troubleshooters.com>

> Do you happen to know a corresponding utility to read/write the label
> on an ext4 formatted thumb drive partition?
>
e2label /dev/sdXY my_label



Steve, I know it's a tool you probably wouldn't use but labels can also be 
created with gparted.

golinux


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Rob Owens
- Original Message -
> From: "Steve Litt" 

> Do you happen to know a corresponding utility to read/write the label
> on an ext4 formatted thumb drive partition?
> 
e2label /dev/sdXY my_label
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Steve Litt
On Thu, 28 Apr 2016 08:32:06 +0200
Didier Kryn  wrote:


>  But there are tools on Linux to add a label to a filesystem;
> here is the first thing I do to a new usb stick:
> 
>  /sbin/dosfslabel /dev/sdb1 $my_name
> 
>  Very usefull when exchanging sticks.
> 
>Didier

Very, very nice!

I've been looking for something like that for a long time.

Do you happen to know a corresponding utility to read/write the label
on an ext4 formatted thumb drive partition?

Thanks,

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Noel Torres

Didier Kryn  escribió:

This isn't just a theoretical thing, lots of people don't label their
thumb drives.

Another issue is a lot of thumb drives have the same label. I bet there
are millions with the label "backup".


But there are tools on Linux to add a label to a filesystem;  
here is the first thing I do to a new usb stick:


/sbin/dosfslabel /dev/sdb1 $my_name

Very usefull when exchanging sticks.

  Didier


All my sticks are labeled, and I labeled none of them.

They all just came factory formatted as fat and factory labeled with  
the producer's name. This is my EMTEC stick (at /media/EMTEC) , this  
my BASF stick (at /media/BASF)... useful enough, since I do not use to  
plug several sticks at the same time, and even less several of the  
same brand.


Regards

Noel
er Envite


binah7nz_Ljli.bin
Description: Clave PGP pública


pgpVyc3lVCJVp.pgp
Description: Firma digital PGP
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Didier Kryn

Le 28/04/2016 02:16, Steve Litt a écrit :

I think my original handled that, by creating a database of UUID, label
and device name (and now it's going to need to include user mounting it
too). So a little universal shellscript can go in the database (which
of course is a simple file), find the label, and read across the row to
find its current device so you can plug that into an environment
variable and use that.
I think the smartest job would be to read a config files for 
instructions based on the uuid. Then, only if there aren't instructions 
for the uuid of the removable media, fall back to label, This gives an 
opportunity to the admin to carefully craft what she wants to do with 
the most important media.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Noel Torres

Steve Litt  escribió:

I don't know of a way to tell pmount or udev/vdev/eudev to assign a
particular device to a thumb drive, without manually doing all the
mknod and all that. Excellent idea, very useful. But if something's
already assigned to that device, you're sol.


Insert pendrive labeled BACKUP -> Mount at /media/BACKUP
Insert another pendrive also labeled BACKUP -> Mount at /media/BACKUP_1

Not so hard :D

Regards

Noel
er Envite


bind673l1rG_r.bin
Description: Clave PGP pública


pgpmcLy7AENVY.pgp
Description: Firma digital PGP
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Didier Kryn

Le 28/04/2016 01:29, Steve Litt a écrit :

No matter what you do, somebody's going to pull one out without
umounting. I've done it. Lots of people have. Oops!

Perhaps we can include a daemon that runs sync command every 10
seconds. I doubt that would have much effect, but would probably
minimize problems with just yanking out thumb drives.


Every human makes errors. But there should be an easy way to do 
things properly.


I wouldn't run this daemon. Anyway, after copying lots of photos or 
videos, sync (or umount) can take minutes.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-28 Thread Didier Kryn

Le 28/04/2016 01:24, Steve Litt a écrit :

On Wed, 27 Apr 2016 19:35:08 +0200
Didier Kryn  wrote:


Le 27/04/2016 19:13, Steve Litt a écrit :

Not all filesystems have labels.

  For my information, could you list some? Every filesystem I ever
used to format disks had one (ext?, reiserfs, btrfs, vfat)

  Didier

You can make one with fdisk or cfdisk or parted or gparted or similar.
Just fail to include a label.

This isn't just a theoretical thing, lots of people don't label their
thumb drives.

Another issue is a lot of thumb drives have the same label. I bet there
are millions with the label "backup".


But there are tools on Linux to add a label to a filesystem; here 
is the first thing I do to a new usb stick:


/sbin/dosfslabel /dev/sdb1 $my_name

Very usefull when exchanging sticks.

  Didier


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Simon Walter


On 04/28/2016 09:28 AM, fsmithred wrote:

You could get the label from lsblk, do 'pmount label' and it will be
mounted at /media/label. Every time you plug in a thumb drive labeled
backup, it'll go to the same place. If you unmount the drive, /media/label
will no longer exist, so you could even have the backup script check to
make sure it's there.



I am a little bit fuzzy as to what distro did it, but I recall quite a 
few did. Then along came unmemorable UUIDs. Sometimes I wonder if I am 
the only one who labels partitions still. Glad to see I am not alone.

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread fsmithred
On 04/27/2016 08:16 PM, Steve Litt wrote:
> On Wed, 27 Apr 2016 19:51:54 -0400
> Hendrik Boom  wrote:
> 
>> On Wed, Apr 27, 2016 at 07:24:29PM -0400, Steve Litt wrote:
>>>
>>> Another issue is a lot of thumb drives have the same label. I bet
>>> there are millions with the label "backup".  
>>
>> And I'd like all my drives labelled "backup" to be mounted at the
>> same mountpoint so I can use one backup script for all of them.
>>
>> I really believe in multiple backups.
>>
>> -- hendrik
> 
> Ohhh! I see what you're doing: You're keying completely off
> labels so scripts work. Makes perfect sense.
> 
> I don't know of a way to tell pmount or udev/vdev/eudev to assign a
> particular device to a thumb drive, without manually doing all the
> mknod and all that. Excellent idea, very useful. But if something's
> already assigned to that device, you're sol.
> 
> But...
> 
> I think my original handled that, by creating a database of UUID, label
> and device name (and now it's going to need to include user mounting it
> too). So a little universal shellscript can go in the database (which
> of course is a simple file), find the label, and read across the row to
> find its current device so you can plug that into an environment
> variable and use that.
> 
> SteveT
> 

You could get the label from lsblk, do 'pmount label' and it will be
mounted at /media/label. Every time you plug in a thumb drive labeled
backup, it'll go to the same place. If you unmount the drive, /media/label
will no longer exist, so you could even have the backup script check to
make sure it's there.

-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Hendrik Boom
On Wed, Apr 27, 2016 at 08:16:31PM -0400, Steve Litt wrote:
> On Wed, 27 Apr 2016 19:51:54 -0400
> Hendrik Boom  wrote:
> 
> > On Wed, Apr 27, 2016 at 07:24:29PM -0400, Steve Litt wrote:
> > > 
> > > Another issue is a lot of thumb drives have the same label. I bet
> > > there are millions with the label "backup".  
> > 
> > And I'd like all my drives labelled "backup" to be mounted at the
> > same mountpoint so I can use one backup script for all of them.
> > 
> > I really believe in multiple backups.
> > 
> > -- hendrik
> 
> Ohhh! I see what you're doing: You're keying completely off
> labels so scripts work. Makes perfect sense.
> 
> I don't know of a way to tell pmount or udev/vdev/eudev to assign a
> particular device to a thumb drive, without manually doing all the
> mknod and all that. Excellent idea, very useful. But if something's
> already assigned to that device, you're sol.
> 
> But...
> 
> I think my original handled that, by creating a database of UUID, label
> and device name (and now it's going to need to include user mounting it
> too). So a little universal shellscript can go in the database (which
> of course is a simple file), find the label, and read across the row to
> find its current device so you can plug that into an environment
> variable and use that.

The current method of keying off the UUID in /etc/fstab doesn't work; 
it won't allow specifying more than on UUID at a mount point, even if 
they are never presented at once.  (which is something I'd never do to 
two independent backup drives)

-- hendrik

> 
> SteveT
> 
> Steve Litt 
> April 2016 featured book: Rapid Learning for the 21st Century
> http://www.troubleshooters.com/rl21
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 19:51:54 -0400
Hendrik Boom  wrote:

> On Wed, Apr 27, 2016 at 07:24:29PM -0400, Steve Litt wrote:
> > 
> > Another issue is a lot of thumb drives have the same label. I bet
> > there are millions with the label "backup".  
> 
> And I'd like all my drives labelled "backup" to be mounted at the
> same mountpoint so I can use one backup script for all of them.
> 
> I really believe in multiple backups.
> 
> -- hendrik

Ohhh! I see what you're doing: You're keying completely off
labels so scripts work. Makes perfect sense.

I don't know of a way to tell pmount or udev/vdev/eudev to assign a
particular device to a thumb drive, without manually doing all the
mknod and all that. Excellent idea, very useful. But if something's
already assigned to that device, you're sol.

But...

I think my original handled that, by creating a database of UUID, label
and device name (and now it's going to need to include user mounting it
too). So a little universal shellscript can go in the database (which
of course is a simple file), find the label, and read across the row to
find its current device so you can plug that into an environment
variable and use that.

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 19:22:06 +0200
Didier Kryn  wrote:

> Le 27/04/2016 19:17, Steve Litt a écrit :
> > On Wed, 27 Apr 2016 09:10:25 +0200
> > Didier Kryn  wrote:
> >
> >  
> >>   Wishlist: the "automounter" shouldn't mount automatically, by
> >> default. It should rather offer an easy mount-handle, and the
> >> umount counterpart.  
> > What is an "easy mount-handle"?
> >   
> >  
>  I mean there might be a list of connected removable media,
> showing which ones are mounted and a way to toggle mount/umount for
> each of them. I remind you that filesystems mus be unmounted before
> they are removed; this is what is called "remove safely" or "eject"
> by DEs' helpers.
 
Yes!

One program pops up upon insertion of a thumb drive, and asks mount or
not on that thumbdirve and shows the result.

But another program, started by the user, lists every thumb drive,
whether it's mounted or not, if it's mounted the user who has it
mounted, and gives mount options for the unmounted ones, and umount
options, IF THE USER IS THE ONE WHO MOUNTED IT, for the mounted ones.

No matter what you do, somebody's going to pull one out without
umounting. I've done it. Lots of people have. Oops!

Perhaps we can include a daemon that runs sync command every 10
seconds. I doubt that would have much effect, but would probably
minimize problems with just yanking out thumb drives.





-- 
SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 19:35:08 +0200
Didier Kryn  wrote:

> Le 27/04/2016 19:13, Steve Litt a écrit :
> > Not all filesystems have labels.  
>  For my information, could you list some? Every filesystem I ever 
> used to format disks had one (ext?, reiserfs, btrfs, vfat)
> 
>  Didier

You can make one with fdisk or cfdisk or parted or gparted or similar.
Just fail to include a label.

This isn't just a theoretical thing, lots of people don't label their
thumb drives. 

Another issue is a lot of thumb drives have the same label. I bet there
are millions with the label "backup".

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Marlon Nunes

Hi, what about -> https://ignorantguru.github.io/udevil ?

On 2016-04-26 15:08, 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.

SteveT

Steve Litt
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


--
Stop slacking you lazy bum!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread fsmithred
On 04/27/2016 01:27 PM, Steve Litt wrote:

>>
>> That's pretty much what my usb-mounter does. Inotifywait runs when
>> you log into the desktop, and when you plug in a thumb drive, it pops
>> up a window showing you the partitions on that device. You then
>> choose one to mount, and the script runs pmount in your name.
> 
> That sounds *perfect* to me, always assuming the "window" is a CLI
> question and answer i X isn't running. Where's the source code? I'd like
> to start using it.
> 
> Somebody suggested we package an automounter for Devuan. What you
> describe sounds like the right thing.
> 

Source code? Here's a link to a tarball that contains the scripts and
instructions on what goes where. I haven't packaged it, because I didn't
think it was finished.
https://sourceforge.net/projects/refracta/files/testing/usbwait.tar.gz/download


> 
>> Bypassing the popup window and automounting would be a simple edit,
> 
> My no-user-confirmation version was problematic and vaguely disturbing.
> I'd leave the user in the loop.
> 
>> as would making it work without a gui.
> 
> Yes. This being Devuan, some facility for asking and recieving an
> answer should be provided even if X isn't runnnig.
> 

Try the following for a no-gui solution.

Once you've mounted something(s) you can see what removable devices are
mounted by running pmount with no arguments. Then 'pumount sdd1' or
whatever to unmount it. If we worked labels into this somehow, you could
'pumount label'.

If you try to mount the same partition twice, pmount complains and the
script exits. No harm done.



#!/usr/bin/env bash
#
# thumb-pick.sh

usbdevlist=$(/usr/sbin/hwinfo --usb --short | awk '/dev\/sd/ {print $1}')
usbdevfulllist=$(/usr/sbin/hwinfo --usb --short | awk '/dev\/sd/ {print $0}')

if [[ $(echo "$usbdevlist" | wc -l) = 1 ]] ; then
device="$usbdevlist"
else
echo -e "\n\tLIST OF USB DRIVES\n$usbdevfulllist\n\nSelect a device:"
select opt in $usbdevlist ; do
device=$(echo "$opt" | awk '{ print $1 }')
break
done
fi


partition_list=$(lsblk -l | grep ${device##*/}[1-9] | awk '{ print $1 }')

echo -e "\n\nSelect a partition to mount:"
select part in $partition_list ; do
pmount "$part" || exit 1
df -h
exit 0
done


Have fun with it.
-fsr


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Hendrik Boom
On Wed, Apr 27, 2016 at 01:27:08PM -0400, Steve Litt wrote:
> On Wed, 27 Apr 2016 08:25:02 -0400
> fsmithred  wrote:
> 
> > On 04/26/2016 09:32 PM, Steve Litt wrote:
> > > On Tue, 26 Apr 2016 18:19:32 -0400
> > > fsmithred  wrote:
> > > 
> > >   
> > >> I like pmount for mounting usb devices. It's pretty smart. For
> > >> removable devices, you don't need to list them
> > >> in /etc/pmount.allow, and it handles encrypted filesystems
> > >> (cryptsetup/luks).  
> > > 
> > > 
> > > Ahh, now I remember. Pmount isn't an AUTOmounter, you still must
> > > tell it which device to mount. It doesn't mount the second you plug
> > > in your thumb drive.
> > > 
> > > Therefore: pmount, when combined with the inotifywait automounters
> > > we've all made, should be perfect.
> > > 
> > > Those pmount automounter commands should run as the user who plugs
> > > in the thumb, so rather than running straight from the init, they
> > > should probably run when you log in, and if there's already a copy
> > > running when you log in, it does nothing.
> > > 
> > > SteveT
> > >   
> > 
> > That's pretty much what my usb-mounter does. Inotifywait runs when
> > you log into the desktop, and when you plug in a thumb drive, it pops
> > up a window showing you the partitions on that device. You then
> > choose one to mount, and the script runs pmount in your name.
> 
> That sounds *perfect* to me, always assuming the "window" is a CLI
> question and answer i X isn't running. Where's the source code? I'd like
> to start using it.
> 
> Somebody suggested we package an automounter for Devuan. What you
> describe sounds like the right thing.
> 
> 
> > Bypassing the popup window and automounting would be a simple edit,
> 
> My no-user-confirmation version was problematic and vaguely disturbing.
> I'd leave the user in the loop.
> 
> > as would making it work without a gui.
> 
> Yes. This being Devuan, some facility for asking and recieving an
> answer should be provided even if X isn't runnnig.

If X isn't running on the local screen, is what I suspect you mean.
Assuming the cocept is a "local screen" is well-defined.
It might not be ideal to post the mount on the screen of someone who 
has logged in remotely by ssh -X.  But what if one ssh -x's in from a 
user that *is* on the local screen? etc., etc.

Being able to ask what's been plugged in recently with a CLI command 
might also be useful.

> 
> > I don't know what happens if
> > there are multiple users logged in at the same time, but that might
> > be an edge case.

It should certainly take account of who is logged in locally, ane whose 
virtul X terminnal is actually on the screen.  I once had a system that 
would automount plugged-in USBs for the first user it found in the 
/etc/p0assword file (starting at UID 1000, of course), whether s/he/it 
was logged in at the momet or not.  This was *always* the wrong choice.  
I had to become root to unmount; only after that could I become mysseld 
and mount again.

-- hendrik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Didier Kryn

Le 27/04/2016 19:13, Steve Litt a écrit :

Not all filesystems have labels.
For my information, could you list some? Every filesystem I ever 
used to format disks had one (ext?, reiserfs, btrfs, vfat)


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 08:25:02 -0400
fsmithred  wrote:

> On 04/26/2016 09:32 PM, Steve Litt wrote:
> > On Tue, 26 Apr 2016 18:19:32 -0400
> > fsmithred  wrote:
> > 
> >   
> >> I like pmount for mounting usb devices. It's pretty smart. For
> >> removable devices, you don't need to list them
> >> in /etc/pmount.allow, and it handles encrypted filesystems
> >> (cryptsetup/luks).  
> > 
> > 
> > Ahh, now I remember. Pmount isn't an AUTOmounter, you still must
> > tell it which device to mount. It doesn't mount the second you plug
> > in your thumb drive.
> > 
> > Therefore: pmount, when combined with the inotifywait automounters
> > we've all made, should be perfect.
> > 
> > Those pmount automounter commands should run as the user who plugs
> > in the thumb, so rather than running straight from the init, they
> > should probably run when you log in, and if there's already a copy
> > running when you log in, it does nothing.
> > 
> > SteveT
> >   
> 
> That's pretty much what my usb-mounter does. Inotifywait runs when
> you log into the desktop, and when you plug in a thumb drive, it pops
> up a window showing you the partitions on that device. You then
> choose one to mount, and the script runs pmount in your name.

That sounds *perfect* to me, always assuming the "window" is a CLI
question and answer i X isn't running. Where's the source code? I'd like
to start using it.

Somebody suggested we package an automounter for Devuan. What you
describe sounds like the right thing.


> Bypassing the popup window and automounting would be a simple edit,

My no-user-confirmation version was problematic and vaguely disturbing.
I'd leave the user in the loop.

> as would making it work without a gui.

Yes. This being Devuan, some facility for asking and recieving an
answer should be provided even if X isn't runnnig.

> I don't know what happens if
> there are multiple users logged in at the same time, but that might
> be an edge case.
> 
> So, who else beside you and me wrote something to mount thumb drives?

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Didier Kryn

Le 27/04/2016 19:17, Steve Litt a écrit :

On Wed, 27 Apr 2016 09:10:25 +0200
Didier Kryn  wrote:



  Wishlist: the "automounter" shouldn't mount automatically, by
default. It should rather offer an easy mount-handle, and the umount
counterpart.

What is an "easy mount-handle"?
  

I mean there might be a list of connected removable media, showing 
which ones are mounted and a way to toggle mount/umount for each of 
them. I remind you that filesystems mus be unmounted before they are 
removed; this is what is called "remove safely" or "eject" by DEs' helpers.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 09:10:25 +0200
Didier Kryn  wrote:


>  Wishlist: the "automounter" shouldn't mount automatically, by 
> default. It should rather offer an easy mount-handle, and the umount 
> counterpart.

What is an "easy mount-handle"?
 
SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 06:47:38 +
Noel Torres  wrote:

> Steve Litt  escribió:
> > Therefore: pmount, when combined with the inotifywait automounters
> > we've all made, should be perfect.
> >
> > Those pmount automounter commands should run as the user who plugs
> > in the thumb, so rather than running straight from the init, they
> > should probably run when you log in, and if there's already a copy
> > running when you log in, it does nothing.  
> 
> Could we just create a package with that "devuan-automounter" and
> publish it?
> 
> Regards
> 
> Noel

I don't think my automounter is ready for prime time. And after fsr's
point about pmount, I think I might change the whole philosophy of my
automounter to take advantage of pmount. Fsr's automounter might be
more ready to accompany the distro.

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Steve Litt
On Wed, 27 Apr 2016 06:46:24 +
Noel Torres  wrote:

> Joel Roth  escribió:
> > As a suggestion for an aspiring automounter writer (or
> > reminder to self) I was thinking that if we can get a
> > sufficiently unique identifier from the device (UUID, etc.)
> > it might be nice to map that to a memorable mount target.
> > It could be a noun or adjective-noun from a list that would
> > be automatically chosen and written to the device after
> > mounting.
> > [...]
> > Too weird? Okay, I'm open, just something better than
> > /mnt/sde7.  
> 
> Why not just the Label of the filesystem being mounted?

Not all filesystems have labels.

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread David Hare
Problem to come with pmount is, it doesn't seem to be maintained any
longer. I use version 0.9.99-alpha-1 (in experimental at 25 Mar 2011,
still there, install to Jessie). That one handles "loopback" and luks
files, far as I know earlier versions did not, or not properly.

D

On 27 April 2016 at 13:25, fsmithred  wrote:
> On 04/26/2016 09:32 PM, Steve Litt wrote:
>> On Tue, 26 Apr 2016 18:19:32 -0400
>> fsmithred  wrote:
>>
>>
>>> I like pmount for mounting usb devices. It's pretty smart. For
>>> removable devices, you don't need to list them in /etc/pmount.allow,
>>> and it handles encrypted filesystems (cryptsetup/luks).
>>
>>
>> Ahh, now I remember. Pmount isn't an AUTOmounter, you still must tell
>> it which device to mount. It doesn't mount the second you plug in your
>> thumb drive.
>>
>> Therefore: pmount, when combined with the inotifywait automounters
>> we've all made, should be perfect.
>>
>> Those pmount automounter commands should run as the user who plugs in
>> the thumb, so rather than running straight from the init, they should
>> probably run when you log in, and if there's already a copy running
>> when you log in, it does nothing.
>>
>> SteveT
>>
>
> That's pretty much what my usb-mounter does. Inotifywait runs when you log
> into the desktop, and when you plug in a thumb drive, it pops up a window
> showing you the partitions on that device. You then choose one to mount,
> and the script runs pmount in your name. Bypassing the popup window and
> automounting would be a simple edit, as would making it work without a
> gui. I don't know what happens if there are multiple users logged in at
> the same time, but that might be an edge case.
>
> So, who else beside you and me wrote something to mount thumb drives?
>
> -fsr
>
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread fsmithred
On 04/26/2016 09:32 PM, Steve Litt wrote:
> On Tue, 26 Apr 2016 18:19:32 -0400
> fsmithred  wrote:
> 
> 
>> I like pmount for mounting usb devices. It's pretty smart. For
>> removable devices, you don't need to list them in /etc/pmount.allow,
>> and it handles encrypted filesystems (cryptsetup/luks).
> 
> 
> Ahh, now I remember. Pmount isn't an AUTOmounter, you still must tell
> it which device to mount. It doesn't mount the second you plug in your
> thumb drive.
> 
> Therefore: pmount, when combined with the inotifywait automounters
> we've all made, should be perfect.
> 
> Those pmount automounter commands should run as the user who plugs in
> the thumb, so rather than running straight from the init, they should
> probably run when you log in, and if there's already a copy running
> when you log in, it does nothing.
> 
> SteveT
> 

That's pretty much what my usb-mounter does. Inotifywait runs when you log
into the desktop, and when you plug in a thumb drive, it pops up a window
showing you the partitions on that device. You then choose one to mount,
and the script runs pmount in your name. Bypassing the popup window and
automounting would be a simple edit, as would making it work without a
gui. I don't know what happens if there are multiple users logged in at
the same time, but that might be an edge case.

So, who else beside you and me wrote something to mount thumb drives?

-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Didier Kryn

Le 27/04/2016 09:08, Joel Roth a écrit :

Do you label all your filesystems? I don't, but you're right
that is a different function that needed be confuted with
an automounter.


I do, even for the hard disk; it's a reminder of where are /usr, 
/var and /home. The labels show up in cfdisk.


For the usb memory sticks, it is very convenient to format the 
first partition as vfat and give a label to all partitions. The first 
partition will show up with its label under Windows and all partitions 
will do the same in Linux (kde/gnome/xfce).


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Didier Kryn

Le 27/04/2016 08:46, Noel Torres a écrit :

Joel Roth  escribió:

As a suggestion for an aspiring automounter writer (or
reminder to self) I was thinking that if we can get a
sufficiently unique identifier from the device (UUID, etc.)
it might be nice to map that to a memorable mount target.
It could be a noun or adjective-noun from a list that would
be automatically chosen and written to the device after
mounting.
[...]
Too weird? Okay, I'm open, just something better than
/mnt/sde7.


Why not just the Label of the filesystem being mounted?


This is what graphical mount-helpers of most DEs do, and it's the 
most sensible thing to do. However, the skilled admin might want to 
bypass this by providing a specific  config for a specific uuid, like 
trigger some backup.


Wishlist: the "automounter" shouldn't mount automatically, by 
default. It should rather offer an easy mount-handle, and the umount 
counterpart.


Didier

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Joel Roth
On Wed, Apr 27, 2016 at 06:46:24AM +, Noel Torres wrote:
> Joel Roth  escribió:
> >As a suggestion for an aspiring automounter writer (or
> >reminder to self) I was thinking that if we can get a
> >sufficiently unique identifier from the device (UUID, etc.)
> >it might be nice to map that to a memorable mount target.
> >It could be a noun or adjective-noun from a list that would
> >be automatically chosen and written to the device after
> >mounting.
> >[...]
> >Too weird? Okay, I'm open, just something better than
> >/mnt/sde7.
> 
> Why not just the Label of the filesystem being mounted?

Do you label all your filesystems? I don't, but you're right
that is a different function that needed be confuted with
an automounter.

Cheers,

joel
 
> Regards
> 
> Noel
> er Envite

> -BEGIN PGP PUBLIC KEY BLOCK-
> Version: GnuPG v1.4.12 (GNU/Linux)
> 
> mQGiBEBaVWkRBACkDEIMdqB4j0FUD+h7CBAPa3T4IxNDTVTjaOdeARNVSVBitvKK
> NIVBT/XfrEKAxCOBzjRfAS9vTO2IYSxW9I7M/ONEsjQa1QEGfva9p03Bo1pDoYa8
> zd8pymZsLdBYTTZrxWgYWj4qY6TnRiZYi8xUoW3xEvKwmLYz02xp3OL6bwCgjuYt
> 1OemA3j2coVPd4Ye0uERS30D/R3GCqMV4/wfSWjs6994aL1NK8hZ2VdfgCiFW2s0
> IIFiy5ts29azu9S322OJZ4WmYEnrHe0fNRVzed1lTZ/yPfX3mcmBprkN+Z4b4fXz
> HtsZA2UeAfchhWHs5TFuSkBCYY1BiDnDYeEPhK+0bALgdf/jWi6/bb4NpTd9NOU5
> eQS+A/9FcDsYU4MdFi+CVivy0vbLo9LYwPyyYB5giwhvDIDx7zHcjX/Z5Nf+gZoR
> oM7RIxiFvmu9PP7msPVuBd320ypAilffMf2/2bJ4/NEE4PTW5wE0e6q0W5GPjc3b
> l32KcEi9ovohYt4aoitvB1r6zB5d5+E+AijzG8VDM4fvM5jLUrQsTm9lbCBUb3Jy
> ZXMgKEVudml0ZSkgPGVudml0ZUB0ZWxlZm9uaWNhLm5ldD6IXgQTEQIAHgUCQFpV
> aQIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRBwtADz7sfDcjApAJ4xvdZY594W
> trUrpNL5zlO+8/MKdgCfcjWh3UOSLOI8e1v29Bnmn9sixvO0OE5vZWwgRGF2aWQg
> VG9ycmVzIFRhw7FvIChFbnZpdGUpIDxlbnZpdGVAdGVsZWZvbmljYS5uZXQ+iF4E
> ExECAB4FAkBaViwCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQcLQA8+7Hw3IB
> 0wCeNcdiYyQXi8IhQ8PL01So/ud3oHcAn1nDi56Ggydw2pp6eFjINL3bIETjtCtO
> b2VsIFRvcnJlcyAoRW52aXRlKSA8ZW52aXRlQHJvbGFtYXNhby5vcmc+iF4EExEC
> AB4FAkBaVlwCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQcLQA8+7Hw3I0JgCe
> Omt0YdaqbvrdnXa/dWNqh8AwS4cAniX0VT08dAleudGTpAgmjSkawlORtC5Ob2Vs
> IERhdmlkIFRvcnJlcyBUYcOxbyA8ZW52aXRlQHJvbGFtYXNhby5vcmc+iGAEExEC
> ACAFAkhyHmsCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRBwtADz7sfDciiu
> AJ4zn1YzDj5birUgW0Uvz8l59MH6GwCfY4G1+Mk5GG5n8YnkkboJWT7uV0m0VU5v
> ZWwgRGF2aWQgVG9ycmVzIFRh8W8gKERlcGFydGFtZW50byBkZSBBc3Ryb25vbe1h
> IHkgQXN0cm9m7XNpY2EpIDxub2VsLnRvcnJlc0B1di5lcz6IYAQTEQIAIAUCSaHS
> YgIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEHC0APPux8Ny2EkAnjqXO1HS
> IebxR/2M+Be9A+qOgJ6VAJwMpuNQ/TE7RlwGDiFSTG11K3ONhbkCDQRAWlWXEAgA
> 2MMjeuEeeHHHgOX5zHqr4lCg/GYzERYS8c5xjPFFypjmedW6TdQu3YPsSMLZuFrO
> 4CUG12R9ofptboqw+DSz64eGaznBwxXEqCmFXjGa2RAKQxqmZW8bU44wdAlSKi7u
> iIIYoCnLZuB4Uxa8LAgFeNuPzW3JE2pPcab0oZy+uvpAcXnbbAdnJAxra8Cnooh/
> wgwCdx5Cz+o03GKU0bSEGN8fCkywgMy/3vk+ZY8ZtGonDIvVWgQSlAUkkuS/ollw
> VGPSUabKR/S8Zywka5ObIs/Okm3OmUeh3YldiXsrRUuKZcTMARYw98HVhi6j67Si
> IElG9nETpBbZUkOU0EaqKwADBgf/ff45K9c5UCROghKd6OvruS1n3kgo0219xxPC
> 0fwbdbzuADN4pFfeC/h4/yaJTy17lhgDtrHVQxHr3OItRIOejQ1Sw5joJSYgPWxR
> yY6s2m/2+hr/0N7jIs3BSclHA1VraBNxA7RN7Kopd1RUvJDnVJLciTXw/5y+6PQE
> iNGN9zYBgAYmjaSm9Y4lqplxiTNfhVSHUS8/EjgYtiVCniFvQmF+QT+OmtXyuXwn
> Q+kt9ZUG5U8HjucAyAeDYEp9UhxoJZvikz7daIOy93OqeOhzypolR9Z2tZE355Dr
> X5TF4ohq/0WYftnX7ytYl+d1P7vPlir0a9POFMwKFirNpU5fvYhJBBgRAgAJBQJA
> WlWYAhsMAAoJEHC0APPux8NyqkgAoIQNP1RD45b0iWFPRjmkxwAnh0/tAJ0SbU3T
> G7RLmT/DAZf2QPI0mL3JpQ==
> =7jij
> -END PGP PUBLIC KEY BLOCK-
[-- Error: could not find beginning of PGP message! --]





> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


-- 
Joel Roth
  

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Noel Torres

Steve Litt  escribió:

Therefore: pmount, when combined with the inotifywait automounters
we've all made, should be perfect.

Those pmount automounter commands should run as the user who plugs in
the thumb, so rather than running straight from the init, they should
probably run when you log in, and if there's already a copy running
when you log in, it does nothing.


Could we just create a package with that "devuan-automounter" and publish it?

Regards

Noel
er Envite


binGW0LAxtcNF.bin
Description: Clave PGP pública


pgpvtZgrFITKe.pgp
Description: Firma digital PGP
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-27 Thread Noel Torres

Joel Roth  escribió:

As a suggestion for an aspiring automounter writer (or
reminder to self) I was thinking that if we can get a
sufficiently unique identifier from the device (UUID, etc.)
it might be nice to map that to a memorable mount target.
It could be a noun or adjective-noun from a list that would
be automatically chosen and written to the device after
mounting.
[...]
Too weird? Okay, I'm open, just something better than
/mnt/sde7.


Why not just the Label of the filesystem being mounted?

Regards

Noel
er Envite


binGBl47lAXsC.bin
Description: Clave PGP pública


pgpz9L19FNzPL.pgp
Description: Firma digital PGP
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread Steve Litt
On Tue, 26 Apr 2016 18:19:32 -0400
fsmithred  wrote:


> I like pmount for mounting usb devices. It's pretty smart. For
> removable devices, you don't need to list them in /etc/pmount.allow,
> and it handles encrypted filesystems (cryptsetup/luks).


Ahh, now I remember. Pmount isn't an AUTOmounter, you still must tell
it which device to mount. It doesn't mount the second you plug in your
thumb drive.

Therefore: pmount, when combined with the inotifywait automounters
we've all made, should be perfect.

Those pmount automounter commands should run as the user who plugs in
the thumb, so rather than running straight from the init, they should
probably run when you log in, and if there's already a copy running
when you log in, it does nothing.

SteveT

Steve Litt 
April 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread Joel Roth
Steve Litt wrote:
> Hi all,
> 
> It seems like everyone in the Devuan community has written his or her
> own usb drive automounter, 

As a suggestion for an aspiring automounter writer (or
reminder to self) I was thinking that if we can get a
sufficiently unique identifier from the device (UUID, etc.)
it might be nice to map that to a memorable mount target.
It could be a noun or adjective-noun from a list that would
be automatically chosen and written to the device after
mounting.

Examples:

white-chevy
nude-mermaid
furry-possum
poor-jellyfish
happy-ant
slick-amoeba

Too weird? Okay, I'm open, just something better than
/mnt/sde7.

cheers

-- 
Joel Roth
  

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread fsmithred
On 04/26/2016 07:19 PM, Hendrik Boom wrote:
> 
> Root, as usual, us trusted to know what it is doing.
> 

OK, thanks. I just had a Homer Simpson moment. Steve's intent was to make
it possible for users to *write* not mount. I used to do something
similar, but with the uid instead of the gid. Using the floppy group is a
cool idea, so you wouldn't have to change the command for different users.

Thanks.

-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread Hendrik Boom
On Tue, Apr 26, 2016 at 06:19:32PM -0400, fsmithred wrote:
> On 04/26/2016 03:36 PM, Hendrik Boom 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
> >  
> > -- hendrik
> 
> 
> 
> This did not work for me:
> 
> $ mount -o gid=floppy,fmask=113,dmask=002 /dev/sdd1 /mnt/thumb
> mount: only root can use "--options" option

Of course, to back up the entire system, I have to be root amyway, so 
there's no problem with this restriction,

> 
> First partition is vfat, second is ext4, and that won't mount, either. I'm
> in the floppy group and also in plugdev group, and /mnt/thumb exists. What
> am I doing wrong? Or is this something the user used to be able to do but
> no longer can? (similar to what happened with blkid.)

As far as I know, mounting an ext file system as a user is a 
security risk, so there have to be enough constraints to keep the
system from interpret the permissions within the mounted volume as 
permitting the execution of arbitrary code.

Root, as usual, us trusted to know what it is doing.

Root can place an line in the /etc/fstab to make some of these 
things possible, but I've notice restrictions creeping in over the 
years.

> 
> I like pmount for mounting usb devices. It's pretty smart. For removable
> devices, you don't need to list them in /etc/pmount.allow, and it handles
> encrypted filesystems (cryptsetup/luks).
> 
> -fsr
> 
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread fsmithred
On 04/26/2016 03:36 PM, Hendrik Boom 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
>  
> -- hendrik



This did not work for me:

$ mount -o gid=floppy,fmask=113,dmask=002 /dev/sdd1 /mnt/thumb
mount: only root can use "--options" option

First partition is vfat, second is ext4, and that won't mount, either. I'm
in the floppy group and also in plugdev group, and /mnt/thumb exists. What
am I doing wrong? Or is this something the user used to be able to do but
no longer can? (similar to what happened with blkid.)

I like pmount for mounting usb devices. It's pretty smart. For removable
devices, you don't need to list them in /etc/pmount.allow, and it handles
encrypted filesystems (cryptsetup/luks).

-fsr

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread Steve Litt
On Tue, 26 Apr 2016 15:36:52 -0400
Hendrik Boom  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
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] For all you automounter programmers

2016-04-26 Thread Hendrik Boom
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
 
-- hendrik
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng