mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
1e4e9548b1
Snapshots of RAID logical volumes are allowed (including "raid1"). However, snapshots of "mirror" logical volumes has been disallowed due to unsolvable issues inherent to the design. The fact that mirroring (dm-raid1.c) must stop all I/O as the result of a failure and wait for userspace intervention can lead to a circular dependency if userspace is simultaneously waiting for snapshots (on mirrors) to make an I/O update before proceeding. Various snapshot on mirror tests have been removed as a result.
52 lines
1.2 KiB
Bash
52 lines
1.2 KiB
Bash
#!/bin/sh
|
|
# Copyright (C) 2010 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
. lib/test
|
|
|
|
aux prepare_vg 4
|
|
|
|
# Attempt to create snapshot of a mirror origin - should fail
|
|
lvcreate -m 1 -L 10M -n lv $vg
|
|
not lvcreate -s $vg/lv -L 10M -n snap
|
|
|
|
exit 0
|
|
|
|
#
|
|
# Snapshots of mirrors are no longer allowed.
|
|
#
|
|
|
|
# Down-convert (mirror -> linear) under a snapshot
|
|
lvconvert -m0 $vg/lv
|
|
|
|
# Up-convert (linear -> mirror)
|
|
lvconvert -m2 $vg/lv
|
|
|
|
# Down-convert (mirror -> mirror)
|
|
lvconvert -m1 $vg/lv
|
|
|
|
# Up-convert (mirror -> mirror) -- Not supported!
|
|
not lvconvert -m2 $vg/lv
|
|
|
|
# Log conversion (disk -> core)
|
|
lvconvert --mirrorlog core $vg/lv
|
|
|
|
# Log conversion (core -> mirrored)
|
|
lvconvert --mirrorlog mirrored $vg/lv
|
|
|
|
# Log conversion (mirrored -> core)
|
|
lvconvert --mirrorlog core $vg/lv
|
|
|
|
# Log conversion (core -> disk)
|
|
lvconvert --mirrorlog disk $vg/lv
|
|
|
|
## Clean-up
|
|
vgremove -f $vg
|