summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2013-04-15 13:59:46 -0500
committerJonathan Brassow <jbrassow@redhat.com>2013-04-15 13:59:46 -0500
commit2e0740f7ef420c7b981bc67cb606d180701b8c1d (patch)
tree830d8fef50a2b9fc45b5ffb9b8d844d1750ec96c /scripts
parentdce8d06af7e5a14a1507bea0e64e6cc27556cbc7 (diff)
downloadlvm2-2e0740f7ef420c7b981bc67cb606d180701b8c1d.tar.gz
RAID: Add writemostly/writebehind support for RAID1
'lvchange' is used to alter a RAID 1 logical volume's write-mostly and write-behind characteristics. The '--writemostly' parameter takes a PV as an argument with an optional trailing character to specify whether to set ('y'), unset ('n'), or toggle ('t') the value. If no trailing character is given, it will set the flag. Synopsis: lvchange [--writemostly <PV>:{t|y|n}] [--writebehind <count>] vg/lv Example: lvchange --writemostly /dev/sdb1:y --writebehind 512 vg/raid1_lv The last character in the 'lv_attr' field is used to show whether a device has the WriteMostly flag set. It is signified with a 'w'. If the device has failed, the 'p'artial flag has priority. Example ("nosync" raid1 with mismatch_cnt and writemostly): [~]# lvs -a --segment vg LV VG Attr #Str Type SSize raid1 vg Rwi---r-m 2 raid1 500.00m [raid1_rimage_0] vg Iwi---r-- 1 linear 500.00m [raid1_rimage_1] vg Iwi---r-w 1 linear 500.00m [raid1_rmeta_0] vg ewi---r-- 1 linear 4.00m [raid1_rmeta_1] vg ewi---r-- 1 linear 4.00m Example (raid1 with mismatch_cnt, writemostly - but failed drive): [~]# lvs -a --segment vg LV VG Attr #Str Type SSize raid1 vg rwi---r-p 2 raid1 500.00m [raid1_rimage_0] vg Iwi---r-- 1 linear 500.00m [raid1_rimage_1] vg Iwi---r-p 1 linear 500.00m [raid1_rmeta_0] vg ewi---r-- 1 linear 4.00m [raid1_rmeta_1] vg ewi---r-p 1 linear 4.00m A new reportable field has been added for writebehind as well. If write-behind has not been set or the LV is not RAID1, the field will be blank. Example (writebehind is set): [~]# lvs -a -o name,attr,writebehind vg LV Attr WBehind lv rwi-a-r-- 512 [lv_rimage_0] iwi-aor-w [lv_rimage_1] iwi-aor-- [lv_rmeta_0] ewi-aor-- [lv_rmeta_1] ewi-aor-- Example (writebehind is not set): [~]# lvs -a -o name,attr,writebehind vg LV Attr WBehind lv rwi-a-r-- [lv_rimage_0] iwi-aor-w [lv_rimage_1] iwi-aor-- [lv_rmeta_0] ewi-aor-- [lv_rmeta_1] ewi-aor--
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gdbinit5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/gdbinit b/scripts/gdbinit
index fa5894894..83d1c8eea 100644
--- a/scripts/gdbinit
+++ b/scripts/gdbinit
@@ -324,6 +324,11 @@ define __status
set $_s_status = $_s_status & ~0x10000000U
printf " MERGING"
end
+# if ($_s_status & LV_WRITEMOSTLY)
+ if ($_s_status & 0x10000000000U)
+ set $_s_status = $_s_status & ~0x10000000000U
+ printf " LV_WRITEMOSTLY"
+ end
if ($_s_status)
printf " 0x%x", $_s_status