All of lore.kernel.org
 help / color / mirror / Atom feed
* Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
@ 2014-08-06 22:55 Linda A. Walsh
  2014-08-06 23:02 ` Bernhard Voelker
  2014-08-08  8:44 ` Karel Zak
  0 siblings, 2 replies; 6+ messages in thread
From: Linda A. Walsh @ 2014-08-06 22:55 UTC (permalink / raw)
  To: util-linux


Karel Zak wrote:
>
> Well, I'm trying to help you, so it would be nice to have more
> information about your use-case...
I think I explained that it was the default to follow user-specified
symbolic link names in following and echoing a path -- notable in shells
like bash.

if "/usr/src" is a symlink pointing to /home/src,

and under /home/src, packages points to ../packages, then when I
switch to /usr/src/packages, I see my path listed as /usr/src/packages:

>  cd /usr/src/packages
/usr/src/packages> pwd
/usr/src/packages

Only by asking an external util can I find the real name:
>  /bin/pwd
/home/packages

It's a display choice for *user-convenience* that was made over
years of feedback.

Why not allow the same paradigm in /etc/fstab and allow nocanonicalize as
an option with mounts in /etc/fstab?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
  2014-08-06 22:55 Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize Linda A. Walsh
@ 2014-08-06 23:02 ` Bernhard Voelker
  2014-08-07 19:14   ` Linda Walsh
  2014-08-08  8:44 ` Karel Zak
  1 sibling, 1 reply; 6+ messages in thread
From: Bernhard Voelker @ 2014-08-06 23:02 UTC (permalink / raw)
  To: Linda A. Walsh, util-linux

On 08/07/2014 12:55 AM, Linda A. Walsh wrote:
> if "/usr/src" is a symlink pointing to /home/src,
> 
> and under /home/src, packages points to ../packages, then when I
> switch to /usr/src/packages, I see my path listed as /usr/src/packages:
> 
>> >  cd /usr/src/packages
> /usr/src/packages> pwd
> /usr/src/packages
> 
> Only by asking an external util can I find the real name:

OT, but: no, "pwd -P" (pwd, the shell built-in) does.

Have a nice day,
Berny


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
  2014-08-06 23:02 ` Bernhard Voelker
@ 2014-08-07 19:14   ` Linda Walsh
  2014-08-08  8:08     ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: Linda Walsh @ 2014-08-07 19:14 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux

Bernhard Voelker wrote:
> On 08/07/2014 12:55 AM, Linda A. Walsh wrote:
>   
>> if "/usr/src" is a symlink pointing to /home/src,
>> and under /home/src, packages points to ../packages, then when I
>> switch to /usr/src/packages, I see my path listed as /usr/src/packages:
>>
>>     
>>>>  cd /usr/src/packages
>>>>         
>> /usr/src/packages> pwd
>> /usr/src/packages
>>
>> Only by asking an external util can I find the real name:
>>     
> OT, but: no, "pwd -P" (pwd, the shell built-in) does.
>   
Yeah... by asking the builtin for the physical path, I could see
mount -p showing you the physical path.  But wouldn't
that be "/dev/dm-x"?  Where is it coming up with /dev/mapper/<mangledname>?

It's not the link the user gave, and it's not the real device, seems like
those are "dm" internal names?

maybe mount -d? for those?

or put all of them under 1 mountop  -D{d|p|s}?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
  2014-08-07 19:14   ` Linda Walsh
@ 2014-08-08  8:08     ` Karel Zak
  0 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2014-08-08  8:08 UTC (permalink / raw)
  To: Linda Walsh; +Cc: Bernhard Voelker, util-linux

On Thu, Aug 07, 2014 at 12:14:55PM -0700, Linda Walsh wrote:
> Bernhard Voelker wrote:
> >On 08/07/2014 12:55 AM, Linda A. Walsh wrote:
> >>if "/usr/src" is a symlink pointing to /home/src,
> >>and under /home/src, packages points to ../packages, then when I
> >>switch to /usr/src/packages, I see my path listed as /usr/src/packages:
> >>
> >>>> cd /usr/src/packages
> >>/usr/src/packages> pwd
> >>/usr/src/packages
> >>
> >>Only by asking an external util can I find the real name:
> >OT, but: no, "pwd -P" (pwd, the shell built-in) does.
> Yeah... by asking the builtin for the physical path, I could see
> mount -p showing you the physical path.  But wouldn't
> that be "/dev/dm-x"?

/dev/dm-N is *private* DM path and should be nowhere used in
userspace. This is requirement from DM guys. 

> Where is it coming up with /dev/mapper/<mangledname>?

/sys/block/dm-N/dm/name
 
> It's not the link the user gave, and it's not the real device, seems like
> those are "dm" internal names?

it's official device name

> maybe mount -d? for those?

I don't plan to do anything with mount(8) output. If you want more
customized output then use findmnt(8), for long time I think about a
new column KNAME (kernel device name of the mount source). We already
have such column in lsblk(8), maybe it would be nice for findmnt(8) too.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
  2014-08-06 22:55 Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize Linda A. Walsh
  2014-08-06 23:02 ` Bernhard Voelker
@ 2014-08-08  8:44 ` Karel Zak
  2014-08-08 15:29   ` Linda Walsh
  1 sibling, 1 reply; 6+ messages in thread
From: Karel Zak @ 2014-08-08  8:44 UTC (permalink / raw)
  To: Linda A. Walsh; +Cc: util-linux

On Wed, Aug 06, 2014 at 03:55:56PM -0700, Linda A. Walsh wrote:
> It's a display choice for *user-convenience* that was made over
> years of feedback.
> 
> Why not allow the same paradigm in /etc/fstab and allow nocanonicalize as
> an option with mounts in /etc/fstab?

 You can use symlinks in fstab, but mount(8) canonicalizes the path
 before mount(2) syscall, because: 

 * kernel canonicalizes the path as well and we (userspace) want to
   be compatible with kernel to make it possible to compare paths in
   mtab (or another in userspace cached files) with /proc/mounts

 * you can think about mount table as about cache, how do you want
   keep the mount table up to date if you remove or change the link?

     mount /dev/foo /symlink
     rm /symlink

   note that "rmdir /mountpoint" (or rename) is very special situation 
   for kernel (-EBUSY)

 * it's also performance improvement to have canonical paths in the
   mount table when you want search in the table

 * etc..

      Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize.
  2014-08-08  8:44 ` Karel Zak
@ 2014-08-08 15:29   ` Linda Walsh
  0 siblings, 0 replies; 6+ messages in thread
From: Linda Walsh @ 2014-08-08 15:29 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

Karel Zak wrote:
> On Wed, Aug 06, 2014 at 03:55:56PM -0700, Linda A. Walsh wrote:
>> It's a display choice for *user-convenience* that was made over
>> years of feedback.
>>
>> Why not allow the same paradigm in /etc/fstab and allow nocanonicalize as
>> an option with mounts in /etc/fstab?
>
>  You can use symlinks in fstab, but mount(8) canonicalizes the path
>  before mount(2) syscall, because: 
>
>  * kernel canonicalizes the path as well and we (userspace) want to
>    be compatible with kernel to make it possible to compare paths in
>    mtab (or another in userspace cached files) with /proc/mounts
----
    Shells translate symlinks into physical paths before they talk to the
kernel.  There is no difference on this point.  The symlink management 
is all
done at the user level and is the "friendly" interface given to users. 
>
>  * you can think about mount table as about cache, how do you want
>    keep the mount table up to date if you remove or change the link?
>
>      mount /dev/foo /symlink
>      rm /symlink
          I'm not suggesting any changes to how mounts deal with file
system symlinks. I'm using file symlinks and the shells presenting
the logical interface to the user while presenting the physical
interface to the kernel as an example in good user-engineering that's
been developed over years.  

Similarly, letting the user call a device by the official lvm name, that may
be a symlink to some canonical name is a similar mechanism that is
**already supported** by the current mount.  It's just that you require
the mounts to be entered manually.

I simply asked for a way to specify "non-canonical" in fstab as one can
on the mount line. 


>  * it's also performance improvement to have canonical paths in the
>    mount table when you want search in the table
    Computer time is cheap compared to human time.  Keeping things more
sane for humans make more sense in terms of time and money than computers
who can handle names in GUID form among other human-difficult forms.


>
> I don't plan to do anything with mount(8) output.
I didn't ask you to do anything with the mount output.

I asked to support the same switch "non-canonical" that is already
implemented on the command line as mount-op.   The code is already
in there to do everything I am asking for.  I'm just asking for the
same option in fstab as on the command line.

>  If you want more
> customized output then use findmnt(8)
---
Not what I wanted.  I just want mount to show what is in fstab.  It used 
to do
that -- that was the standard -- I'm trying to make it easy to keep things
the same, and only add access to the command-line switch in the mntops.  The
code to handle the name display -- one way or the other is already there.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-08-08 15:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06 22:55 Specifying a generic and per-fs mount line in /etc/fstab as well as no-canonicalize Linda A. Walsh
2014-08-06 23:02 ` Bernhard Voelker
2014-08-07 19:14   ` Linda Walsh
2014-08-08  8:08     ` Karel Zak
2014-08-08  8:44 ` Karel Zak
2014-08-08 15:29   ` Linda Walsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.