summaryrefslogtreecommitdiffstats
path: root/tools/lvchange.c
Commit message (Collapse)AuthorAgeFilesLines
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-071-14/+14
| | | | Global change from --discard to --discards, as that feels more natural.
* thin: mention discard/zero in lvchange errmsgAlasdair G Kergon2012-08-071-5/+4
|
* args: increase major:minor limit to 4095:1048575Peter Rajnoha2012-08-061-2/+9
| | | | | | | | | Remove the limit for major and minor number arguments used while specifying persistent numbers via -My --major <major> --minor <minor> option which was set to 255 before. Follow the kernel limit instead which is 12 bits for major and 20 bits for minor number (kernel >= 2.6 and LVM formats that does not have FMT_RESTRICTED_LVIDS - so still keep the old limit of 255 for lvm1 format).
* thin: add lvchange for discard and zero changeZdenek Kabelac2012-07-181-1/+87
| | | | | | | Update lvchange to allow change of 'zero' flag for thinpool. Add support for changing discard handling. N.B. from/to ignore could be only changed for inactive pool.
* activate: skip manual activation for --sysinit -aayPeter Rajnoha2012-07-101-0/+7
| | | | | | | | | | | | | When --sysinit -a ay is used with vg/lvchange and lvmetad is up and running, we should skip manual activation as that would be a useless step - all volumes are autoactivated once all the PVs for a VG are present. If lvmetad is not active at the time of the vgchange --sysinit -a ay call, the activation proceeds in standard 'manual' way. This way, we can still have vg/lvchange --sysinit -a ay called unconditionally in system initialization scripts no matter if lvmetad is used or not.
* lvchange: add --activate ay (autoactivate)Peter Rajnoha2012-06-281-0/+6
| | | | The same as for vgchange...
* args: add --activate synonym for --available argPeter Rajnoha2012-06-281-13/+12
| | | | | | | | We're refererring to 'activation' all over the code and we're talking about 'LVs being activated' all the time so let's use 'activation/activate' everywhere for clarity and consistency (still providing the old 'available' keyword as a synonym for backward compatibility with existing environments).
* Update and fix monitoring of thin pool devicesZdenek Kabelac2012-03-231-1/+2
| | | | | | | | | | | | | Code adds better support for monitoring of thin pool devices. update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring. vgchange & lvchange are checking real thin pool device for existance as we are using _tpool real device and visible LV pool device might not be even active (_tpool is activated implicitely for any thin volume). monitor_dev_for_events is another _lv_postorder like code it might be worth to think about reusing it here - for now update the code to properly monitory thin volume deps. For unmonitoring add extra code to check the usage of thin pool - in case it's in use unmonitoring of thin volume is skipped.
* Switch pvscan --cache major:minor to --major --minor.Alasdair Kergon2012-03-061-0/+8
|
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Initialize dmeventd monitoring for every commandZdenek Kabelac2012-02-151-6/+1
| | | | | | | | | | Read lvm.conf setting for monitoring for each command. So we should not activate monitoring if the default compilation is set to monitor during lvconvert commnads. Patch also removes check for clustered VG and allows to disable monitoring for clustered VG with the assumption, the problem with monitoring and dmeventd flag passing for INGNORE is already fixed.
* Do not allow users to change permissions on RAID sub-LVs.Jonathan Earl Brassow2011-12-011-0/+8
|
* Allow to activate snapshotZdenek Kabelac2011-11-181-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add extra code to active and deactivate related snapshots and origin when user specifies snapshot logical volume as lvchange parameter. Before patch: $> lvs -a LV VG Attr LSize Pool Origin Snap% Move Log Copy% Convert lvol0 mvg owi-a-s- 1.00k lvol1 mvg swi-a-s- 16.00k lvol0 0.00 lvol2 mvg swi-a-s- 16.00k lvol0 0.00 $> lvchange -an mvg/lvol2; echo $? Can't change snapshot logical volume "lvol2". 5 After patch: $> lvchange -an mvg/lvol2 Change of snapshot lvol2 will also change its origin lvol0 and 1 other snapshot(s). Proceed? [y/n]: n Logical volume lvol2 not changed. $> lvchange -y -an mvg/lvol2; echo $? 0 $> lvs -a LV VG Attr LSize Pool Origin Snap% Move Log Copy% Convert lvol0 mvg owi---s- 1.00k lvol1 mvg swi---s- 16.00k lvol0 lvol2 mvg swi---s- 16.00k lvol0
* Thin removing limitation on activation of pool device.Zdenek Kabelac2011-11-031-6/+0
| | | | | | Since activation of pool is now independent on thin activation, user may do whatever he needs - thought preferable thin should stay alive, but it it will be found inactivate, update_pool will bring the pool up.
* Thin avoids need of having writable VG for activationZdenek Kabelac2011-11-031-4/+0
|
* Thin creation without activationZdenek Kabelac2011-10-301-0/+4
| | | | | | | | | All thins are created with the next activation and VG is updated without messages. Only some basic commands works. (i.e. lvcreate -an -V10 -T mvg/pool) There can be some combination to confuse this system. This functionality for snapshots is going to be interesting.
* Thin works only with exclusive activationZdenek Kabelac2011-10-281-1/+3
| | | | Enforce exclusive activation with thin targets.
* Thin pool activation changeZdenek Kabelac2011-10-281-0/+6
| | | | | | | | | | | To ensure we properly handle LV cluster locking - explicitely do not allow to change the availability of the thin pool that is in use for some thin LV. As soon as the thin volume is created the only way to activate pool is via implicit dependency. Ignore thinpool open count for lv/vgchange operations.
* Remove incorrect requirement for -j or -m from lvchange error message.Alasdair Kergon2011-09-051-4/+2
|
* s/MIRROR_NOTSYNCED/LV_NOTSYNCED/ - Flag will may refer to more than just mirrorsJonathan Earl Brassow2011-03-291-2/+2
|
* Add change_tag to toollib.Alasdair Kergon2011-01-241-17/+3
| | | | Allow multiple pvchange command line options to be specified together.
* Support repetition of --addtag and --deltag arguments.Alasdair Kergon2010-11-111-6/+12
| | | | | Add infrastructure for specific cmdline arguments to be repeated in groups. Split the_args cmdline arguments and values into arg_props and arg_values.
* Fix vgchange to process -a, --refresh, --monitor and --poll like lvchange.Mike Snitzer2010-10-261-1/+5
| | | | | | | Simultaneous -a and --refresh is not valid. poll+monitor are valid together with or without -ay* (but not with -an*) No longer print polling results summary if no LVs in the VG were polled.
* Use 'SINGLENODE' instead of 'dead' in clvmd singlenode messages.Alasdair Kergon2010-08-171-0/+1
| | | | | | Ignore snapshots when performing mirror recovery beneath an origin. Pass LCK_ORIGIN_ONLY flag around cluster. Add suspend_lv_origin and resume_lv_origin using LCK_ORIGIN_ONLY.
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-6/+6
|
* Various small cleanups and fixes related to monitoring.Alasdair Kergon2010-08-161-1/+1
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Refactor the handles_missing_pv logic in lvchange.Petr Rockai2010-06-281-15/+14
|
* Add new --sysinit option for vgchange and lvchange.Peter Rajnoha2010-05-061-4/+13
| | | | | | A shortcut for --ignorelockingfailure, --ignoremonitoring, --poll n options and LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable used all at once in initialisation scripts (e.g. rc.sysinit or initrd).
* Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.Mike Snitzer2010-03-291-1/+1
| | | | | | | | | | | | clvmd does not propagate DMEVENTD_MONITOR_IGNORE. Update get_activation_monitoring_mode() to check if the VG that the LV is being activated in is clustered. If so, skip it. Any get_activation_monitoring_mode() error will cause the associated LV (or VG) to be skipped during activation. Both vgchange_single() and lvchange_single(), which call get_activation_monitoring_mode(), are called by their respective process_each_..() method.
* Improve activation monitoring option processingMike Snitzer2010-03-231-4/+5
| | | | | | | | | | | | | . Add "monitoring" option to "activation" section of lvm.conf . Have clvmd consult the lvm.conf "activation/monitoring" too. . Introduce toollib.c:get_activation_monitoring_mode(). . Error out when both --monitor and --ignoremonitoring are provided. . Add --monitor and --ignoremonitoring support to lvcreate. Update lvcreate man page accordingly. . Clarify that '--monitor' controls the start and stop of monitoring in the {vg,lv}change man pages. Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Refactor lvchange_tag() to call lv_change_tag() library function.Dave Wysochanski2010-02-241-19/+2
| | | | | | | Similar refactoring to vgchange - pull out common parts and put into library function for reuse. Should be no functional change. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* . update documentation for --poll in the vgchange and lvchange man pagesMike Snitzer2010-01-061-0/+7
| | | | . add high-level --poll FIXMEs to vgchange.c and lvchange.c
* Add missing 'stack;' for all suspend_lv and resume_lv callers.Mike Snitzer2010-01-051-2/+4
| | | | Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Add a [--poll {y|n}] flag to vgchange and lvchange to control whetherMike Snitzer2010-01-051-4/+33
| | | | | | | | | | | | | | | | | | | | | | the background polldaemon is allowed to start. It can be used standalone or in conjunction with --refresh or --available y. Control over when the background polldaemon starts will be particularly important for snapshot-merge of a root filesystem. Dracut will be updated to activate all LVs with: --poll n The lvm2-monitor initscript will start polling with: --poll y NOTE: Because we currently have no way of knowing if a background polldaemon is active for a given LV the following limitations exist and have been deemed acceptable: 1) it is not possible to stop an active polldaemon; so the lvm2-monitor initscript doesn't stop running polldaemon(s) 2) redundant polldaemon instances will be started for all specified LVs if vgchange or lvchange are repeatedly used with '--poll y' Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Fix tools to report error when stopped by user.Milan Broz2009-12-031-2/+2
| | | | (And do not produce internal error message.)
* minor code comment updateZdenek Kabelac2009-11-041-1/+1
|
* Don't attempt to restart pvmoves when deactivating LVs in vgchange.Alasdair Kergon2009-09-291-13/+1
| | | | Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
* Add lots of missing stack debug messages to tools.Alasdair Kergon2009-09-141-12/+36
| | | | | Make readonly locking available as locking type 4. Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
* Make lvchange --refresh only take a read lock on volume group.Petr Rockai2009-08-131-3/+2
|
* Remove lockingfailed().Petr Rockai2009-07-151-6/+0
| | | | | | | | | We provide a lock type that behaves like no_locking, but is not clustered. Moreover, it also forbids any write locks. This magically (and consistently) prevents use of clustered VGs, or changing local VGs with --ignorelockingfailure. As a bonus, we can remove the special hacks in a few places. Of course, people looking for trouble can always set their locking_type to 0 to override.
* Take just a read lock when activating in lvchange.Petr Rockai2009-07-151-1/+2
|
* Refuse to open VG with MISSING_PVs for update unless handles_missing_pvs is set.Petr Rockai2009-07-151-3/+9
|
* Rework the toollib interface (process_each_*) on top of new vg_read.Dave Wysochanski2009-07-011-1/+1
| | | | | | | | | Sun May 3 12:32:30 CEST 2009 Petr Rockai <me@mornfall.net> * Rework the toollib interface (process_each_*) on top of new vg_read. Rebased 6/26/09 by Dave W. - Add skipping message to process_each_lv - Remove inconsistent_t.
* Round readahead more inteligently and print warning.Milan Broz2009-06-061-3/+6
| | | | | Round readahead at least to one page up. Print warning instead of verbose message.
* Fix convert polling to ignore LV with different UUID.Milan Broz2009-06-011-9/+1
| | | | | | | | | | | | | | | | | | | When mirror convert polling is started (mainly as backgound process, in lvchange -a y or in lvconvert itself) it tries to read VG and LV identified by its name. Unfortunatelly, the VG can have already different LV under the same name, and various more or less funny things can happen (note that _finish_lvconvert_mirror suspends the volume for example). (the typical example is our testing script which continuously recreates LVs under the same name in the same VG.) This patch adds optional uuid parameter which helps to properly select the monitoring object. For lvconvert polling it is set to LV UUID and both _get_lvconvert_vg and _get_lvconvert_lv uses it to read proper VG/LV. (In the pvmove case it is NULL, here we poll for physical volume name).
* Suppress 'removed' messages displayed when internal LVs are removed.Alasdair Kergon2009-05-271-1/+7
| | | | | Fix lvchange -a and -p for sparse LVs. Fix lvcreate --virtualsize to activate the new device immediately.
* Use lock query instead of activate_lv_exclMilan Broz2009-05-201-9/+9
| | | | | | | - switch lvremove to not force activate volume when removing - ditto for force resync - fix some wrong return codes in lvchange_resync()
* Merge lv_is_displayable and lv_is_visible.Milan Broz2009-05-131-1/+1
| | | | | | | Displayable and visible is the same thing. volumes_count(vg) is now vg_visible_lvs() and always returns number of LVs from user perspective.
* Add sparse devices: lvcreate -s --virtualoriginsize (hidden zero origin).Alasdair Kergon2009-04-251-1/+2
| | | | | | | | Add lvs origin_size field. Fix linux configure --enable-debug to exclude -O2. Still a few rough edges, but hopefully usable now: lvcreate -s vg1 -L 100M --virtualoriginsize 1T