diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-07-01 06:09:56 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-07-01 06:09:56 +0000 |
commit | 36ff13fecc898737614aafab4a2813a2f161f9fa (patch) | |
tree | c40799ede6817b8497effa8d36eb32cb0f778e0e /perl-install/lvm.pm | |
parent | f04cae4ca3dea07ce237410905c2b2f731686f5e (diff) | |
download | drakx-36ff13fecc898737614aafab4a2813a2f161f9fa.tar drakx-36ff13fecc898737614aafab4a2813a2f161f9fa.tar.gz drakx-36ff13fecc898737614aafab4a2813a2f161f9fa.tar.bz2 drakx-36ff13fecc898737614aafab4a2813a2f161f9fa.tar.xz drakx-36ff13fecc898737614aafab4a2813a2f161f9fa.zip |
replace lv_nb_segments() with lv_nb_pvs()
(which is really what lilo cares about. lilo error is "mapped boot device cannot be on multiple real devices")
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r-- | perl-install/lvm.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 5fb17e791..327fe8177 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -80,9 +80,13 @@ sub get_lv_size { to_int(run_program::get_stdout('lvm2', 'lvs', '--noheadings', '--nosuffix', '--units', 's', '-o', 'lv_size', "/dev/$lvm_device")); } -sub lv_nb_segments { +sub lv_to_pvs { my ($lv) = @_; - to_int(run_program::get_stdout('lvm2', 'lvs', '--noheadings', '--nosuffix', '-o', 'seg_count', "/dev/$lv->{device}")); + map { m!(\S+)\(! } run_program::get_stdout('lvm2', 'lvs', '--noheadings', '-o', 'devices', "/dev/$lv->{device}"); +} +sub lv_nb_pvs { + my ($lv) = @_; + listlength(lv_to_pvs($lv)); } sub get_lvs { @@ -155,7 +159,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}); - if ($lv->{mntpoint} eq '/boot' && lv_nb_segments($lv) > 1) { + if ($lv->{mntpoint} eq '/boot' && lv_nb_pvs($lv) > 1) { lvm_cmd_or_die('lvremove', '-f', "/dev/$lv->{device}"); die N("The bootloader can't handle /boot on multiple physicals volumes"); } |