:: Re: [DNG] For all you automounter p…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: fsmithred
Date:  
À: dng
Sujet: Re: [DNG] For all you automounter programmers
On 05/03/2016 08:46 AM, Jim Murphy wrote:
> On Tue, May 3, 2016 at 7:28 AM, Didier Kryn <kryn@???> wrote:
>> Le 03/05/2016 14:06, Jim Murphy a écrit :
>>>
>>> On Tue, May 3, 2016 at 4:04 AM, Didier Kryn<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