LVM support #6

Closed
andrius wants to merge 109 commits from (deleted):lvm-support-rebase into master
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 4e6784c5a3 - Show all commits

View File

@ -471,3 +471,22 @@ bool LvmDevice::deactivateLV(Report& report, LvmDevice& dev, Partition& part)
part.partitionPath() });
return deactivate.run(-1) && deactivate.exitCode() == 0;
}
bool LvmDevice::activateVG(Report& report, const LvmDevice& dev)
{
ExternalCommand deactivate(report, QStringLiteral("lvm"),
{ QStringLiteral("vgchange"),
QStringLiteral("--activate"), QStringLiteral("y"),
dev.name() });
return deactivate.run(-1) && deactivate.exitCode() == 0;
}
bool LvmDevice::activateLV(Report& report, LvmDevice& dev, Partition& part)
{
Q_UNUSED(dev);
ExternalCommand deactivate(report, QStringLiteral("lvm"),
{ QStringLiteral("lvchange"),
QStringLiteral("--activate"), QStringLiteral("y"),
part.partitionPath() });
return deactivate.run(-1) && deactivate.exitCode() == 0;
}

View File

@ -75,6 +75,7 @@ public:
static bool createLVSnapshot(Report& report, LvmDevice& dev, Partition& lvpart, const QString& name, const qint64 extents = 0);
static bool resizeLV(Report& report, LvmDevice& dev, Partition& part);
static bool deactivateLV(Report& report, LvmDevice& dev, Partition& part);
static bool activateLV(Report& report, LvmDevice& dev, Partition& part);
static bool removePV(Report& report, LvmDevice& dev, const QString& pvPath);
static bool insertPV(Report& report, LvmDevice& dev, const QString& pvPath);
@ -83,6 +84,7 @@ public:
static bool removeVG(Report& report, LvmDevice& dev);
static bool createVG(Report& report, const QString vgname, const QStringList pvlist, const qint32 peSize = 4); // peSize in megabytes
static bool deactivateVG(Report& report, const LvmDevice& dev);
static bool activateVG(Report& report, const LvmDevice& dev);
protected:
void initPartitions();