1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
lvm2/tools
Jonathan Brassow 2e0740f7ef 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--
2013-04-15 13:59:46 -05:00
..
.exported_symbols generate liblvm2cmd exported symbols too 2010-06-25 18:23:10 +00:00
.gitignore More .gitignore files for an in-source-tree build. 2012-06-08 16:34:43 +01:00
args.h RAID: Add writemostly/writebehind support for RAID1 2013-04-15 13:59:46 -05:00
cmdnames.h Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
commands.h RAID: Add writemostly/writebehind support for RAID1 2013-04-15 13:59:46 -05:00
dmsetup.c dmsetup: check for strncpy 2013-04-12 11:30:47 +02:00
dumpconfig.c cleanup: get rid of compiler's warning about possible unitialized variable 2013-03-06 12:53:27 +01:00
formats.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvchange.c RAID: Add writemostly/writebehind support for RAID1 2013-04-15 13:59:46 -05:00
lvconvert.c mirror: Fix overly-concerning warning on mirror up-convert failure. 2013-04-10 16:47:04 -05:00
lvcreate.c thin: lvcreate external origin snapshot support 2013-04-02 15:17:31 +02:00
lvdisplay.c Rework the toollib interface (process_each_*) on top of new vg_read. 2009-07-01 17:00:50 +00:00
lvextend.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvm2cmd-static.c Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
lvm2cmd.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm2cmd.h Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventd 2011-10-19 08:46:26 +00:00
lvm2cmdline.h Support repetition of --addtag and --deltag arguments. 2010-11-11 17:29:05 +00:00
lvm-static.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvm.c Revert "cleanup: simplify option matching function" 2013-04-13 02:26:37 +01:00
lvmchange.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
lvmcmdlib.c cleanup: drop unneeded included header files 2012-08-23 14:37:20 +02:00
lvmcmdline.c cmdline: add arg_long_option_name 2013-04-02 15:16:53 +02:00
lvmdiskscan.c Few more close and dev_close trace 2012-03-01 21:12:37 +00:00
lvreduce.c Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
lvremove.c cleanup: add proper cast for force_t 2012-10-03 15:06:17 +02:00
lvrename.c config: add silent mode 2012-08-25 20:35:48 +01:00
lvresize.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
lvscan.c config: add silent mode 2012-08-25 20:35:48 +01:00
Makefile.in lvmetad: lvm depends on libdaemonclient.a 2013-01-04 23:10:38 +00:00
polldaemon.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
polldaemon.h Start using 64-bit status flags - most of the code already handles them. 2011-09-06 18:49:31 +00:00
pvchange.c pv_write: clean up non-orphan format1 PV write 2013-03-25 15:08:26 +01:00
pvck.c Move the core of the lib/config/config.c functionality into libdevmapper, 2011-08-30 14:55:15 +00:00
pvcreate.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
pvdisplay.c cleanup: uint64_t casts 2012-08-23 14:37:21 +02:00
pvmove.c metadata: add 'allow_orphan' arg to find_pv_by_name fn 2013-03-19 14:57:31 +01:00
pvremove.c config: add silent mode 2012-08-25 20:35:48 +01:00
pvresize.c config: add silent mode 2012-08-25 20:35:48 +01:00
pvscan.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
reporter.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
segtypes.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
stub.h Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
toollib.c tools: add common lv_change_activate 2013-04-12 11:30:07 +02:00
toollib.h tools: add common lv_change_activate 2013-04-12 11:30:07 +02:00
tools.h cmdline: add arg_long_option_name 2013-04-02 15:16:53 +02:00
vgcfgbackup.c config: add silent mode 2012-08-25 20:35:48 +01:00
vgcfgrestore.c thin: allow restore with --force 2012-11-27 14:08:24 +01:00
vgchange.c tools: add common lv_change_activate 2013-04-12 11:30:07 +02:00
vgck.c Make vgck warn about missing PVs. 2010-07-27 20:05:29 +00:00
vgconvert.c config: refer to config nodes using assigned IDs 2013-03-06 10:14:33 +01:00
vgcreate.c cleanup: swap return values 2012-10-17 15:37:26 +02:00
vgdisplay.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgexport.c config: add silent mode 2012-08-25 20:35:48 +01:00
vgextend.c config: add silent mode 2012-08-25 20:35:48 +01:00
vgimport.c vgimport: Allow '--force' to import VGs with missing PVs. 2013-02-20 16:37:41 -06:00
vgmerge.c config: add silent mode 2012-08-25 20:35:48 +01:00
vgmknodes.c Use __attribute__ consistently throughout. 2010-07-09 15:34:40 +00:00
vgreduce.c RAID: Make 'vgreduce --removemissing' work with RAID LVs 2013-02-20 14:52:46 -06:00
vgremove.c Make force_t enum usage obvious 2012-02-27 10:06:58 +00:00
vgrename.c Implement devices/global_filter. 2012-09-26 14:49:15 +02:00
vgscan.c lvmetad: Make vgscan --cache an alias to pvscan --cache. 2012-09-26 17:26:23 +02:00
vgsplit.c cleanup: swap return values 2012-10-17 15:37:26 +02:00