2013-07-04 08:05:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2013 Frank Liepold / 1&1 Internet AG
|
|
|
|
#
|
|
|
|
# Copying and distribution of this file, with or without modification,
|
|
|
|
# are permitted in any medium without royalty provided the copyright
|
|
|
|
# notice and this notice are preserved. This file is offered as-is,
|
|
|
|
# without any warranty.
|
|
|
|
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
## defaults for module lv_config
|
|
|
|
##
|
2013-12-10 11:03:46 +00:00
|
|
|
## the existence of one volume group (see lv_config_lvg_name) with size >
|
|
|
|
## lv_config_min_lvg_size is assumed.
|
2013-11-07 09:33:43 +00:00
|
|
|
|
|
|
|
## the name of the logical volume group which contains all logical volumes
|
|
|
|
## needed for the tests
|
|
|
|
lv_config_lvg_name="vg-mars"
|
|
|
|
|
|
|
|
## prefix for the logical volume names used. The full name is formed by
|
2013-12-10 11:03:46 +00:00
|
|
|
## appending the volumes size in G.
|
2013-11-07 09:33:43 +00:00
|
|
|
lv_config_lv_name_prefix="lv-"
|
|
|
|
|
|
|
|
## per host flag to indicate, whether the volume group may be recreated
|
|
|
|
declare -g -A lv_config_vg_recreatable_list
|
|
|
|
lv_config_vg_recreatable_list=(\
|
|
|
|
[istore-test-bs7]=1 \
|
|
|
|
[istore-test-bap7]=1 \
|
|
|
|
[istore-test-bs4]=1 \
|
|
|
|
[istore-test-bap4]=1 \
|
|
|
|
[istore-test-bs2]=1 \
|
|
|
|
[ovzd-test-bs1]=0 \
|
|
|
|
[ovzd-test-bap1]=0 \
|
|
|
|
)
|
|
|
|
|
2013-12-10 11:03:46 +00:00
|
|
|
##
|
2013-08-06 12:29:21 +00:00
|
|
|
## The names and sizes of the logical volumes to be created within the volume
|
2013-11-07 09:33:43 +00:00
|
|
|
## group are derived from the array lv_config_lv_name_list
|
2013-07-04 08:05:39 +00:00
|
|
|
## Only logical volumes which do not exist or which have a wrong size will
|
|
|
|
## be recreated.
|
|
|
|
|
2013-09-17 10:41:17 +00:00
|
|
|
## the names are built due to the pattern lv-<i>-<size>
|
2013-11-07 09:33:43 +00:00
|
|
|
lv_config_lv_name_list=(lv-1-2 lv-2-2 lv-3-2 lv-4-2 lv-5-10 lv-6-100)
|
2013-08-06 12:29:21 +00:00
|
|
|
|
2013-12-10 11:03:46 +00:00
|
|
|
lv_config_min_lvg_size=100 # GB
|
|
|
|
|
|
|
|
declare -g -A lv_config_partition_count_list
|
|
|
|
lv_config_partition_count_list=(\
|
|
|
|
[istore-test-bs7]=3 \
|
|
|
|
[istore-test-bap7]=3 \
|
|
|
|
[istore-test-bs4]=1 \
|
|
|
|
[istore-test-bap4]=1 \
|
|
|
|
[istore-test-bs2]=1 \
|
|
|
|
[ovzd-test-bs1]=1 \
|
|
|
|
[ovzd-test-bap1]=1 \
|
|
|
|
)
|
2013-09-17 10:41:17 +00:00
|
|
|
declare -g -A lv_config_partition_list
|
|
|
|
lv_config_partition_list=(\
|
2013-12-10 11:03:46 +00:00
|
|
|
[istore-test-bs7]="$(eval echo /dev/cciss/c1d{0..${lv_config_partition_count_list["istore-test-bs7"]}})" \
|
|
|
|
[istore-test-bap7]="$(eval echo /dev/cciss/c1d{0..${lv_config_partition_count_list["istore-test-bap7"]}})" \
|
2013-11-07 09:33:43 +00:00
|
|
|
[istore-test-bs4]="/dev/sdb" \
|
|
|
|
[istore-test-bap4]="/dev/sdb" \
|
|
|
|
[istore-test-bs2]="/dev/sdb" \
|
|
|
|
[ovzd-test-bs1]="/dev/sda2" \
|
|
|
|
[ovzd-test-bap1]="/dev/sda2" \
|
2013-09-17 10:41:17 +00:00
|
|
|
)
|
|
|
|
lv_config_stripesize=64K
|
2013-08-06 12:29:21 +00:00
|
|
|
|
2013-12-10 11:03:46 +00:00
|
|
|
## option for mkfs.<fs_type> call
|
2013-08-06 12:29:21 +00:00
|
|
|
declare -g -A lv_config_mkfs_option_list
|
|
|
|
lv_config_mkfs_option_list=([xfs]="-f" [ext3]="" [ext4]="")
|
|
|
|
|
2013-12-10 11:03:46 +00:00
|
|
|
## filesystem specific tune commands
|
|
|
|
## the string <dev> will be replaced by the actual device name
|
2013-08-06 12:29:21 +00:00
|
|
|
declare -g -A lv_config_fs_type_tune_cmd_list
|
2013-09-17 10:41:17 +00:00
|
|
|
lv_config_fs_type_tune_cmd_list=([xfs]="" [ext3]="tune2fs -c 0 <dev>" [ext4]="tune2fs -c 0 <dev>")
|
2013-08-06 12:29:21 +00:00
|
|
|
|
2013-12-10 11:03:46 +00:00
|
|
|
## filesystem specific extension commmands
|
|
|
|
declare -g -A lv_config_fs_type_extension_cmd_list
|
|
|
|
lv_config_fs_type_extension_cmd_list=([xfs]="xfs_growfs" [ext3]="resize2fs" [ext4]="resize2fs")
|