Sorry for forward everyone, forgot to send to list. ---------- Forwarded message ---------- From: Jim Murphy <srlinuxad...@gmail.com> Date: Tue, May 3, 2016 at 7:06 AM Subject: Re: [DNG] For all you automounter programmers To: Didier Kryn <k...@in2p3.fr>
On Tue, May 3, 2016 at 4:04 AM, Didier Kryn <k...@in2p3.fr> 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 _______________________________________________ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng