Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]emerge-webrsync fails
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Sat Sep 14, 2019 10:02 pm    Post subject: Reply with quote

Mount point placement and LVM vs. physical are completely separate. Neither cares about the other. Mounting a filesystem on a directory always hides the prior contents, whether the filesystem is hosted on an LVM or physical volume. The extra space is not wasted, because space is accounted at the filesystem level, so non-shadowed directories from the outer filesystem can still use that space.

Please show a specific minimal set of commands, executable as root, that demonstrate the problem you think you found.
Back to top
View user's profile Send private message
n8V8r
n00b
n00b


Joined: 28 Jun 2018
Posts: 24

PostPosted: Sun Sep 15, 2019 9:10 am    Post subject: Reply with quote

Standing corrected about PV vs LV since both exhibit the same behaviour indeed.
Code:
mount -vt ext4 PARTLABEL=pv2 /mnt/gentoo/var -o defaults,journal_checksum,nosuid,noexec,nodev,relatime
mount -vt ext4 PARTLABEL=pv3 /mnt/gentoo/var/tmp -o defaults,journal_checksum,nosuid,noexec,nodev,relatime

then ends with
Code:
mount: /mnt/gentoo/var/tmp: mount point does not exist
since the /tmp on /var being hidden. reversing the order, of course having first demounted the volumes,
Code:
mount -vt ext4 PARTLABEL=pv3 /mnt/gentoo/var/tmp -o defaults,journal_checksum,nosuid,noexec,nodev,relatime
mount -vt ext4 PARTLABEL=pv2 /mnt/gentoo/var -o defaults,journal_checksum,nosuid,noexec,nodev,relatime

mounts both volumes but hides the content of /var
for the latter case
Code:
findmount
then prints
Code:
TARGET                       SOURCE      FSTYPE   OPTIONS
`-/mnt/gentoo                /dev/sda1   ext4     rw,relatime,errors=remount-ro
  |-/mnt/gentoo/var/tmp      /dev/sda3   ext4     rw,nosuid,nodev,noexec,relatime
  `-/mnt/gentoo/var          /dev/sda2   ext4     rw,nosuid,nodev,noexec,relatime

Which seems to indicate /var being a submount of /var/tmp.

Perhaps what baffles me is that transitioning from a systemd node this sort of stacked submounts in fstab never been an issue. Reading https://www.freedesktop.org/software/systemd/man/systemd.mount.html though perhaps explains it

Quote:
The following dependencies are implicitly added:

If a mount unit is beneath another mount unit in the file system hierarchy, both a requirement dependency and an ordering dependency between both units are created automatically.


[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Sun Sep 15, 2019 4:22 pm    Post subject: Reply with quote

n8V8r wrote:
Code:
mount: /mnt/gentoo/var/tmp: mount point does not exist
since the /tmp on /var being hidden. reversing the order, of course having first demounted the volumes,
So create a directory tmp at the root of the filesystem that is mounted on var. This is how mount has always worked.
n8V8r wrote:
for the latter case
Code:
findmount
I don't have a findmount. Did you mean findmnt from sys-apps/util-linux?
n8V8r wrote:
then prints
Code:
TARGET                       SOURCE      FSTYPE   OPTIONS
`-/mnt/gentoo                /dev/sda1   ext4     rw,relatime,errors=remount-ro
  |-/mnt/gentoo/var/tmp      /dev/sda3   ext4     rw,nosuid,nodev,noexec,relatime
  `-/mnt/gentoo/var          /dev/sda2   ext4     rw,nosuid,nodev,noexec,relatime
Which seems to indicate /var being a submount of /var/tmp.
No, it means var is a sibling of /var/tmp. They are both mounted on the same parent filesystem, /mnt/gentoo. If it was trying to show a submount, it would be more deeply indented. The backtick seems to be just an indicator that this is the last of the siblings, and the next line will describe a mount with a different parent. For example:
Code:
|-/sys                        sysfs        sysfs    rw,relatime
| |-/sys/firmware/efi/efivars efivarfs     efivarfs ro,relatime
| `-/sys/fs/cgroup            cgroup_root  tmpfs    rw,nosuid,nodev,noexec,relatime,size=1
|   |-/sys/fs/cgroup/blkio    blkio        cgroup   rw,nosuid,nodev,noexec,relatime,blkio,
|   `-/sys/fs/cgroup/devices  devices      cgroup   rw,nosuid,nodev,noexec,relatime,device
n8V8r wrote:
Perhaps what baffles me is that transitioning from a systemd node this sort of stacked submounts in fstab never been an issue.
It is also not an issue if you prepare the outer filesystems correctly. Every place where you wish to mount a directory (and the root of a filesystem is a directory) must have a directory on the outer filesystem, preferably although not necessarily empty. I say preferably because once the inner filesystem is mounted, you cannot traverse into the over-mounted directory on the outer filesystem, so you cannot name anything inside it. There are cases where this is actually useful though, such as bind mounting an empty directory to shadow out some files you don't want a process to see. You can still get into the over-mounted directory by non-recursively binding one of its parents somewhere else.
n8V8r wrote:
Reading https://www.freedesktop.org/software/systemd/man/systemd.mount.html though perhaps explains it

Quote:
The following dependencies are implicitly added:

If a mount unit is beneath another mount unit in the file system hierarchy, both a requirement dependency and an ordering dependency between both units are created automatically.
Wonderful. So if you actually wanted an over-mount relation, you can't do it? Even better, they train people not to configure their system correctly by silently fixing up mistakes. I'd prefer they either not add implicit dependencies at all, or if they add them, log some diagnostic telling you that systemd is trying to Do What You Mean, not Do What You Said. Such a warning would be silenced by explicitly saying what you mean.

I think what you want here is the following (including some commands you've already run):
Code:
# lvm lvcreate -L$size1 $volumegroup -nvar
# lvm lvcreate -L$size2 $volumegroup -nvartmp
# mkfs​.ext4 $mkfsoptions /dev/mapper/$volumegroup-var
# mkfs​.ext4 $mkfsoptions /dev/mapper/$volumegroup-vartmp
# mount /dev/mapper/$volumegroup-var /var
# mkdir /var/tmp
# mount /dev/mapper/$volumegroup-vartmp /var/tmp
# findmnt
# df -h
That mkdir must occur after mounting var, and before trying to mount vartmp. If you move it earlier, you make the directory on the root filesystem, where it will be hidden when you mount var. If you make it later, it is not ready in time to mount vartmp.
Back to top
View user's profile Send private message
n8V8r
n00b
n00b


Joined: 28 Jun 2018
Posts: 24

PostPosted: Sun Sep 15, 2019 5:14 pm    Post subject: Reply with quote

Hu wrote:
So create a directory tmp at the root of the filesystem that is mounted on var. This is how mount has always worked.
That mkdir must occur after mounting var, and before trying to mount vartmp. If you move it earlier, you make the directory on the root filesystem, where it will be hidden when you mount var. If you make it later, it is not ready in time to mount vartmp

Thank you for taking the time and making the effort.
After some reading about mount and filesystem/directory tree/ hierarch and parent/base child/sub mounts I reached that conclusion meantime as well.
Unfortunately the handbook is scarce on mount point stacking, perhaps presumes that the users is familiar with mount/localmount.
Well, lesson learned - been too cushioned by systemd I reckon...

Hu wrote:
I don't have a findmount. Did you mean findmnt from sys-apps/util-linux?

Pardon, been a clerical error

Hu wrote:
The backtick seems to be just an indicator that this is the last of the siblings, and the next line will describe a mount with a different parent.

Figured the backtick appears only because UFT-8 locale has not been generated.

Hu wrote:
Wonderful. So if you actually wanted an over-mount relation, you can't do it? Even better, they train people not to configure their system correctly by silently fixing up mistakes. I'd prefer they either not add implicit dependencies at all, or if they add them, log some diagnostic telling you that systemd is trying to Do What You Mean, not Do What You Said. Such a warning would be silenced by explicitly saying what you mean.

Well, that is systemd and one of the reasons for me to transition to Gentoo without it. Albeit these first steps been a bit time consuming and jarring, hoping that the rides get smoother from now on.

Apprecaite the good rapport/input from the forum users.

Suppose the topic could be marked as solved then but I cannot find a button or knob to do so?
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 588
Location: Somewhere in Denmark

PostPosted: Sun Sep 15, 2019 5:29 pm    Post subject: Reply with quote

Just edit you first post - then you can add SOLVED to topic :)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15294

PostPosted: Sun Sep 15, 2019 6:03 pm    Post subject: Reply with quote

I have UTF-8 enabled and I still get the backtick.

I wasn't aware systemd had that automatic ordering quirk. Since it does, you probably won't be the last person to be misled by it.
Back to top
View user's profile Send private message
n8V8r
n00b
n00b


Joined: 28 Jun 2018
Posts: 24

PostPosted: Sun Sep 15, 2019 6:12 pm    Post subject: Reply with quote

First hint about mount being a systemd unit it found in this forum https://forums.gentoo.org/viewtopic-p-7957766.html

And then I read this https://crappyadm1n.wordpress.com/2015/08/12/controlling-filesystem-mount-order-in-rhel-7/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum