summaryrefslogtreecommitdiff
path: root/test/shell/lvcreate-large.sh
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-09-27 16:51:22 -0500
committerJonathan Brassow <jbrassow@redhat.com>2012-09-27 16:51:22 -0500
commit886656e4ac5e5c932d9fbe60d18c063136288a38 (patch)
tree7bd496bc66029364f2c11194e7557a80e5f826b5 /test/shell/lvcreate-large.sh
parent662a2122f6224b5404d9f1276868bc3069766c49 (diff)
downloadlvm2-886656e4ac5e5c932d9fbe60d18c063136288a38.tar.gz
RAID: Fix problems with creating, extending and converting large RAID LVs
MD's bitmaps can handle 2^21 regions at most. The RAID code has always used a region_size of 1024 sectors. That means the size of a RAID LV was limited to 1TiB. (The user can adjust the region_size when creating a RAID LV, which can affect the maximum size.) Thus, creating, extending or converting to a RAID LV greater than 1TiB would result in a failure to load the new device-mapper table. Again, the size of the RAID LV is not limited by how much space is allocated for the metadata area, but by the limitations of the MD bitmap. Therefore, we must adjust the 'region_size' to ensure that the number of regions does not exceed the limit. I've added code to do this when extending a RAID LV (which covers 'create' and 'extend' operations) and when up-converting - specifically from linear to RAID1.
Diffstat (limited to 'test/shell/lvcreate-large.sh')
-rw-r--r--test/shell/lvcreate-large.sh65
1 files changed, 56 insertions, 9 deletions
diff --git a/test/shell/lvcreate-large.sh b/test/shell/lvcreate-large.sh
index b61cccaeb..127b43454 100644
--- a/test/shell/lvcreate-large.sh
+++ b/test/shell/lvcreate-large.sh
@@ -13,28 +13,75 @@
. lib/test
-aux prepare_vg 4
+aux prepare_vg 5
-lvcreate -s -l 100%FREE -n $lv $vg --virtualsize 1024T
+lvcreate -s -l 20%FREE -n $lv1 $vg --virtualsize 256T
+lvcreate -s -l 20%FREE -n $lv2 $vg --virtualsize 256T
+lvcreate -s -l 20%FREE -n $lv3 $vg --virtualsize 256T
+lvcreate -s -l 20%FREE -n $lv4 $vg --virtualsize 256T
+lvcreate -s -l 20%FREE -n $lv5 $vg --virtualsize 256T
#FIXME this should be 1024T
#check lv_field $vg/$lv size "128.00m"
aux lvmconf 'devices/filter = [ "a/dev\/mapper\/.*$/", "a/dev\/LVMTEST/", "r/.*/" ]'
-pvcreate $DM_DEV_DIR/$vg/$lv
-vgcreate -c n $vg1 $DM_DEV_DIR/$vg/$lv
+pvcreate $DM_DEV_DIR/$vg/$lv[12345]
+vgcreate -c n $vg1 $DM_DEV_DIR/$vg/$lv[12345]
lvcreate -l 100%FREE -n $lv1 $vg1
-check lv_field $vg1/$lv1 size "1024.00t"
+check lv_field $vg1/$lv1 size "1.25p"
lvresize -f -l 72%VG $vg1/$lv1
-check lv_field $vg1/$lv1 size "737.28t"
+check lv_field $vg1/$lv1 size "921.60t"
lvremove -ff $vg1/$lv1
lvcreate -l 100%VG -n $lv1 $vg1
-check lv_field $vg1/$lv1 size "1024.00t"
+check lv_field $vg1/$lv1 size "1.25p"
lvresize -f -l 72%VG $vg1/$lv1
-check lv_field $vg1/$lv1 size "737.28t"
+check lv_field $vg1/$lv1 size "921.60t"
lvremove -ff $vg1/$lv1
-lvremove -ff $vg/$lv
+if aux target_at_least dm-raid 1 1 0; then
+ # bz837927 START
+
+ #
+ # Create large RAID LVs
+ #
+ # We need '--nosync' or our virtual devices won't work
+ lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
+ check lv_field $vg1/$lv1 size "200.00t"
+ lvremove -ff $vg1
+
+ lvcreate --type raid10 -m 1 -i 2 -L 200T -n $lv1 $vg1 --nosync
+ check lv_field $vg1/$lv1 size "200.00t"
+ lvremove -ff $vg1
+
+ for segtype in raid4 raid5 raid6; do
+ lvcreate --type $segtype -i 3 -L 750T -n $lv1 $vg1 --nosync
+ check lv_field $vg1/$lv1 size "750.00t"
+ lvremove -ff $vg1
+ done
+
+ #
+ # Convert large linear to RAID1 (belong in different test script?)
+ #
+ lvcreate -L 200T -n $lv1 $vg1
+ # Need to deactivate or the up-convert will start sync'ing
+ lvchange -an $vg1/$lv1
+ lvconvert --type raid1 -m 1 $vg1/$lv1
+ check lv_field $vg1/$lv1 size "200.00t"
+ lvremove -ff $vg1
+
+ #
+ # Extending large RAID LV (belong in different script?)
+ #
+ lvcreate --type raid1 -m 1 -L 200T -n $lv1 $vg1 --nosync
+ check lv_field $vg1/$lv1 size "200.00t"
+ lvextend -L +200T $vg1/$lv1
+ check lv_field $vg1/$lv1 size "400.00t"
+ lvremove -ff $vg1
+
+ # bz837927 END
+fi
+
+lvremove -ff $vg