File: lvconvert-vdo-raid.sh

package info (click to toggle)
lvm2 2.03.31-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,920 kB
  • sloc: ansic: 180,675; sh: 42,231; python: 6,554; makefile: 2,079; cpp: 1,258; ruby: 66; awk: 20
file content (70 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash

# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

# Exercise vdo-pool's on raidLV


SKIP_WITH_LVMPOLLD=1

. lib/inittest

#
# Main
#

#
aux have_vdo 6 2 1 || skip
aux have_raid 1 3 0 || skip


aux prepare_vg 2 9000

lvcreate --yes --vdo -L4G $vg/vpool

aux zero_dev "$dev1" "$(( $(get first_extent_sector "$dev1") + 8192 )):"
aux zero_dev "$dev2" "$(( $(get first_extent_sector "$dev2") + 8192 )):"

# convert _vdata to raid
lvconvert --yes --type raid1 $vg/vpool_vdata
check lv_field $vg/vpool_vdata segtype raid1 -a

lvconvert --yes -m 0  $vg/vpool_vdata "$dev2"
check lv_field $vg/vpool_vdata segtype linear -a

# vpool  should redirect to _vdata
lvconvert --yes --type raid1 $vg/vpool
check lv_field $vg/vpool_vdata segtype raid1 -a

lvremove -f $vg

aux enable_dev "$dev1" "$dev2"


lvcreate --type raid1 -L4G --nosync -n vpool1 $vg

lvconvert --yes --vdopool $vg/vpool1 -V2G -n $lv1

mkfs.ext4 -E nodiscard "$DM_DEV_DIR/$vg/$lv1"

not lvrename $vg/vpool1

lvchange -an $vg

lvrename $vg/vpool1 $vg/vpool

lvchange -ay $vg

fsck -n "$DM_DEV_DIR/$vg/$lv1"

lvs -a $vg

vgremove -ff $vg