summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* lvchange: do not start dmevent for resynZdenek Kabelac2012-10-091-2/+4
| | | | | If monitoring is disabled in lvm.conf, avoid its starting and preserve DMEVENTD_MONITOR_IGNORE settings internally.
* lvconvert: disable convertion of thin to mirrorsZdenek Kabelac2012-10-081-0/+7
| | | | | | For now this convertions is not supported, thus disabled. The only supported conversion for now is to create mirrored thin pools from mirrored devices.
* thin: lvconvertZdenek Kabelac2012-10-033-69/+115
| | | | | | | | | | | Update code for lvconvert. Change the lvconvert user interface a bit - now we require 2 specifiers --thinpool takes LV name for data device (and makes the name) --poolmetadata takes LV name for metadata device. Fix type in thin help text -z -> -Z. Supported is also new flag --discards for thinpools.
* thin: lvchange allows to change perms of thin snapZdenek Kabelac2012-10-031-1/+1
| | | | | Thin snapshots are individual thin volumes so they can have its own control for rw permissions.
* cleanup: add proper cast for force_tZdenek Kabelac2012-10-031-1/+1
|
* liblvm2cmd: ensure standard descriptors are readyZdenek Kabelac2012-10-031-1/+38
| | | | | Check if FDs 0,1,2 are available, and in case they are missing, use /dev/null for them.
* liblvm2cmd: add return code for _close_stray_fdsZdenek Kabelac2012-10-031-11/+36
| | | | | | Close fds via /proc/self/fd parsing Return error code if _close_stray_fds fails and quit application if system is in some nonstandard state.
* lvremove: Revert to allowing removal of partial LVs.Petr Rockai2012-09-261-6/+0
|
* lvmetad: Make vgscan --cache an alias to pvscan --cache.Petr Rockai2012-09-261-12/+4
|
* lib/cache/lvmetad: s/pvscan_lvmetad/lvmetad_pvscan/ in the APIPetr Rockai2012-09-261-3/+3
|
* Implement devices/global_filter.Petr Rockai2012-09-263-30/+7
| | | | | The global filter is applied first, and is also applied in pvscan --cache (which is called from udev rules to keep lvmetad updated). Cf. example.conf.
* cleanup: remove unused variableMarian Csontos2012-09-201-1/+0
|
* mirror: 'lvconvert --resync' should reset LV_NOTSYNCED on corelog mirrorJonathan Brassow2012-09-191-1/+1
| | | | | | | | | | | | | | | When reformatting the 'lvchange_resync' code in commit 05131f5853e86419d9c726faa961b8d012298d9c, a '!' should have been removed from the condition that checks for the LV_NOTSYNCED flag on a corelog mirror LV. The presence of this '!' caused the LV_NOTSYNCED flag to be cleared when it wasn't present and left when it was present. It is not allowed to add images to a 'mirror' or 'raid1' LV if the LV_NOTSYNCED flag is set. We add some up-convert tests to ensure this behavior is being enforced and that the LV_NOTSYNCED flag is being properly cleared by 'lvchange --resync'. (Not updating WHATS_NEW because this is intrarelease.)
* discards: skip when removing LVs on missing PVsAlasdair G Kergon2012-09-191-0/+6
| | | | | | | Don't try to issue discards to a missing PV to avoid segfault. Prevent lvremove from removing LVs that have any part missing. https://bugzilla.redhat.com/857554
* vgchange: fix -aay to activate proper volumesPeter Rajnoha2012-09-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | Using 'activation/auto_activation_volume_list = [ "vg/lvol1" ]'. Before this patch: 3 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi-a--- 4.00m lvol3 vg -wi-a--- 4.00m (vg/lvol1 activated as it passes the list and all subsequent volumes too - wrong!) With this patch: 1 logical volume(s) in volume group "vg" now active LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvol0 vg -wi----- 4.00m lvol1 vg -wi-a--- 4.00m lvol2 vg -wi----- 4.00m lvol3 vg -wi----- 4.00m (only vg/lvol1 activated as it passes the list and no other - correct!)
* RAID: Properly handle resync of RAID LVsJonathan Brassow2012-09-111-14/+37
| | | | | | | Issuing a 'lvchange --resync <VG>/<RAID_LV>' had no effect. This is because the code to handle RAID LVs was not present. This patch adds the code that will clear the metadata areas of RAID LVs - causing them to resync upon activation.
* cleanup: Restructure code that handles mirror resyncingJonathan Brassow2012-09-111-29/+86
| | | | | | | | | | | | | | | | | When an LV is to be resynced, the metadata areas are cleared and the LV is reactivated. This is true for mirroring and will also be true for RAID LVs. We restructure the code in lvchange_resync() so that we keep all the common steps necessary (validation of ability to resync, deactivation, activation of meta/log devices, clearing of those devices, etc) and place the code that will be divergent in separate functions: detach_metadata_devices() attach_metadata_devices() The common steps will be processed on lists of metadata devices. Before RAID capability is added, this will simply be the mirror log device (if found). This patch lays the ground-work for adding resync of RAID LVs.
* cleanup: Reduce indentation by short-circuiting functionJonathan Brassow2012-09-111-43/+55
| | | | | | | | | By changing the conditional for resyncing mirrors with core-logs a bit, we can short-circuit the rest of the function for that case and reduce the amount of indenting in the rest of the function. This cleanup will simplify future patches aimed at properly handling the resync of RAID LVs.
* cleanup: Use segtype->ops->name() instead of segtype->name where applicableJonathan Brassow2012-09-052-3/+3
| | | | | | | | When printing a message for the user and the lv_segment pointer is available, use segtype->ops->name() instead of segtype->name. This gives a better user-readable name for the segment. This is especially true for the 'striped' segment type, which prints "linear" if there is an area_count of one.
* setvbuf: reopen only valid fdPeter Rajnoha2012-08-271-1/+1
| | | | | | We should check whether the fd is opened before trying to reopen it. For example, the stdin is closed in test/lib/harness.c causing the test suite to fail.
* config: add silent modeAlasdair G Kergon2012-08-2529-134/+133
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* RAID: Add support for RAID10Jonathan Brassow2012-08-242-3/+38
| | | | | | This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe.
* thin: discardZdenek Kabelac2012-08-232-3/+3
|
* lvconvert: use _reload_lv on more placesZdenek Kabelac2012-08-231-60/+30
| | | | Use common subroutine.
* lvconvert: move _reload_lv()Zdenek Kabelac2012-08-231-27/+28
| | | | Just move in front
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-232-0/+10
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* cleanup: use proper activation_change_tZdenek Kabelac2012-08-232-2/+4
|
* cleanup: cast to matching typeZdenek Kabelac2012-08-231-2/+2
|
* cleanup: uint64_t castsZdenek Kabelac2012-08-231-1/+1
|
* cleanup: keep MKNOD type cast cleanZdenek Kabelac2012-08-231-1/+1
| | | | Setup major already a dev_t type before it gets shifted.
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-236-13/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* dmsetup: check if new_name is non NULLZdenek Kabelac2012-08-231-1/+1
|
* dmsetup: fix udev warning messageZdenek Kabelac2012-08-231-1/+1
| | | | Configure option is --enable-udev_sync.
* dmsetup: fix memleak in _get_split_nameZdenek Kabelac2012-08-231-1/+3
| | | | Free allocated buffer in _get_split_name error path.
* thin: lvcreate --discardsZdenek Kabelac2012-08-092-1/+12
|
* RAID: Improve RAID argument handling.Jonathan Brassow2012-08-081-0/+21
| | | | | Disallow '-m' for RAID types that have no mirror component and disallow '-i' argument for RAID types that have no stripe component.
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-075-25/+25
| | | | Global change from --discard to --discards, as that feels more natural.
* thin: tidy commands.h arg listsAlasdair G Kergon2012-08-071-11/+8
| | | | | | args are listed alphabetically. lvconvert -T is covered in the second section not the first. It could be tidied further or split out.
* thin: mention discard/zero in lvchange errmsgAlasdair G Kergon2012-08-071-5/+4
|
* args: increase major:minor limit to 4095:1048575Peter Rajnoha2012-08-065-38/+47
| | | | | | | | | 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).
* dmsetup: allow --noflush with status/wait for thinAlasdair G Kergon2012-07-271-2/+5
| | | | | Allow --noflush with dmsetup status and wait (for thin target 1.3.0 / ioctl 4.23.0).
* vgextend: Allow PVs to be added to VGs that have PVs missingJonathan Brassow2012-07-261-2/+7
| | | | | | | | | | | | | | | | | Allowing people to add devices to a VG that has PVs missing helps people avoid the inability to repair RAID LVs in certain cases. For example, if a user creates a RAID 4/5/6 LV using all of the available devices in a VG, there will be no spare devices to repair the LV with if a device should fail. Further, because the VG is missing a device, new devices cannot be added to allow the repair. If 'vgreduce --removemissing' were attempted, the "MISSING" PV could not be removed without also destroying the RAID LV. Allowing vgextend to operate solves the circular dependency. When the PV is added by a vgextend operation, the sequence number is incremented and the 'MISSING' flag is put on the PVs which are missing.
* thin: add lvchange for discard and zero changeZdenek Kabelac2012-07-182-3/+92
| | | | | | | 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.
* thin: add discard support for thin poolZdenek Kabelac2012-07-184-1/+20
| | | | | | | | Add arg support for discard. Add discard ignore, nopassdown, passdown (=default) support. Flags could be set per pool. lvcreate [--discard {ignore|no_passdown|passdown}] vg/thinlv
* lvconvert: count % upwards when merging a snapshotPeter Rajnoha2012-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | Before: # lvconvert --merge -i 1 vg/lvol1 Merging of volume lvol1 started. lvol0: Merged: 36.7% lvol0: Merged: 21.3% lvol0: Merged: 5.8% lvol0: Merged: 0.0% Merge of snapshot into logical volume lvol0 has finished. Logical volume "lvol1" successfully removed After: # lvconvert --merge -i 1 vg/lvol1 Merging of volume lvol1 started. lvol0: Merged: 61.4% lvol0: Merged: 73.0% lvol0: Merged: 88.4% lvol0: Merged: 100.0% Merge of snapshot into logical volume lvol0 has finished. Logical volume "lvol1" successfully removed
* activate: skip manual activation for --sysinit -aayPeter Rajnoha2012-07-102-0/+14
| | | | | | | | | | | | | 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.
* RAID: Fix extending size of RAID 4/5/6 logical volumes.Jonathan Brassow2012-06-261-2/+8
| | | | | | Reducing a RAID 4/5/6 LV or extending it with a different number of stripes is still not implemented. This patch covers the "simple" case where the LV is extended with the same number of stripes as the orginal.
* toollib: fix ignored_mdas process_each_pv rescanAlasdair G Kergon2012-06-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In process_each_pv() if we haven't yet scanned and the PV appears to be an orphan, we must scan the other PVs looking for mdas that reference it to find out what VG it is in. 1. If the PV has no mdas, we must scan. 2. If the PV has an mda that is not ignored we do not need to scan. 3. If the PV has an mda that is ignored, we do need to scan. This patch fixes case 3. > pvs -o +mda_count,vg_mda_count /dev/loop[0123] PV VG Fmt Attr PSize PFree #PMda #VMda /dev/loop0 vg3 lvm2 a- 96.00m 96.00m 0 1 /dev/loop1 vg3 lvm2 a- 96.00m 96.00m 1 1 /dev/loop2 vg2 lvm2 a- 96.00m 96.00m 1 2 /dev/loop3 vg2 lvm2 a- 28.00m 28.00m 1 2 Before: > pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered PV VG Fmt Attr PSize PFree /dev/loop2 lvm2 a-- 100.00m 100.00m /dev/loop3 vg2 lvm2 a-- 28.00m 28.00m /dev/loop0 lvm2 a-- 100.00m 100.00m /dev/loop1 vg3 lvm2 a-- 96.00m 96.00m After: > pvs /dev/loop2 /dev/loop3 /dev/loop0 /dev/loop1 --unbuffered PV VG Fmt Attr PSize PFree /dev/loop2 vg2 lvm2 a-- 96.00m 96.00m /dev/loop3 vg2 lvm2 a-- 28.00m 28.00m /dev/loop0 vg3 lvm2 a-- 96.00m 96.00m /dev/loop1 vg3 lvm2 a-- 96.00m 96.00m
* lvcreate: add --activate ay (autoactivate)Peter Rajnoha2012-06-282-1/+7
| | | | | | | | | | One can use "lvcreate --aay" to have the newly created volume activated or not activated based on the activation/auto_activation_volume_list this way. Note: -Z/--zero is not compatible with -aay, zeroing is not used in this case! When using lvcreate -aay, a default warning message is also issued that zeroing is not done.
* lvchange: add --activate ay (autoactivate)Peter Rajnoha2012-06-282-1/+7
| | | | The same as for vgchange...