lvm_set_filter


Description:

[ Version ( since = "1.5.1" ) ]
public bool lvm_set_filter (string[] devices) throws Error

set LVM device filter

This sets the LVM device filter so that LVM will only be able to "see" the block devices in the list devices, and will ignore all other attached block devices.

Where disk image(s) contain duplicate PVs or VGs, this command is useful to get LVM to ignore the duplicates, otherwise LVM can get confused. Note also there are two types of duplication possible: either cloned PVs/VGs which have identical UUIDs; or VGs that are not cloned but just happen to have the same name. In normal operation you cannot create this situation, but you can do it outside LVM, eg. by cloning disk images or by bit twiddling inside the LVM metadata.

This command also clears the LVM cache and performs a volume group scan.

You can filter whole block devices or individual partitions.

You cannot use this if any VG is currently in use (eg. contains a mounted filesystem), even if you are not filtering out that VG.

This function depends on the feature "lvm2". See also feature_available.

Parameters:

this

A GuestfsSession object

devices

an array of strings

Returns:

true on success, false on error