diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index f50236eff..7dddec414 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -161,11 +162,26 @@ canBeResized( PartitionCoreModule* core, const QString& partitionPath ) static FstabEntryList lookForFstabEntries( const QString& partitionPath ) { + QStringList mountOptions{ "ro" }; + + auto r = CalamaresUtils::System::runCommand( + CalamaresUtils::System::RunLocation::RunInHost, + { "blkid", "-s", "TYPE", "-o", "value", partitionPath } + ); + if ( r.getExitCode() ) + cWarning() << "blkid on" << partitionPath << "failed."; + else + { + QString fstype = r.getOutput().trimmed(); + if ( ( fstype == "ext3" ) || ( fstype == "ext4" ) ) + mountOptions.append( "noload" ); + } + FstabEntryList fstabEntries; QTemporaryDir mountsDir; mountsDir.setAutoRemove( false ); - int exit = QProcess::execute( "mount", { "-o", "ro,noload", partitionPath, mountsDir.path() } ); + int exit = QProcess::execute( "mount", { "-o", mountOptions.join(','), partitionPath, mountsDir.path() } ); if ( !exit ) // if all is well { QFile fstabFile( mountsDir.path() + "/etc/fstab" );