1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

7133 Commits

Author SHA1 Message Date
Peter Rajnoha
4d7a4554f4 blkdeactivate: fix long form of options
Actually, long form for -d and -l option is --dmoption and --lvmoption respectively.
2012-10-12 15:42:24 +02:00
Peter Rajnoha
2679c68689 WHATS_NEW: update 2012-10-12 14:47:40 +02:00
Peter Rajnoha
a70d6b350f configure: autoreconf 2012-10-12 14:45:26 +02:00
Peter Rajnoha
c698ee14bb scripts: introduce blkdeactivate
blkdeactivate - utility to deactivate block devices

Traverses the tree of block devices and tries to deactivate them.
Currently, it supports device-mapper-based devices together with LVM.
See man/blkdeactivate.8 for more info.

It is targeted for use during shutdown to properly deactivate the
whole block device stack - systemd and init scripts are provided as
well. However, it might be used directly on command line too.

Please, see the commentary at the top of the blkdeactivate script
for dependencies and versions of other utilities required.
2012-10-12 14:44:24 +02:00
Peter Rajnoha
f8781ea6a0 systemd: add deps to order units more properly
lvm2-activation-early.service (generated by activation generator) should
be ordered before cryptsetup.target.

lvm2-monitor.service should be ordered after lvm2-activation.service,
if used. The lvm2-activation.service will replace fedora-storage-init.service
and fedora-storage-init-late.service in the end, but let's have it
prepared now.
2012-10-12 14:24:54 +02:00
Petr Rockai
141f26035d Update WHATS_NEW. 2012-10-12 13:24:06 +02:00
Zdenek Kabelac
3058f662cf thin: prohibit lvcreate --thinpool with mirrors
Disable --thinpool to be used with mirror on lvcreate.
2012-10-12 12:21:45 +02:00
Zdenek Kabelac
be291e1064 thin: lvm2api return origin property for thin LV 2012-10-12 12:20:55 +02:00
Peter Rajnoha
abb07a1b5e libdm: remove dm dev without error even with malformed UUID
On each ioctl return, the device UUID is decoded from \xNN format.
If the UUID of the device being *removed* is malformed (e.g. it
hasn't been corrected before), just remove it without any error
as the UUID is not needed anymore - the device is gone anyway.

Otherwise a misleading error message would be issued just after
the removal:
  # dmsetup remove test
  The UUID "a b" should be mangled but it contains blacklisted characters.
  Command failed
2012-10-12 11:53:04 +02:00
Zdenek Kabelac
5a958655dd lvmetad: fix test for dm_asprintf 2012-10-12 11:36:01 +02:00
Petr Rockai
d6d207006a lvmetad: Fix the fix for 813766 (lvmetad connection warning). 2012-10-12 11:22:47 +02:00
Zdenek Kabelac
f2a5d3ae3a lvmetad: validate dm_asprintf in buffer_append_vf
Check result of dm_asprintf
Check buffer_append result
Declare vars in front
2012-10-12 10:59:10 +02:00
Zdenek Kabelac
5c792f620b lvmetad: check result of buffer_realloc 2012-10-12 10:59:10 +02:00
Zdenek Kabelac
c4dcbf67a3 lvmetad: initialize cft value
the error should not test garbage value.
2012-10-12 10:59:10 +02:00
Petr Rockai
28776b9526 lvmetad: Make --sysinit suppress connection failure warnings. 2012-10-12 10:58:04 +02:00
Zdenek Kabelac
9ee071705b cleanup: fix compiler warnings
remove unused vars
move var declarations into the front of functions.
fix some sign warnings
2012-10-12 10:25:07 +02:00
Alasdair G Kergon
ee3cfa4184 python: Add bindings for liblvm2app.
Use configure --enable-python_bindings to generate them.

Note that the Makefiles do not yet control the owner or permissions of
the two new files on installation.
2012-10-12 02:08:47 +01:00
Petr Rockai
4022fd3e79 lvmdump: Add -l, to collect a state dump from lvmetad. 2012-10-11 22:42:20 +02:00
Petr Rockai
8557b412f6 lvmdump: Fix systems with tr on PATH outside of /usr/bin. 2012-10-11 22:40:58 +02:00
Petr Rockai
413d91dc29 test: Add lvmetad-dump.sh. 2012-10-11 20:32:25 +02:00
Petr Rockai
a63b46bf36 lvmetad: Implement a "dump" request to capture lvmetad state. 2012-10-11 20:31:29 +02:00
Petr Rockai
b165e9f3f8 test: Skip lvconvert-raid on kernels < 3.2 since they BUG out. 2012-10-11 18:13:37 +02:00
Petr Rockai
b07df8850a libdaemon: Make buffer handling asymptotically more efficient. 2012-10-11 18:09:41 +02:00
Zdenek Kabelac
0a46160d94 lvm2api: add defined lvm_percent_to_float
Implement function which was somehow missing from it's original
placement in the header file lvm2api.h.
2012-10-11 17:29:56 +02:00
Zdenek Kabelac
316ce655a3 thin: raise required version to 1.4
Stay safe and require 1.4 (kernel 3.6) for non-power-of-2
support for thin pool chunk_size.
2012-10-11 14:09:07 +02:00
Petr Rockai
57460fe5a8 test: Skip the topology test if setting up scsi_debug fails. 2012-10-11 11:51:04 +02:00
Petr Rockai
deea86c7f4 pvscan --cache: Also read metadata from LVM1 PVs (BZ 863401). 2012-10-10 21:55:24 +02:00
Petr Rockai
2ba9fb4019 lvmetad: Fix help output (flags and their meaning). 2012-10-10 21:55:24 +02:00
Zdenek Kabelac
14283662b9 test: use exclusive activation for created mirrors 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
9db5217a31 test: thin support for non power of 2 chunk size 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
876514eb34 test: drop clustered flag control from thin tests 2012-10-10 21:22:12 +02:00
Zdenek Kabelac
d4eded9fd6 test: move common code for thin init 2012-10-10 21:22:11 +02:00
Zdenek Kabelac
b6512b10ae cleanup: fix typos 2012-10-10 21:22:11 +02:00
Zdenek Kabelac
ca09c9ab4c thin: support non power of 2 chunk size
Support thin chunk size with multiple of 64KiB if user has
thin-pool target version at least 1.2.
2012-10-10 21:21:00 +02:00
Jonathan Brassow
b296e30f98 TEST: Add lvchange-partial.sh and vgchange-partial.sh to the test suite
Commit 3501f17fd0 enables a limited set
of metadata updates for partial LV/VGs when issuing lvchange or vgchange.
These tests verify those changes operate as intended.
2012-10-10 11:47:04 -05:00
Jonathan Brassow
3501f17fd0 [lv|vg]change: Allow limited metadata changes when PVs are missing
A while back, the behavior of LVM changed from allowing metadata changes
when PVs were missing to not allowing changes.  Until recently, this
change was tolerated by HA-LVM by forcing a 'vgreduce --removemissing'
before trying (again) to add tags to an LV and then activate it.  LVM
mirroring requires that failed devices are removed anyway, so this was
largely harmless.  However, RAID LVs do not require devices to be removed
from the array in order to be activated.  In fact, in an HA-LVM
environment this would be very undesirable.  Device failures in such an
environment can often be transient and it would be much better to restore
the device to the array than synchronize an entirely new device.

There are two methods that can be used to setup an HA-LVM environment:
"clvm" or "tagging".  For RAID LVs, "clvm" is out of the question because
RAID LVs are not supported in clustered VGs - not even in an exclusively
activated manner.  That leaves "tagging".  HA-LVM uses tagging - coupled
with 'volume_list' - to ensure that only one machine can have an LV active
at a time.  If updates are not allowed when a PV is missing, it is
impossible to add or remove tags to allow for activation.  This removes
one of the most basic functionalities of HA-LVM - site redundancy.  If
mirroring or RAID is used to replicate the storage in two data centers
and one of them goes down, a server and a storage device are lost.  When
the service fails-over to the alternate site, the VG will be "partial".
Unable to add a tag to the VG/LV, the RAID device will be unable to
activate.

The solution is to allow vgchange and lvchange to alter the LVM metadata
for a limited set of options - --[add|del]tag included.  The set of
allowable options are ones that do not cause changes to the DM kernel
target (like --resync would) or could alter the structure of the LV
(like allocation or conversion).
2012-10-10 11:33:10 -05:00
Peter Rajnoha
3af43af493 WHATS_NEW: update 2012-10-10 17:36:37 +02:00
Peter Rajnoha
a5306421dd man: dmsetup mangle also processes UUIDs now 2012-10-10 17:16:15 +02:00
Peter Rajnoha
470d1a2f54 dmsetup: also apply 'mangle' command for UUIDs
Compared to names, UUIDs can't be renamed once they are created
for a device. The 'mangle' command will just issue an error message
about a need for manual intervention in this case - reactivating the
device (remove + create) does the job as the defualt mangling mode
used is "auto" and that will assign a correct mangled form the UUID.
2012-10-10 17:16:15 +02:00
Peter Rajnoha
788b7a6a2b dmsetup: add mangled/unmangled_uuid to for info -c
Following the same logic already used for name mangling.
2012-10-10 17:16:15 +02:00
Peter Rajnoha
842167eb17 libdm: introduce and use DEV_UUID macro
To automatically prefer mangled UUID over unmangled UUID. The same
logic that is already used for dm name mangling...
2012-10-10 17:16:15 +02:00
Peter Rajnoha
8dccbae35e libdm: unmangle dm UUIDs on dm ioctl return 2012-10-10 17:16:15 +02:00
Peter Rajnoha
7e71ecbaf6 libdm: add mangling support for dm_task_set_newuuid 2012-10-10 17:16:14 +02:00
Peter Rajnoha
a621795a3c libdm: add mangling support for dm_task_set_uuid
Also, add a new field to struct dm_task called "mangled_uuid" that
will store mangled form of uuid if it differs from original uuid.
2012-10-10 17:16:13 +02:00
Peter Rajnoha
12f5c3f726 libdm: add dm_task_get_uuid_mangled/unmangled
Just like we already have existing mangling support for
device-mapper names, we need exactly the same for device-mapper
UUIDs as their character whitelist is wider than what udev supports.

In case udev is used to create entries in /dev based on UUIDs
and these UUIDs contain characters not supported by udev,
we'll end up with incorrect /dev content for such devices.
So we need to mangle them to a form that is supported by udev.

The mangling used for UUIDs follows the mangling used for names
(that is already supported and used throughout). That means,
setting the name mangling mode via dm_set_name_mangling_mode
affects mangling used for UUIDs in exactly the same manner.
It would be useless to add a new and separate
dm_set_uuid_mangling_mode fn, we'll reuse existing interface.
2012-10-10 16:59:47 +02:00
Peter Rajnoha
b0f48b9533 libdm: refactor internal mangling functions
(un)mangle_name -> (un)mangle_string
check_multiple_mangled_name_allowed -> check_multiple_mangled_string_allowed

Just for clarity as the same functions will be reused to (un)mangle dm UUIDs.
2012-10-10 16:59:11 +02:00
Petr Rockai
f65754e6fc test: Check that lvmetad is refreshed correctly on restart. 2012-10-10 13:54:36 +02:00
Petr Rockai
71d718a4a4 lvmetad: Warn if lvmetad is running but disabled. 2012-10-10 13:54:29 +02:00
Petr Rockai
622fb968a2 lvmetad: Fix the -f pidfile (non-)creation logic. 2012-10-10 13:53:21 +02:00
Petr Rockai
6e523f01d0 test: Skip thin tests if thin support is configured out. 2012-10-10 00:20:22 +02:00