After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771323 - GParted is showing duplicate mount points for unmounted encrypted file systems
GParted is showing duplicate mount points for unmounted encrypted file systems
Status: RESOLVED FIXED
Product: gparted
Classification: Other
Component: application
GIT HEAD
Other Linux
: Normal normal
: ---
Assigned To: Mike Fleetwood
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2016-09-12 20:27 UTC by Mike Fleetwood
Modified: 2016-10-19 16:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stop showing duplicate mount points (v1) (5.53 KB, patch)
2016-09-12 20:38 UTC, Mike Fleetwood
none Details | Review
GParted on openSUSE 13.2 showing multiple mount points (36.64 KB, image/png)
2016-09-13 15:21 UTC, Curtis Gedak
  Details

Description Mike Fleetwood 2016-09-12 20:27:52 UTC
Here's a fragment of the commit message explaining the bug ...


Have an unmounted file system within an open encrypted mapping and an
entry in /etc/fstab for the file system like this:

    # lsblk
    NAME           MAJ:MIN RM   SIZE RO TYPE   MOUNTPOINT
    ...
    sdb              8:16   0     8G  0 disk
    +-sdb1           8:17   0     1G  0 part
      +-sdb1_crypt 253:0    0  1022M  0 crypt
    # blkid | grep sdb1
    /dev/sdb1: TYPE="crypto_LUKS" ...
    /dev/mapper/sdb1_crypt: TYPE="ext4" ...
    # ls -l /dev/mapper/sdb1_crypt /dev/dm-0
    brw-rw----. 1 root disk 253, 0 Sep 12 19:09 /dev/dm-0
    lrwxrwxrwx. 1 root root      7 Sep 12 19:09 /dev/mapper/sdb1_crypt -> ../dm-0
    # grep sdb1 /etc/fstab
    /dev/mapper/sdb1_crypt   /mnt/1   ext4   defaults    0 0

The mount point will be shown twice for the partition:
    /mnt/1, /mnt/1


Caused by bug 767842 - File system usage missing when tools report
alternate block device names.

Fix to follow shortly.
Comment 1 Mike Fleetwood 2016-09-12 20:38:29 UTC
Created attachment 335403 [details] [review]
Stop showing duplicate mount points (v1)

Hi Curtis,

Here's the patch for this, plus a couple of minor tidy ups.

Thanks,
Mike
Comment 2 Curtis Gedak 2016-09-13 15:21:26 UTC
Created attachment 335445 [details]
GParted on openSUSE 13.2 showing multiple mount points

Hi Mike,

Thanks for this latest patch set.

Would you be able to look at another similar issue?

The attached screen shot is from an openSUSE 13.2 VM installed with /
on btrfs and /home on xfs.  With this setup GParted lists multiple
mount points for the btrfs file system.

To help with triaging the issue I have included some command line
information:


--------------------------------------------------
$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda2       10490880 9545332     41612 100% /
devtmpfs         1027672       8   1027664   1% /dev
tmpfs            1032336      80   1032256   1% /dev/shm
tmpfs            1032336    2076   1030260   1% /run
tmpfs            1032336       0   1032336   0% /sys/fs/cgroup
/dev/sda2       10490880 9545332     41612 100% /srv
/dev/sda2       10490880 9545332     41612 100% /var/tmp
/dev/sda2       10490880 9545332     41612 100% /var/lib/pgsql
/dev/sda2       10490880 9545332     41612 100% /var/crash
/dev/sda2       10490880 9545332     41612 100% /var/spool
/dev/sda2       10490880 9545332     41612 100% /var/lib/named
/dev/sda2       10490880 9545332     41612 100% /var/opt
/dev/sda2       10490880 9545332     41612 100% /var/log
/dev/sda2       10490880 9545332     41612 100% /tmp
/dev/sda2       10490880 9545332     41612 100% /opt
/dev/sda2       10490880 9545332     41612 100% /var/lib/mailman
/dev/sda2       10490880 9545332     41612 100% /usr/local
/dev/sda2       10490880 9545332     41612 100% /.snapshots
/dev/sda2       10490880 9545332     41612 100% /boot/grub2/i386-pc
/dev/sda3        8928256  104172   8824084   2% /home

$ sudo blkid
root's password:
/dev/sda1: UUID="a262f838-ff92-4c10-b680-9afd0e787300" TYPE="swap" PARTUUID="0008d6e8-01"
/dev/sda2: UUID="b5be1958-e962-4dd6-aef9-2034bad3ab0c" UUID_SUB="823db2c4-6665-47b2-b585-58d6997bc5c2" TYPE="btrfs" PTTYPE="dos" PARTUUID="0008d6e8-02"
/dev/sda3: UUID="338958f4-7213-4f7b-b7a0-42acac910189" TYPE="xfs" PARTUUID="0008d6e8-03"
/dev/sdb1: PARTUUID="f91079cb-3d08-4f96-a48d-bbadfc17133b" 

$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=1027672k,nr_inodes=215882,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
/dev/sda2 on / type btrfs (rw,relatime,space_cache)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sda2 on /srv type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/tmp type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/lib/pgsql type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/crash type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/spool type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/lib/named type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/opt type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/log type btrfs (rw,relatime,space_cache)
/dev/sda2 on /tmp type btrfs (rw,relatime,space_cache)
/dev/sda2 on /opt type btrfs (rw,relatime,space_cache)
/dev/sda2 on /var/lib/mailman type btrfs (rw,relatime,space_cache)
/dev/sda2 on /usr/local type btrfs (rw,relatime,space_cache)
/dev/sda2 on /.snapshots type btrfs (rw,relatime,space_cache)
/dev/sda2 on /boot/grub2/i386-pc type btrfs (rw,relatime,space_cache)
/dev/sda3 on /home type xfs (rw,relatime,attr2,inode64,noquota)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

$ sudo parted -l
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1579MB  1578MB  primary  linux-swap(v1)  type=82
 2      1579MB  12.3GB  10.7GB  primary  btrfs           boot, type=83
 3      12.3GB  21.5GB  9153MB  primary  xfs             type=83


Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  269MB  268MB
--------------------------------------------------


If you need any more information, please don't hesitate to ask.

Curtis
Comment 3 Mike Fleetwood 2016-09-13 19:08:27 UTC
Hi Curtis,

The code is working as currently intended.  SUSE now uses btrfs as the
root file system and then creates many subvolumes (file system trees)
and mounts lots of them.  From you debugging output:

$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda2       10490880 9545332     41612 100% /
...
/dev/sda2       10490880 9545332     41612 100% /srv
/dev/sda2       10490880 9545332     41612 100% /var/tmp
/dev/sda2       10490880 9545332     41612 100% /var/lib/pgsql
/dev/sda2       10490880 9545332     41612 100% /var/crash
/dev/sda2       10490880 9545332     41612 100% /var/spool
/dev/sda2       10490880 9545332     41612 100% /var/lib/named
/dev/sda2       10490880 9545332     41612 100% /var/opt
/dev/sda2       10490880 9545332     41612 100% /var/log
/dev/sda2       10490880 9545332     41612 100% /tmp
/dev/sda2       10490880 9545332     41612 100% /opt
/dev/sda2       10490880 9545332     41612 100% /var/lib/mailman
/dev/sda2       10490880 9545332     41612 100% /usr/local
/dev/sda2       10490880 9545332     41612 100% /.snapshots
/dev/sda2       10490880 9545332     41612 100% /boot/grub2/i386-pc

Given that /dev/sda2 *is* mounted on all these mount points what should
GParted display?

Mike
Comment 4 Curtis Gedak 2016-09-13 19:14:27 UTC
Hi Mike,

> Given that /dev/sda2 *is* mounted on all these mount points what
> should GParted display?

That's a good question.

Currently the GUI looks a bit of a mess with the wide "Mount Point" column.  I guess we haven't seen this issue before because not many distros use btrfs as the default root file system.

It seems strange to me to see the same partition actually mounted at more than one mount point.  Then again maybe I'm just old-fashioned.  :-)

I'm not sure what should be displayed, or how it should be displayed.

Curtis
Comment 5 Mike Fleetwood 2016-09-14 13:39:30 UTC
Hi Curtis,

Just to be clear, it is not just because SUSE are using btrfs as the
root file system.  It is also because they are heavily using subvolumes.
(Think of btrfs as a storage pool containing multiple file systems).
They have subvolumes for each of: /, /srv, /var/tmp, /var/lib/pgsql,
/var/crash, /var/spool, /var/lib/named, /var/opt, /var/log, /tmp, /opt,
/var/lib/mailman, /usr/local, /boot/grub2/i386-pc.

SUSE Linux Enterprise Server Documentation
Storage Administration Guide / Major File Systems in Linux
https://www.suse.com/documentation/sles-12/stor_admin/data/sec_filesystems_major.html

Mike
Comment 6 Curtis Gedak 2016-09-14 15:26:39 UTC
Thank you Mike for the clarification.  I can see that the openSUSE multiple mount issue is not the same topic as this bug report which deals with duplicate mount points for partitions.

I will resume testing your patch with the plan to commit the patch soon.

Curtis
Comment 7 Curtis Gedak 2016-09-14 15:59:23 UTC
Thank you Mike for identifying this duplicate mount point issue and
providing a patch set.

I have successfully regression tested patch set v1 from comment #1 on
the following distros:

debian    8
fedora   24
kubuntu  16.04
openSUSE 13.2   (multiple sub-volume mount points is a different issue)

Patch set v1 from comment #1 has been committed to the git repository
for inclusion in the next release of GParted.

The relevant git commits can be viewed at the following links:

Stop showing duplicate mount points for unmounted encrypted file systems (#771323)
https://git.gnome.org/browse/gparted/commit/?id=8c870cf72f535c27f316d00a1408787aaae35bc9

Remove out of date comment from the end of set_devices_thread()
https://git.gnome.org/browse/gparted/commit/?id=ab4040c5472b55d7a74cd7b29628f2481ddd6e9b

Remove left behind typedef GParted_Core::MountMapping
https://git.gnome.org/browse/gparted/commit/?id=d64283fd1af66d58e2e631fcad1ad0beb79e0cd9

Curtis
Comment 8 Curtis Gedak 2016-10-19 16:22:48 UTC
This enhancement was included in the GParted 0.27.0 release on October 19, 2016.