Dave Wysochanski
4242655be1
Replace _apply_settings() after create_toolcontext() with equivalent inline.
...
Subsequent patches will refactor / remove each of these lines, as many of
them are redundant when called immediately after create_toolcontext().
2008-12-11 03:28:54 +00:00
Dave Wysochanski
d17a8e365d
Make _init_rand() thread safe - use rand_r() instead of rand().
...
Use good entropy for seed value if possible.
2008-12-07 04:27:56 +00:00
Peter Rajnoha
b47952641a
Added displayable_lvs_in_vg and lv_is_displayable functions to deal with
...
the counts of visible LVs from user's perspective consistently throughout
the code.
2008-12-04 15:54:26 +00:00
Dave Wysochanski
9d9589d173
Fix vgcreate race which could allow two parallel vgcreates to succeed,
...
with the second vgcreate overwriting the first.
Obtain lock before calling vg_create(), which checks for existence of vgname
and fails if it already exists.
2008-12-01 20:14:33 +00:00
Zdenek Kabelac
3015b03df2
fix missing const char*
2008-11-18 10:13:23 +00:00
Dave Wysochanski
da52655315
Fix "lvremove -f vgname" when vgname contains snapshots.
...
Prior to this patch, "lvremove -f vgname" would fail if vgname contained
one or more snapshot LVs. Now this passes, but has a side-effect.
If you issue "lvremove vgname" where vgname contains one or more snaps,
you will get an extra "y/n" prompt to remove the same snapshot.
Example:
$ lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lvsnap vgtest swi-a- 16.00M lvtest 0.05
lvtest vgtest owi-a- 64.00M
$ lvremove vgtest
Do you really want to remove active logical volume "lvsnap"? [y/n]: n
Logical volume "lvsnap" not removed
Do you really want to remove active logical volume "lvsnap"? [y/n]: n
Logical volume "lvsnap" not removed
Command failed with status code 5.
Fixing this will most likely require modification of the iterator
function, process_each_lvs_in_vg() to iterate over snaps in some
cases (e.g. lvs, vgdisplay -v) but not in others (lvremove).
2008-11-17 18:20:13 +00:00
Alasdair Kergon
cee9a8d87e
some makefile fixes for liblvm2cmd & remove some hardcoded .so
2008-11-14 20:59:56 +00:00
Zdenek Kabelac
f302d21406
cleaner const char* usage for last_path_component()
2008-11-12 09:53:33 +00:00
Zdenek Kabelac
571168690b
minor compiler warning fix for function declaration prototype
2008-11-12 09:49:06 +00:00
Milan Broz
f622b0de34
Fix lvm2.static build.
2008-11-10 13:41:43 +00:00
Dave Wysochanski
e7513be20c
Fix vgdisplay return code and exit status.
2008-11-07 19:02:47 +00:00
Alasdair Kergon
77b69aa724
make install_device-mapper
2008-11-04 17:25:32 +00:00
Alasdair Kergon
e50d0e97b1
more missing bits
2008-11-04 14:57:06 +00:00
Alasdair Kergon
2c44337bd5
Right, a simple build (without options) is working again.
2008-11-03 22:14:30 +00:00
Alasdair Kergon
0782ad5002
further progress
2008-11-01 02:19:19 +00:00
Alasdair Kergon
e8e8fa1ed7
drop explicit libdevmapper.h
2008-10-30 17:52:06 +00:00
Alasdair Kergon
84b9ec9733
Split out lvm-logging.h from log.h.
2008-10-30 17:27:28 +00:00
Alasdair Kergon
0b1bf1f56b
Split out dm-logging.h from log.h
2008-10-30 17:24:04 +00:00
Milan Broz
ed8c4d9961
Fix validation of --minor and --major in lvcreate to require -My always.
2008-09-24 16:32:51 +00:00
Alasdair Kergon
6e410af1d6
fix last release
2008-09-19 15:44:03 +00:00
Alasdair Kergon
87ec948433
.
2008-09-19 07:18:03 +00:00
Alasdair Kergon
cda354087f
rename var
2008-09-19 07:12:45 +00:00
Alasdair Kergon
8c5bcdabab
Improve the way VGs with PVs missing are handled so manual intervention
...
is required in fewer circumstances. (mornfall)
2008-09-19 06:42:00 +00:00
Alasdair Kergon
7a71d71a94
remove unused var
2008-09-19 03:45:34 +00:00
Alasdair Kergon
324e23b72d
Avoid shuffling remaining mirror images when removing one, retaining primary.
2008-09-18 19:56:50 +00:00
Alasdair Kergon
08b481bbc5
Prevent resizing an LV while lvconvert is using it.
2008-09-18 18:51:58 +00:00
Milan Broz
df9c7546a2
Fix pvresize to not allow resize if PV has two metadata areas.
...
If the PV has two metadata areas, second one is located at the end of the device.
Do not allow resize of PV or second metadata area can be overwritten.
(The check was active only for orphan PVs.)
2008-09-12 15:26:45 +00:00
Milan Broz
3a2fb07349
Fix setting of volume limit count if converting to lvm1 format.
...
Fixes problem when after downconvert to lvm1 VG is broken:
# lvcreate -n lv1 -l 4 vg_test
Invalid LV in extent map (PV /dev/sdb1, PE 0, LV 0, LE 0)
...
2008-08-29 13:41:21 +00:00
Milan Broz
9c520b114a
Fix vgconvert logical volume id metadata validation.
...
If volume group is downconverted to lvm1 format,
check if lvid has supported format for conversion to lv_num in lvm1.
2008-08-28 18:41:51 +00:00
Milan Broz
8df4c3748a
Fix vgcfgbackup to properly check filename if template is used.
2008-08-13 12:44:24 +00:00
Alasdair Kergon
b7961bdb2f
Improve file descriptor leak detection to display likely culprit and filename.
2008-08-01 19:51:27 +00:00
Alasdair Kergon
bc9481770a
remove now-redundant slash-stripping
2008-07-31 15:38:52 +00:00
Alasdair Kergon
021317a547
Change lvchange exit status to indicate if any part of the operation failed.
2008-07-31 13:03:01 +00:00
Alasdair Kergon
a6d9d66dcc
remove unused mdas variable
2008-07-31 12:40:52 +00:00
Alasdair Kergon
32a478cb1f
fix pvremove for pvs without mdas
2008-07-31 12:38:31 +00:00
Alasdair Kergon
1b8b624661
Fix pvchange to handle PVs without mdas.
2008-07-31 12:28:51 +00:00
Dave Wysochanski
6ce652e3ec
Add pvcreate tests to verify failure on md array detection.
2008-07-29 21:05:20 +00:00
Dave Wysochanski
65a431fe1f
Refactor pvcreate - simplify return codes.
2008-07-25 14:59:51 +00:00
Dave Wysochanski
0e74f8fc65
Refactor pvcreate - --yes argument
2008-07-25 14:45:24 +00:00
Dave Wysochanski
3cf01067cf
Refactor pvcreate - --force parameter.
2008-07-25 14:36:55 +00:00
Dave Wysochanski
8bb4eab0d7
Refactor pvcreate - use '0' for no --uuid or --restorefile options.
2008-07-25 14:12:29 +00:00
Dave Wysochanski
1a02e2e43b
Refactor pvcreate - move uuid and restorefile options.
2008-07-25 00:30:57 +00:00
Alasdair Kergon
08c1745893
reinstate lost FIXME
...
- only if kernel gives the info, not to be worked out in userspace
- with lvm.conf option to enable/disable the check
2008-07-24 15:25:09 +00:00
Dave Wysochanski
f2d0cc63fd
Remove dead code, is_lvm_partition() - no functional change.
...
This code does nothing. The function is #defined to 1 which ensures the only
two if statements referencing it will never be true.
2008-07-23 19:46:33 +00:00
Dave Wysochanski
61bc35aa12
Refactor pvcreate - move labelsector parameter parsing & validation.
2008-07-23 19:29:58 +00:00
Dave Wysochanski
7d400bc787
Refactor pvcreate - divide parameter parsing & validation from create logic.
...
Move size (setphysicalvolumesize option), metadatacopies and metadatasize
validation.
2008-07-21 19:27:22 +00:00
Dave Wysochanski
57376069bd
Refactor pvcreate to divide parameter parsing & validation from create logic.
2008-07-21 19:26:33 +00:00
Dave Wysochanski
2b6589c0d7
Refactor _lvcreate() - no functional change.
2008-07-17 15:19:42 +00:00
Alasdair Kergon
239c4fe6db
Fix pvchange -M1 -u to preserve existing extent locations when there's a VG.
2008-07-16 10:46:12 +00:00
Alasdair Kergon
6db4136358
Update validation of safe mirror log type conversions in lvconvert. (brassow)
2008-06-26 23:05:11 +00:00
Alasdair Kergon
1049bc2f9c
Fix lvconvert to disallow snapshot and mirror combinations. (mpatocka)
2008-06-26 21:38:58 +00:00
Alasdair Kergon
36081ccf2d
Fix reporting of LV fields alongside unallocated PV segments.
2008-06-25 16:52:27 +00:00
Alasdair Kergon
ca8d363d2c
Add --rows to dmsetup.
2008-06-24 22:53:48 +00:00
Alasdair Kergon
1f787aca28
Add --rows to reports.
2008-06-24 22:48:53 +00:00
Alasdair Kergon
30ef4c738a
Add --unquoted to reporting tools.
2008-06-24 21:21:04 +00:00
Alasdair Kergon
f1839ac87c
dmsetup --unquoted
2008-06-24 20:16:47 +00:00
Dave Wysochanski
15db00b53e
Refactor pv_create() to take cmd_context - no functional change.
2008-06-24 20:10:32 +00:00
Jim Meyering
65b19284b5
lvm2_run: don't return uninitialized for _memlock_inc or _memlock_dec
...
* tools/lvmcmdlib.c: Initialize "ret". Also avoid useless string
comparison.
2008-06-23 09:27:45 +00:00
Zdenek Kabelac
5f2c195933
Improve/Fix read ahead 'auto' calculation for stripe_size
...
Fix lvchange output for -r auto setting if auto is already set
Add testcase for read ahead
2008-06-18 11:32:14 +00:00
Jim Meyering
dacf86a12d
avoid compiler warning about cast in OFFSET_OF macro
...
* dmsetup/dmsetup.c (OFFSET_OF): Use an equivalent definition
that does not cast a pointer value to a narrower type.
2008-06-18 10:19:25 +00:00
Alasdair Kergon
dc868e56c9
Add --force to lvextend and lvresize.
2008-06-12 13:24:02 +00:00
Milan Broz
c8c24ccd23
Fix vgchange to not activate mirror leg and log volumes directly.
2008-06-12 11:49:46 +00:00
Jim Meyering
a639a1f2b9
break (rather than return) so we have only one point of return
...
* tools/toollib.c (process_each_segment_in_lv): Upon sigint_caught,
break rather than returning ret_max. No semantic change.
2008-06-11 15:02:52 +00:00
Dave Wysochanski
3a30d1db20
Fix return values for reporting commands when run with no PVs, LVs, or VGs.
...
The new error checking code caught some commands that were returning '0' as
an exit status for success. This is incorrect and resulted in a benign error
message displayed (see below). As of today, all commands should return a
value defined in lib/commands/errors.h (1-5). This results in an exit code of
0 on success, or > 0 on failure (as stated in the lvm.8 man page).
Before change:
1. Make sure no PVs are on the system
2. Run 'pvs'
Command failed with status code 0.
After change:
<no output>
2008-06-10 20:07:04 +00:00
Dave Wysochanski
a3678fa186
Add ommitted unlock_vg() call when sigint_caught() during vg processing.
...
Specific test case:
1. pvcreate /dev/loop1; vgcreate vg1 /dev/loop1; lvcreate -L 64M -n lv1 vg1
2. vgremove vg1 (will prompt user)
3. CTRL-C
Code will exit with:
Do you really want to remove volume group "vg2" containing 2 logical volumes? [y/n]:
Volume group "vg2" not removed
Command failed with status code 5.
Internal error: Volume Group vg2 was not unlocked
Device '/dev/loop1' has been left open.
After change:
Do you really want to remove volume group "vg2" containing 2 logical volumes? [y/n]:
Volume group "vg2" not removed
Command failed with status code 5.
2008-06-10 15:25:38 +00:00
Alasdair Kergon
aa76972385
Drop cached metadata for disappearing VG in vgmerge.
2008-06-06 19:32:35 +00:00
Alasdair Kergon
ec40d92889
post-release
2008-06-06 19:28:35 +00:00
Alasdair Kergon
db6056516e
change --prefixes to --nameprefixes
2008-06-06 18:53:08 +00:00
Alasdair Kergon
697e3bb2df
back out unnecessary changes for this release
2008-06-06 17:36:19 +00:00
Alasdair Kergon
167c1633f2
cache dropping needs to use old name not new
...
rename variable to reduce confusion
2008-06-06 16:13:35 +00:00
Alasdair Kergon
179b9822b4
Drop cached metadata when renaming a VG.
2008-06-06 13:04:44 +00:00
Alasdair Kergon
bdf8c02f80
Add missing deactivation after activation failure in lvcreate -Zy.
2008-06-05 13:38:30 +00:00
Alasdair Kergon
50fd61eb8d
suppress warning on silent failure with ECMD_PROCESSED
2008-06-03 17:48:13 +00:00
Alasdair Kergon
de24008109
In script-processing mode, stop if any command fails.
...
Warn if command exits with non-zero status code without a prior log_error.
2008-05-30 15:27:44 +00:00
Alasdair Kergon
ace5664e7d
Temporarily disable dmeventd mirror monitoring during lvchange --resync.
2008-05-21 14:10:11 +00:00
Alasdair Kergon
25fbec5be1
revert accidental checkin
2008-05-19 20:06:34 +00:00
Alasdair Kergon
fc54be1062
Refactor some vginfo manipulation code.
2008-05-19 19:49:56 +00:00
Alasdair Kergon
f7da1f8177
Don't touch /dev in vgrename if activation is disabled.
2008-04-30 14:34:02 +00:00
Alasdair Kergon
eddc0f3307
post-release - reinstate incomplete enhancements
2008-04-29 16:11:28 +00:00
Alasdair Kergon
04ed52f6a0
pre-release (bug fixes only - enhancements excluded)
2008-04-29 15:58:25 +00:00
Zdenek Kabelac
9ad2ba2a1f
fixing fsadm usage with older blockdev,blkid,readline tools
...
fixing lvresize extension code path where size was not set for fsadm
2008-04-29 15:25:28 +00:00
Dave Wysochanski
8e8baf89c0
Fix vgsplit internal counting of snapshot LVs.
2008-04-23 14:33:06 +00:00
Dave Wysochanski
7eb03d6c5c
Fix internal snapshot_count when vgmerge with snapshots in source VG.
2008-04-23 12:53:10 +00:00
Alasdair Kergon
14004cf20c
Use 'active' for !suspended as the code already uses that.
2008-04-21 16:57:11 +00:00
Alasdair Kergon
82bacfc3b2
Add 3 new reporting colums: tables_loaded, readonly, suspended.
2008-04-21 13:16:30 +00:00
Alasdair Kergon
dd540781dc
Add --prefixes to dmsetup
...
E.g. dmsetup info -c --prefixes
Again, might change the name of this option.
2008-04-21 11:59:22 +00:00
Alasdair Kergon
f419a87150
Add --prefixes to reporting tools for field name prefix output format.
...
E.g. lvs --prefixes --noheadings --unbuffered --units m --nosuffix
(Used '--prefixes' for now, but I'm looking for a better name.)
2008-04-20 00:15:08 +00:00
Alasdair Kergon
f44e3ff46a
Calculate string size within dm_pool_grow_object.
2008-04-19 15:50:18 +00:00
Alasdair Kergon
7e305eda2f
Fix lvconvert -m0 allocatable space check.
2008-04-18 12:50:24 +00:00
Alasdair Kergon
082628eb2c
missing stack
2008-04-15 14:57:12 +00:00
Dave Wysochanski
c5421d1554
Update vgsplit to only restrict split with active LVs involved in split.
...
Existing code will reject a vgsplit if any LVs in the source VG are active.
This patch updates vgsplit to only check LVs involved in the split.
2008-04-10 21:34:53 +00:00
Alasdair Kergon
f72dd2c732
.
2008-04-10 20:02:04 +00:00
Alasdair Kergon
3a370b7350
more pre-release cleanup
2008-04-10 19:59:43 +00:00
Alasdair Kergon
0b2a795ece
make list_move consistent with other list fns
2008-04-10 19:14:27 +00:00
Dave Wysochanski
985ca02b6a
Add vg_is_clustered() helper function.
...
Should be no functional change.
2008-04-10 17:09:32 +00:00
Dave Wysochanski
8965ff4bcf
Minor vgsplit cleanups.
2008-04-10 02:15:56 +00:00
Dave Wysochanski
3998882f2f
Add _move_one_lv() helper function for vgsplit.
2008-04-10 01:30:22 +00:00
Dave Wysochanski
eec663aa3b
Fix vgsplit to only move hidden 'snapshotN' LVs when necessary.
...
This bug has been around for a long time as far as I can tell.
Without this fix, a vgsplit would unconditionally move the
'hidden/internal' snapshot LVs, and result in corrupted metadata
in the following case:
vg1: contains lv1, lv1snap, both on pvset1
vg1: contains lv2, on pvset2
"vgsplit vg1 vg2 pvset2"
would result in "snapshot0" hidden LV being moved to vg2, and
the origin and cow being left in vg1. The tools detect the
corruption in vg2, but not in vg1.
2008-04-09 20:56:06 +00:00
Dave Wysochanski
85f5392e52
Update vgsplit to take "-n LogicalVolumeName" on the commandline.
2008-04-09 13:47:13 +00:00
Alasdair Kergon
eb273c7c65
Use clustered mirror log with pvmove in clustered VGs, if available.
2008-04-09 12:56:34 +00:00