=== modified file 'zsh-functions/confz_fs_init' --- zsh-functions/confz_fs_init 2017-11-21 16:21:15 +0000 +++ zsh-functions/confz_fs_init 2017-11-20 14:57:32 +0000 @@ -486,49 +486,6 @@ [[ -b ${vars[device]} ]] } -# configure LVM2 logical volume -confz_logical_volume_extents_check() { - [[ -n ${vars[vg_name]:=${DEFAULT_VG}} ]] || \ - die "$0: DEFAULT_VG is unset and no 'vg_name' was passed" - - checkvars lv_name pv_name extents - - local vg_name lv_name pv_name pvseg_start pvseg_size segtype - local -A found - pvs --segments --noheadings --separator $'\t' \ - -o vg_name,lv_name,pv_name,pvseg_start,pvseg_size,segtype \ - | while IFS=$'\t' \ - read vg_name lv_name pv_name pvseg_start pvseg_size segtype - do - vg_name=${vg_name/# #} # strip preceding space - (($#found)) && die "$0: more than one segment found" - if matchvars vg_name $vg_name lv_name $lv_name; then - if [[ $segtype != linear ]] || ! matchvars pv_name $pv_name offset $pvseg_start extents $pvseg_size; then - die "$0: non-matching physical layout of the volume" - fi - found[offset]=$pvseg_start - fi - done - unify "${(kv@)found}" \ - device /dev/mapper/$vars[vg_name]-$vars[lv_name] - - do_command=( - lvcreate - --name ${vars[lv_name]} - --extents ${vars[extents]} - ${vars[vg_name]} - $vars[pv_name]:$vars[offset]-$[ $vars[offset] + $vars[extents] ] - ) - - if ! (($#found)); then - fail_reason="not found in pvs output: ${vars[vg_name]}/${vars[lv_name]}" - return 1 - fi - - fail_reason="not a block device: ${vars[device]}" - [[ -b ${vars[device]} ]] -} - # create filesystem on block device confz_filesystem_check() {