diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-07-01 03:20:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-07-01 03:20:32 +0000 |
commit | be8556d50bea091b1205b525337d0f57dc8c67a6 (patch) | |
tree | 7928f25014939aaf082ce752dc1782cfc1396fea /perl-install/lvm.pm | |
parent | 677ff0ae23c66e8757b8670ba1f9c64f0c080a39 (diff) | |
download | drakx-backup-do-not-use-be8556d50bea091b1205b525337d0f57dc8c67a6.tar drakx-backup-do-not-use-be8556d50bea091b1205b525337d0f57dc8c67a6.tar.gz drakx-backup-do-not-use-be8556d50bea091b1205b525337d0f57dc8c67a6.tar.bz2 drakx-backup-do-not-use-be8556d50bea091b1205b525337d0f57dc8c67a6.tar.xz drakx-backup-do-not-use-be8556d50bea091b1205b525337d0f57dc8c67a6.zip |
lilo only accept /boot (or /) on a LV if it uses only one PV, so correctly warn/error this
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r-- | perl-install/lvm.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 6f9ac2a20..46201f4a1 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -80,6 +80,11 @@ 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 { + my ($lv) = @_; + to_int(run_program::get_stdout('lvm2', 'lvs', '--noheadings', '--nosuffix', '-o', 'seg_count', "/dev/$lv->{device}")); +} + sub get_lvs { my ($lvm) = @_; my @l = run_program::get_stdout('lvm2', 'lvs', '--noheadings', '--nosuffix', '--units', 's', '-o', 'lv_name', $lvm->{VG_name}) =~ /(\S+)/g; @@ -139,6 +144,12 @@ sub lv_create { suggest_lv_name($lvm, $lv); $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) { + lvm_cmd_or_die('lvremove', '-f', "/dev/$lv->{device}"); + die "/boot on multiple segments Logical Volume is useless\n"; + } + $lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size set_isFormatted($lv, 0); my $list = $lvm->{primary}{normal} ||= []; |