Commit 282cfdcd authored by Andrius Štikonas's avatar Andrius Štikonas
Browse files

Do not destroy zfs pool when removing zfs partition.

This can be dangerous, e.g. if partition is part of raid set.
So better be more cautious and in some cases fail to remove partition
than lose data.
parent 6f2be13f
......@@ -77,13 +77,6 @@ qint64 zfs::maxCapacity() const
return Capacity::unitFactor(Capacity::Unit::Byte, Capacity::Unit::EiB);
}
bool zfs::remove(Report& report, const QString& deviceNode) const
{
Q_UNUSED(deviceNode)
ExternalCommand cmd(report, QStringLiteral("zpool"), { QStringLiteral("destroy"), QStringLiteral("-f"), label() });
return cmd.run(-1) && cmd.exitCode() == 0;
}
bool zfs::writeLabel(Report& report, const QString& deviceNode, const QString& newLabel)
{
Q_UNUSED(deviceNode)
......
......@@ -35,7 +35,6 @@ public:
public:
void init() override;
bool remove(Report& report, const QString& deviceNode) const override;
bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
CommandSupportType supportGetUsed() const override {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment