require './lvm-lib.pl';
&ReadParse();
($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
+$vg || &error($text{'vg_egone'});
@lvs = &list_logical_volumes($in{'vg'});
$vgdesc = &text('lv_vg', $vg->{'name'});
if ($in{'lv'}) {
($lv) = grep { $_->{'name'} eq $in{'lv'} } @lvs;
+ $lv || &error($text{'lv_egone'});
&ui_print_header($vgdesc, $lv->{'is_snap'} ? $text{'lv_edit_snap'}
: $text{'lv_edit'}, "");
@stat = &device_status($lv->{'device'});
require './lvm-lib.pl';
&ReadParse();
($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
+$vg || &error($text{'vg_egone'});
$vgdesc = &text('pv_vg', $vg->{'name'});
if ($in{'pv'}) {
@pvs = &list_physical_volumes($in{'vg'});
($pv) = grep { $_->{'name'} eq $in{'pv'} } @pvs;
+ $pv || &error($text{'pv_egone'});
&ui_print_header($vgdesc, $text{'pv_edit'}, "");
}
else {
if ($in{'vg'}) {
($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
+ $vg || &error($text{'vg_egone'});
&ui_print_header(undef, $text{'vg_edit'}, "");
}
else {
lv_freedisk=Free space
lv_pvs=Physical volumes allocated
lv_snapusage=Snapshot use percentage
+lv_egone=Logical volume no longer exists!
mkfs_title=Create Filesystem
mkfs_desc=This form allows you to build a new $2 ($1) filesystem on logical volume $3. All existing data will be erased.
pv_eother=Missing or invalid disk device
pv_raid=RAID device $1
pv_lvs=Allocation by logical volumes
+pv_egone=Physical volume no longer exists!
vg_edit=Edit Volume Group
vg_create=Create Volume Group
vg_deleteok=Delete Now
vg_ename=Missing or invalid volume group name
vg_epesize=Missing or invalid allocation block size
+vg_egone=Volume group no longer exists!
log_create_vg=Created volume group $1
log_modify_vg=Modified volume group $1
&ReadParse();
($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
-($lv) = grep { $_->{'name'} eq $in{'lv'} } &list_logical_volumes($in{'vg'})
- if ($in{'lv'});
+$vg || &error($text{'vg_egone'});
+if ($in{'lv'}) {
+ ($lv) = grep { $_->{'name'} eq $in{'lv'} }
+ &list_logical_volumes($in{'vg'});
+ $lv || &error($text{'lv_egone'});
+ $oldlv = { %$lv };
+ }
if ($in{'confirm'}) {
# Delete the logical volume
$lv->{'perm'} = $in{'perm'};
$lv->{'alloc'} = $in{'alloc'};
$lv->{'readahead'} = $in{'readahead'};
- $err = &change_logical_volume($lv);
+ $err = &change_logical_volume($lv, $oldlv);
&error("<pre>$err</pre>") if ($err);
}
if ($lv->{'name'} ne $in{'name'}) {
&ReadParse();
($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
-($pv) = grep { $_->{'name'} eq $in{'pv'} } &list_physical_volumes($in{'vg'})
- if ($in{'pv'});
+$vg || &error($text{'vg_egone'});
+if ($in{'pv'}) {
+ ($pv) = grep { $_->{'name'} eq $in{'pv'} }
+ &list_physical_volumes($in{'vg'});
+ $pv || &error($text{'pv_egone'});
+ }
if ($in{'confirm'}) {
# Delete the physical volume
require './lvm-lib.pl';
&ReadParse();
-($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups()
- if ($in{'vg'});
+if ($in{'vg'}) {
+ ($vg) = grep { $_->{'name'} eq $in{'vg'} } &list_volume_groups();
+ $vg || &error($text{'vg_egone'});
+ }
if ($in{'confirm'}) {
# Delete the volume group