Disallow FS change when already in /etc/fstab

This commit is contained in:
Jamie Cameron
2010-03-23 11:17:25 -07:00
parent a4cbe582bb
commit 8cc967f4cf
3 changed files with 16 additions and 4 deletions

View File

@@ -25,3 +25,4 @@ Added support for creating EXT4 filesystems.
When editing a logical volume, the size is shown in GB or TB where possible.
---- Changes since 1.510 ----
Mounted ext, reiser, xfs and jfs logical volumes can now have their filesystem size increased, without needing an un-mount. Thanks to Caspar Smit for the suggestions and patches to implement this.
When editing a logical volume that is already in /etc/fstab, don't allow the filesystem to format it as to be changed, to prevent a mismatch.

View File

@@ -215,13 +215,22 @@ if ($in{'lv'} && !$stat[2] && !$lv->{'is_snap'}) {
print &ui_hr();
print &ui_buttons_start();
$fstype = $stat[1] || "ext3";
print &ui_buttons_row("mkfs_form.cgi", $text{'lv_mkfs'},
if ($stat[1]) {
# Use FS from fstab
print &ui_buttons_row("mkfs_form.cgi", $text{'lv_mkfs2'},
&text('lv_mkfsdesc2', uc($stat[1])),
&ui_hidden("dev", $lv->{'device'}),
&ui_hidden("fs", $stat[1]));
}
else {
# Can select FS
print &ui_buttons_row("mkfs_form.cgi", $text{'lv_mkfs'},
$text{'lv_mkfsdesc'},
&ui_hidden("dev", $lv->{'device'}),
&ui_select("fs", $fstype,
&ui_select("fs", "ext3",
[ map { [ $_, $fdisk::text{"fs_".$_}." ($_)" ] }
&fdisk::supported_filesystems() ]));
}
if (!@stat) {
# Show button for mounting

View File

@@ -87,8 +87,10 @@ lv_err2=Failed to delete logical volume
lv_pesize=Allocation block size
lv_petotal=Blocks allocated from volume group
lv_petotals=$1 out of $2
lv_mkfs=Create filesystem of type:
lv_mkfs=Create Filesystem of Type:
lv_mkfs2=Create Filesystem
lv_mkfsdesc=Select a filesystem type and click this button to create a new filesystem on this logical volume. This will erase any data currently on the volume.
lv_mkfsdesc2=Click this button to create a new $1 filesystem on this logical volume. This will erase any data currently on the volume.
lv_toobig=The new volume size is $1 blocks (of $2 each), but only $3 are free in the volume group.
lv_snapof=Snapshot of logical volume
lv_nosnap=Could not determine!