mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Allow EXT shrinking with resize2fs
This commit is contained in:
@@ -14,3 +14,4 @@ Fixed the command used to move data to another physical volume under LVM 2.
|
||||
The percentage of a snapshot's blocks used is now shown on the Edit Snapshot page.
|
||||
---- Changes since 1.440 ----
|
||||
Filesystem space used is show on the logical volume list, and the field for a new volume's size is more user-friendly.
|
||||
When using newer versions of the resize2fs command, EXT filesystems can be shrunk as well as enlarged.
|
||||
|
||||
@@ -421,8 +421,8 @@ if ($_[0] eq "ext2" || $_[0] eq "ext3") {
|
||||
}
|
||||
elsif (&has_command("resize2fs")) {
|
||||
# Only new versions can reduce a FS
|
||||
local $out = &backquote_command("resize2fs");
|
||||
return $out =~ /resize2fs\s+([0-9\.]+)/i && $1 > 1.4 ? 2 : 1;
|
||||
local $out = &backquote_command("resize2fs 2>&1");
|
||||
return $out =~ /resize2fs\s+([0-9\.]+)/i && $1 >= 1.4 ? 2 : 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
@@ -476,10 +476,10 @@ if ($_[1] eq "ext2" || $_[1] eq "ext3") {
|
||||
# Need to shrink filesystem first, then LV
|
||||
local $cmd = "resize2fs -f '$_[0]->{'device'}' $_[2]k";
|
||||
local $out = &backquote_logged("$cmd 2>&1");
|
||||
return $? ? $out : undef;
|
||||
return $out if ($?);
|
||||
|
||||
local $err = &resize_logical_volume($_[0], $_[2]);
|
||||
return $err if ($err);
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user