Bug 2229501

Summary: snapd snaps are mounted twice
Product: [Fedora] Fedora Reporter: thomas <exnihilo>
Component: snapdAssignee: Zygmunt Krynicki <me>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 38CC: go-sig, maciek.borzecki, me, ngompa13
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: snapd-2.61.1-0.fc39 snapd-2.61.1-0.fc38 snapd-2.61.1-0.el8 snapd-2.61.1-0.el9 snapd-2.61.1-0.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-27 01:28:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

Comment 1 Zygmunt Krynicki 2024-01-18 13:07:52 UTC
I see this and I can confirm that this happens on F39 on my system.

Comment 2 Zygmunt Krynicki 2024-01-18 13:46:50 UTC
This is now fixed in snapd 2.61.1

We believe this commit has fixed the problem: https://github.com/snapcore/snapd/commit/a6e7fa93dec2ce4301a607030184b30d344802ad

Comment 3 Fedora Update System 2024-01-18 13:48:13 UTC
FEDORA-2024-aae86b77ea has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-aae86b77ea

Comment 4 Fedora Update System 2024-01-18 14:23:48 UTC
FEDORA-2024-b5800ca988 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2024-b5800ca988

Comment 5 Fedora Update System 2024-01-19 03:33:41 UTC
FEDORA-2024-b5800ca988 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-b5800ca988`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-b5800ca988

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2024-01-19 18:03:44 UTC
FEDORA-2024-aae86b77ea has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-aae86b77ea`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-aae86b77ea

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2024-01-23 12:32:41 UTC
FEDORA-EPEL-2024-6c34072117 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-6c34072117

Comment 8 Fedora Update System 2024-01-23 13:45:33 UTC
FEDORA-EPEL-2024-5155af1ba2 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-5155af1ba2

Comment 9 Fedora Update System 2024-01-23 14:15:30 UTC
FEDORA-EPEL-2024-13ea4713f9 has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-13ea4713f9

Comment 10 Fedora Update System 2024-01-24 01:43:28 UTC
FEDORA-EPEL-2024-5155af1ba2 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-5155af1ba2

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-01-24 01:50:45 UTC
FEDORA-EPEL-2024-6c34072117 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-6c34072117

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-01-24 01:53:52 UTC
FEDORA-EPEL-2024-13ea4713f9 has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-13ea4713f9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2024-01-27 01:28:45 UTC
FEDORA-2024-aae86b77ea has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-01-27 02:12:10 UTC
FEDORA-2024-b5800ca988 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2024-02-01 01:43:09 UTC
FEDORA-EPEL-2024-5155af1ba2 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2024-02-01 01:58:06 UTC
FEDORA-EPEL-2024-13ea4713f9 has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2024-02-01 02:02:40 UTC
FEDORA-EPEL-2024-6c34072117 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.