public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* mount --no-canonical seems broken.
@ 2013-04-22 22:30 Linda Walsh
  2013-04-23 12:36 ` Karel Zak
  0 siblings, 1 reply; 8+ messages in thread
From: Linda Walsh @ 2013-04-22 22:30 UTC (permalink / raw)
  To: util-linux



I would use mount --no-canonical to rewrite mtab to match fstab so

my utils could find volumes in /etc/fstab -- but recently in
util-linux-2.21.2
this has no longer worked.

I made sure to have /etc/mtab NOT be a symlink to /proc/self/mounts so
mount could write to it.  It DOES write to it, but it doesn't display it.

Example:
After doing a remount as recommended by the manpage...

    mount -f --no-canonical -a -o remount

mount and df now produce different output.


Ishtar:home/../archive# echo $PWD
/home/.snapdir/@GMT-2013.04.16-05.07.03/archive

Ishtar:home/../archive# df .
Filesystem                         Size  Used Avail Use% Mounted on
/dev/HnS/Home-2013.04.16-05.07.03  1.0T  787G  238G  77%
/home/.snapdir/@GMT-2013.04.16-05.07.03

Ishtar:home/../archive# mount |grep /home/snapdir
Ishtar:home/../archive# mount |grep 04.16
/dev/mapper/HnS-Home--2013.04.16--05.07.03 on
/home/.snapdir/@GMT-2013.04.16-05.07.03 type xfs (ro,nouuid,norecovery)

I've tried up to version util-linux-2.23-rc2....


Ideas?










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

* Re: mount --no-canonical seems broken.
  2013-04-22 22:30 mount --no-canonical seems broken Linda Walsh
@ 2013-04-23 12:36 ` Karel Zak
  2013-04-24  0:39   ` Linda Walsh
  0 siblings, 1 reply; 8+ messages in thread
From: Karel Zak @ 2013-04-23 12:36 UTC (permalink / raw)
  To: Linda Walsh; +Cc: util-linux

On Mon, Apr 22, 2013 at 03:30:45PM -0700, Linda Walsh wrote:
> 
> I would use mount --no-canonical to rewrite mtab to match fstab so
> 
> my utils could find volumes in /etc/fstab -- but recently in
> util-linux-2.21.2
> this has no longer worked.
> 
> I made sure to have /etc/mtab NOT be a symlink to /proc/self/mounts so
> mount could write to it.  It DOES write to it, but it doesn't display it.
> 
> Example:
> After doing a remount as recommended by the manpage...
> 
>     mount -f --no-canonical -a -o remount

 Well, --no-canonicalize assume that all paths are already
 canonicalized and the remount updates mount options only.


 What exactly do you want to do? Maybe we can try to find a better
 solution than play nasty games with mtab ;-)

    Karel


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

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

* Re: mount --no-canonical seems broken.
  2013-04-23 12:36 ` Karel Zak
@ 2013-04-24  0:39   ` Linda Walsh
  2013-04-25  6:15     ` Linda Walsh
  2013-05-20  7:40     ` Karel Zak
  0 siblings, 2 replies; 8+ messages in thread
From: Linda Walsh @ 2013-04-24  0:39 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux





Karel Zak wrote:
> On Mon, Apr 22, 2013 at 03:30:45PM -0700, Linda Walsh wrote:
>   
>> I would use mount --no-canonical to rewrite mtab to match fstab so
>>
>> my utils could find volumes in /etc/fstab -- but recently in
>> util-linux-2.21.2
>> this has no longer worked.
>>
>> I made sure to have /etc/mtab NOT be a symlink to /proc/self/mounts so
>> mount could write to it.  It DOES write to it, but it doesn't display it.
>>
>> Example:
>> After doing a remount as recommended by the manpage...
>>
>>     mount -f --no-canonical -a -o remount
>>     
>
>  Well, --no-canonicalize assume that all paths are already
>  canonicalized and the remount updates mount options only.
>   
---
    Well my main concern has been how lvm volumes are renamed.

i.e. /dev/Vol-group/Log-vol ->
/dev/mapper/Vol--group-Log--vol

I have backup and file-system utils that use the values in fstab, and it
looks for those values in the output of mount (and df).

Also, recently, (in the "mostest latest" ;-), mount in my distro (suse),
the root dev has disappeared... I don't get /dev/sdc1 (my root partition)
I get /dev/root -- and only if I follow the symlink in /dev, will I find
/dev/sdc6.

But that's just the latest probl... the other stuff...

I've been using the mount --no-canonicalize to mount my lvm volumes --
and also going back and doing the "mount -f --nocanonicalize ..." to get the
ones mounted at boot time.

Now... programs crashing, dogs and cats living togther... heinous! 

??ideas?
Note -- I don't recall doing anything with mtab BEFORE -- BUT I may have
made sure it was a separate file years ago when I started using lvm.

Recently it was changed back to a symlink and on top of that -- whether
it is a file or a symlink, mount doesn't seem to show the "non-canon" name
(i.e. /dev/Vol/Log...)
(though oddly enough -- "df" does!)...






>
>  What exactly do you want to do? Maybe we can try to find a better
>  solution than play nasty games with mtab ;-)
>
>     Karel
>
>
>   


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

* Re: mount --no-canonical seems broken.
  2013-04-24  0:39   ` Linda Walsh
@ 2013-04-25  6:15     ` Linda Walsh
  2013-05-20  7:40     ` Karel Zak
  1 sibling, 0 replies; 8+ messages in thread
From: Linda Walsh @ 2013-04-25  6:15 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux





Linda Walsh wrote:
> Note -- I don't recall doing anything with mtab BEFORE -- BUT I may have
> made sure it was a separate file years ago when I started using lvm.
>
> Recently it was changed back to a symlink and on top of that -- whether
> it is a file or a symlink, mount doesn't seem to show the "non-canon" name
> (i.e. /dev/Vol/Log...)
> (though oddly enough -- "df" does!)..
>   

--------------
Note, to give an example of what is broken if you DO link /etc/mtab ->
/proc/self/mounts:
(from 'df''):


/dev/root                           12G  8.8G  3.3G  73% /
/dev/sdc6                           15G   10G  5.0G  67% /usr
/dev/sdc2                          7.8G  2.0G  5.9G  25% /var
/dev/sdc2                          7.8G  2.0G  5.9G  25% /tmp
/dev/sdc3                          908M  585M  323M  65% /boot
/dev/mapper/HnS-Share              1.5T  1.4T  153G  91% /Share
/dev/mapper/HnS-Home               1.0T  792G  233G  78% /home
/dev/mapper/HnS-Squid_Cache        128G   43G   86G  33% /var/cache/squid
/dev/mapper/Backups-Backups         11T  9.7T  1.3T  89% /backups
/dev/mapper/Media-Media            7.3T  6.4T  943G  88% /Media
/dev/HnS/Home-2013.03.29-21.00.11  1.5G  1.3G  208M  86%
/home/.snapdir/@GMT-2013.03.29-21.00.11
/dev/HnS/Home-2013.04.06-13.22.10  2.4G  2.1G  369M  85%
/home/.snapdir/@GMT-2013.04.06-13.22.10
/dev/HnS/Home-2013.04.08-05.07.04  1.2G 1008M  155M  87%
/home/.snapdir/@GMT-2013.04.08-05.07.04
/dev/HnS/Home-2013.04.10-05.07.03  1.2G  1.1G  160M  87%
/home/.snapdir/@GMT-2013.04.10-05.07.03
/dev/HnS/Home-2013.04.12-05.07.03  1.2G 1010M  153M  87%
/home/.snapdir/@GMT-2013.04.12-05.07.03
/dev/HnS/Home-2013.04.24-05.07.02  1.0T  792G  233G  78%
/home/.snapdir/@GMT-2013.04.24-05.07.02
/dev/HnS/Home-2013.04.16-05.07.03  8.1G  6.8G  1.3G  85%
/home/.snapdir/@GMT-2013.04.16-05.07.03

----
The only correct entries above are /dev/sdc? and the /dev/HnS/  lines, but
the last lines are correct as they are mounted by a script that mounts
the snapshot
and it uses no-canonicalize on mount.

The LVM volumes mounted at boot from /etc/fstab don't match the
names in fstab.

The output from mount is worse -- it has the last entries wrong as well --
even though no-canonicalize was specified on mount (as df shows),
mount shows:
/dev/mapper/HnS-Home--2013.03.29--21.00.11 on
/home/.snapdir/@GMT-2013.03.29-21.00.11 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.06--13.22.10 on
/home/.snapdir/@GMT-2013.04.06-13.22.10 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.08--05.07.04 on
/home/.snapdir/@GMT-2013.04.08-05.07.04 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.10--05.07.03 on
/home/.snapdir/@GMT-2013.04.10-05.07.03 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.12--05.07.03 on
/home/.snapdir/@GMT-2013.04.12-05.07.03 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.24--05.07.02 on
/home/.snapdir/@GMT-2013.04.24-05.07.02 type xfs
(ro,relatime,nouuid,norecovery,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)
/dev/mapper/HnS-Home--2013.04.16--05.07.03 on
/home/.snapdir/@GMT-2013.04.16-05.07.03 type xfs
(rw,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=1536,noquota)

If I use separate /etc/fstab && mtab, then running "mount -f
-no-canonicalize -a" will fix
all of the paths to match what is in /etc/fstab -- FOR 'df'' -- but not
for mount...
mount stays broken either way.

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

* Re: mount --no-canonical seems broken.
  2013-04-24  0:39   ` Linda Walsh
  2013-04-25  6:15     ` Linda Walsh
@ 2013-05-20  7:40     ` Karel Zak
  2013-05-20 23:30       ` Linda Walsh
  1 sibling, 1 reply; 8+ messages in thread
From: Karel Zak @ 2013-05-20  7:40 UTC (permalink / raw)
  To: Linda Walsh; +Cc: util-linux

On Tue, Apr 23, 2013 at 05:39:35PM -0700, Linda Walsh wrote:
>     Well my main concern has been how lvm volumes are renamed.
> 
> i.e. /dev/Vol-group/Log-vol ->
> /dev/mapper/Vol--group-Log--vol

The /dev/mapper/<name> is the canonical name, this is only
user-friendly name that is possible to generate by utils in userspace,
because the <name> is exported by /sys/block/dm-<n>/dm/name to
userspace. 

Things like /dev/Vol-group/Log-vol are LVM specific and
there is no way how to convert /dev/dm-<n> to this format. This is
reason why mount(8) canonicalizes the names to /dev/mapper/<name>.

> I have backup and file-system utils that use the values in fstab, and it
> looks for those values in the output of mount (and df).

The ideal solution is to use utils which are able to convert
symlinks/tags/whatever to canonical device names. It's mistake to
assume that fstab matches with /proc/mounts.

Use
    $ findmnt --fstab --canonicalize --evaluate

to get canonical paths and evaluated tags.

> I've been using the mount --no-canonicalize to mount my lvm volumes --
> and also going back and doing the "mount -f --nocanonicalize ..." to get the
> ones mounted at boot time.

> Recently it was changed back to a symlink and on top of that -- whether
> it is a file or a symlink, mount doesn't seem to show the "non-canon" name
> (i.e. /dev/Vol/Log...)
> (though oddly enough -- "df" does!)...

The problem is that "mount" (without options) prints always canonicalized 
paths (and in this case --no-canonicalize has no effect, this option
is used for mounting only). It means if you have non-canonical paths
in /etc/mtab then "mount" still prints canonical paths. I can fix it
and make the output sensitive to --no-canonicalize option too.

Anyway, use findmnt, it provides but complete control on the output.

    Karel

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

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

* Re: mount --no-canonical seems broken.
  2013-05-20  7:40     ` Karel Zak
@ 2013-05-20 23:30       ` Linda Walsh
  2013-05-21  9:47         ` Karel Zak
  0 siblings, 1 reply; 8+ messages in thread
From: Linda Walsh @ 2013-05-20 23:30 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Linux-Kernel




Karel Zak wrote:
>
> The problem is that "mount" (without options) prints always canonicalized 
> paths (and in this case --no-canonicalize has no effect, this option
> is used for mounting only). It means if you have non-canonical paths
> in /etc/mtab then "mount" still prints canonical paths. I can fix it
> and make the output sensitive to --no-canonicalize option too.
>
> Anyway, use findmnt, it provides but complete control on the output.
>
>     Karel
>   
----
    Sure give better control, but not as widely known as "df" or "mount".

I might point out that by default,
> findmnt /

TARGET SOURCE    FSTYPE OPTIONS
/      /dev/root xfs    rw,nodiratime,relatime,attr2,inode64,noquota
> > l /dev/root
ls: cannot access /dev/root: No such file or directory

-----
It's not a device in /dev/ nor is it in /proc/devices.

Conversely, 

klogd 1.4.1, log source = ksyslog started.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.9.0-Isht-Van (law@Ishtar) (gcc version
4.7.2 20130205 [gcc-4_7-branch revision 195759] (SUSE Linux) ) #6 SMP
PREEMPT Wed May 8 17:28:40 PDT 2013
[    0.000000] Command line: BOOT_IMAGE=390-Isht-Van rw root=/dev/sdc1
root=/dev/sdc1 showopts console=ttyS0,115200n8 console=tty0 elevator=cfq
pcie_aspm=force pcie_ports=native reboot=bios

The kernel seems to know the root image at boot (even told twice from
this output!)

Not to mention, there is some comment in the kernel-related code of using
/dev/root because there is no writable storage available... even though
the command line
shows that root is mounted 'rw'...




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

* Re: mount --no-canonical seems broken.
  2013-05-20 23:30       ` Linda Walsh
@ 2013-05-21  9:47         ` Karel Zak
  2013-05-21 19:31           ` Linda Walsh
  0 siblings, 1 reply; 8+ messages in thread
From: Karel Zak @ 2013-05-21  9:47 UTC (permalink / raw)
  To: Linda Walsh; +Cc: util-linux, Linux-Kernel

On Mon, May 20, 2013 at 04:30:21PM -0700, Linda Walsh wrote:
>  widely known as "df" or "mount".
> 
> I might point out that by default,
> > findmnt /
> 
> TARGET SOURCE    FSTYPE OPTIONS
> /      /dev/root xfs    rw,nodiratime,relatime,attr2,inode64,noquota
> > > l /dev/root
> ls: cannot access /dev/root: No such file or directory

 util-linux 2.23 ? 
 
 libmount since this version is able to use the root= kernel command
 line option to convert /dev/root from the /proc/self/mountinfo file
 to a real device name.

    Karel

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

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

* Re: mount --no-canonical seems broken.
  2013-05-21  9:47         ` Karel Zak
@ 2013-05-21 19:31           ` Linda Walsh
  0 siblings, 0 replies; 8+ messages in thread
From: Linda Walsh @ 2013-05-21 19:31 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Linux-Kernel





Karel Zak wrote:
> On Mon, May 20, 2013 at 04:30:21PM -0700, Linda Walsh wrote:
>   
>>  widely known as "df" or "mount".
>>
>> I might point out that by default,
>>     
>>> findmnt /
>>>       
>> TARGET SOURCE    FSTYPE OPTIONS
>> /      /dev/root xfs    rw,nodiratime,relatime,attr2,inode64,noquota
>>     
>>>> l /dev/root
>>>>         
>> ls: cannot access /dev/root: No such file or directory
>>     
>
>  util-linux 2.23 ? 
>  
>  libmount since this version is able to use the root= kernel command
>  line option to convert /dev/root from the /proc/self/mountinfo file
>  to a real device name.
>   
----
    I'm only at 2.19, will get & try newer version.  Thanks!



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

end of thread, other threads:[~2013-05-21 19:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 22:30 mount --no-canonical seems broken Linda Walsh
2013-04-23 12:36 ` Karel Zak
2013-04-24  0:39   ` Linda Walsh
2013-04-25  6:15     ` Linda Walsh
2013-05-20  7:40     ` Karel Zak
2013-05-20 23:30       ` Linda Walsh
2013-05-21  9:47         ` Karel Zak
2013-05-21 19:31           ` Linda Walsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox