From 7ecdaf3ac8f63de014fce26e95444f4a420ffcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 4 Oct 2020 22:21:58 +0100 Subject: [PATCH] Fix resizing of fat partitions. Workaround a bug in fatresize (or libparted) where resizing to partition length failed. Instead try to resize to length - 1. BUG: 407834 --- src/fs/fat16.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs/fat16.cpp b/src/fs/fat16.cpp index e225178..7f79b2c 100644 --- a/src/fs/fat16.cpp +++ b/src/fs/fat16.cpp @@ -81,7 +81,7 @@ bool fat16::create(Report& report, const QString& deviceNode) bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const { - ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length), deviceNode }); + ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length - 1), deviceNode }); return cmd.run(-1) && cmd.exitCode() == 0; }