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.
This commit is contained in:
parent
6f2be13f68
commit
282cfdcde1
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue