summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-27 10:31:34 +0000
commit0306ad0100b9d40606d723706f909438a27dfac1 (patch)
tree232eab774506632a3796a5a36cf09771aa614e64 /perl-install/lvm.pm
parent54a662b712a584c66a9f5762d264cce50acbb6ab (diff)
downloaddrakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.gz
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.bz2
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.tar.xz
drakx-backup-do-not-use-0306ad0100b9d40606d723706f909438a27dfac1.zip
- add field {fs_type} partially replacing {pt_type}
{pt_type} is always a number, {fs_type} is always a string - introduce set_isFormatted() (to ensure {notFormatted} but also {fs_type_from_magic} and {bad_fs_type_magic} are updated) - don't use 0x483 for ext3 anymore (same for reiserfs...), the type_name gives both a pt_type and a fs_type - many accessors from partition_table removed (type2fs(), fs2pt_type()) - remove isThisFs() (not useful anymore since we can use directly {fs_type}) - remove isFat() (inline the function) - other isXXX() from partition_table are moved to fs::type - part2name() is now fs::type::part2type_name - name2pt_type() is now fs::type::type_name2subpart() - partition_table::important_types() is now fs::type::type_names() - fsedit::typeOfPart() is now fs::type::fs_type_from_magic() - no need to truncate type_name since they are shorter
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 2d2a6d0e7..e63daa1ff 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -10,6 +10,7 @@ use common;
use modules;
use fsedit;
use devices;
+use fs::type;
use run_program;
#- for partition_table_xxx emulation
@@ -92,10 +93,10 @@ sub get_lvs {
[
map {
my $device = "$lvm->{VG_name}/$_";
- my $pt_type = -e "/dev/$device" && fsedit::typeOfPart($device);
+ my $fs_type = -e "/dev/$device" && fs::type::fs_type_from_magic({ device => $device });
{ device => $device,
- pt_type => $pt_type || 0x83,
+ fs_type => $fs_type || 'ext2',
size => get_lv_size($device) }
} @l
];
@@ -117,8 +118,7 @@ sub vg_destroy {
lvm_cmd_or_die('vgremove', $lvm->{VG_name});
foreach (@{$lvm->{disks}}) {
delete $_->{lvm};
- $_->{isFormatted} = 0;
- $_->{notFormatted} = 1;
+ set_isFormatted($_, 0);
}
}
@@ -138,8 +138,7 @@ sub lv_create {
$lv->{device} = "$lvm->{VG_name}/$lv->{lv_name}";
lvm_cmd_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $lv->{lv_name}, $lvm->{VG_name});
$lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size
- $lv->{notFormatted} = 1;
- $lv->{isFormatted} = 0;
+ set_isFormatted($lv, 0);
push @$list, $lv;
}