diff --git a/src/solid/devices/backends/fstab/fstabhandling.cpp b/src/solid/devices/backends/fstab/fstabhandling.cpp --- a/src/solid/devices/backends/fstab/fstabhandling.cpp +++ b/src/solid/devices/backends/fstab/fstabhandling.cpp @@ -162,9 +162,14 @@ if (_k_isFstabNetworkFileSystem(fstype, fsname) || _k_isFstabSupportedLocalFileSystem(fstype)) { const QString mountpoint = QFile::decodeName(fe->mnt_dir); - const QString device = _k_deviceNameForMountpoint(fsname, fstype, mountpoint); + QString device = _k_deviceNameForMountpoint(fsname, fstype, mountpoint); QStringList options = QFile::decodeName(fe->mnt_opts).split(QLatin1Char(',')); + // strips last slash so that the device matches the one returned by getmntent when filesystem is mounted + // even when fstab mnt_dir ends with a '/' in /etc/fstab + if (device.endsWith((QLatin1Char('/')))) { + device = device.left(device.length() - 1); + } globalFstabCache->m_fstabCache.insert(device, mountpoint); globalFstabCache->m_fstabFstypeCache.insert(device, fstype); while (!options.isEmpty()) {