Bug 2229501 - snapd snaps are mounted twice
Summary: snapd snaps are mounted twice
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: snapd
Version: 38
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Zygmunt Krynicki
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-06 14:25 UTC by Thomas
Modified: 2023-08-06 14:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas 2023-08-06 14:25:06 UTC
Using lsblk -pf or mount or findmnt or whatever else shows each snap mounted twice. For instance with lsblk:

/dev/loop1    squashfs    4.0    0    100%    /var/lib/snapd/snap/bare/5                                               
                                              /var/lib/snapd/snap/bare/5 

In the logs, there's the following:

Directory /var/lib/snapd/snap to mount over is not empty, mounting anyway.

This is since upgrading to F38. After comparing a F37 box, Ubuntu, and my F38 laptop, seems that it's linked to the presence of var-lib-snapd-snap.mount that mounts the directory over itself. This unit is not present on F37 nor Ubuntu.

The unit shows:
# /run/systemd/generator/var-lib-snapd-snap.mount
# Ensure that snap mount directory is mounted "shared" so snaps can be refreshed correctly (LP: #1668759).
[Unit]
Description=Ensure that the snap directory shares mount events.
[Mount]
What=/var/lib/snapd/snap
Where=/var/lib/snapd/snap
Type=none
Options=bind,shared
[Install]
WantedBy=local-fs.target

I tried to look on launchpad (assuming that what LP means) and could find the following of relevance: https://bugs.launchpad.net/snapd/+bug/1962258

This may not be a bug and so necessary to address some issues. But as I could not find documentation on this, wanted to report it. If the mounting over is using bind & shared, I suppose that this would not cause problems?

Snaps already create many loop devices and having each entry twice makes the list even longer :-)

Thanks,

Thomas

Reproducible: Always


Note You need to log in before you can comment on or make changes to this bug.