Autor: fsmithred Data: Dla: dng Temat: Re: [DNG] For all you automounter programmers
On 04/27/2016 08:16 PM, Steve Litt wrote: > On Wed, 27 Apr 2016 19:51:54 -0400
> Hendrik Boom <hendrik@???> 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
>
> Ohhhhhhhhhhh! 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.