Alasdair Kergon
d6750e9d76
lv->minor >= 0 (ejt)
2002-02-04 13:08:31 +00:00
Alasdair Kergon
812c699c8d
Basic support for persistent minor numbers;
...
slightly different from the current LVM1 method.
lvcreate --persistent y --minor 10 (to specify when created)
lvchange --persistent n (to turn off)
lvchange --persistent y --minor 11 (to change)
--persistent uses a new LV status flag stored on disk
minor number is stored on disk the same way as LVM1 does
(but major number stored is 0; any LVM1 major/minor setting gets lost)
lvchange -ay --minor 12 (to activate using minor 12, regardless of the
on-disk setting, which doesn't get changed)
--minor == -m
--persistent == -M
2002-02-01 17:54:39 +00:00
Joe Thornber
f593440b7b
o Remove redundant dbg_free.
2002-01-31 15:28:30 +00:00
Alasdair Kergon
12a6fcd3a8
Propagate volume group read-only setting down to its logical volumes.
...
(Might sometimes be safe to relax this restriction.)
2002-01-30 17:12:14 +00:00
Alasdair Kergon
7ae5a778d5
Basic support for (read-only) partial activation if any PVs are
...
missing from a VG. (Linear targets use the device-mapper 'error' target
which returns ioerror; striped targets use '/dev/ioerror' for now - which must
already exist e.g. as a sufficiently large block device version of /dev/zero).
2002-01-30 15:33:12 +00:00
Heinz Mauelshagen
08907484f5
quotes around names in output
2002-01-30 15:04:48 +00:00
Alasdair Kergon
851866d2fc
Allocate fixed space for vg->system_id when vg is created, instead of
...
dynamically.
2002-01-30 12:47:29 +00:00
Alasdair Kergon
df91af9141
o A vgimport implementation
...
o Require -a or <list of vgs> parameters with vgexport/vgimport
o Allow pvcreate -ff to destroy exported/partial VGs
2002-01-29 19:19:37 +00:00
Alasdair Kergon
f53c6aa66e
o Basic support for exporting (but importing not completed yet).
...
o When volume group does not have write flag set, prevent changes to it.
o Preparation for partial activation (not completed yet).
2002-01-29 17:23:33 +00:00
Alasdair Kergon
14936c751e
Display 'exported' status.
2002-01-29 16:30:18 +00:00
Alasdair Kergon
2f069a65d0
Add list_iterate that's safe with deletions.
2002-01-29 16:28:52 +00:00
Heinz Mauelshagen
f7ff4d005f
Zero gap after PV structure on write to disk in order to make non LVM tools happier (AED's idea and patch for LVM1)
2002-01-29 15:52:11 +00:00
Heinz Mauelshagen
6db767961b
fixed div bug in calculation of end in calculate_extent_count
2002-01-29 15:43:04 +00:00
Joe Thornber
4b2ec1929a
o There were some alignment problems with pool-debug which I've resolved
...
by allocating the data block with an additional dbg_malloc.
o Added an assertion to check that no one is requesting alternate
alignment for memory allocated from pool. I can't see us needing this
for LVM2.
2002-01-28 09:16:09 +00:00
Alasdair Kergon
1176eb2597
Tweak some error message levels.
2002-01-27 21:30:47 +00:00
Alasdair Kergon
db454fc8dc
The latest attempt at making extended striped LVs work portably with LVM1.
2002-01-25 20:24:14 +00:00
Alasdair Kergon
77712b1ecb
Set pv->pe_size when reading in text-file backup.
...
Otherwise LVM1 decides the PV structure is corrupt.
But do we need to keep both pv->pe_size and vg->extent_size
in internal metadata or can we generate pvd->pe_size when writing out
a PV that belongs to a VG?
2002-01-25 20:21:13 +00:00
Alasdair Kergon
b5e9efd3db
Only remove symbolic links when deactivating.
...
(if this code didn't create it, don't delete it)
2002-01-25 20:17:44 +00:00
Joe Thornber
d8fb03c714
o Tidy
2002-01-25 13:41:13 +00:00
Alasdair Kergon
3d2d379ce4
Have a pe_total check using theoretically big number instead of the
...
unnecessarily small limit LVM1 imposes in vgcreate (but not vgextend)
2002-01-24 23:35:56 +00:00
Alasdair Kergon
c50c2886f7
Don't bother to write out an empty cache.
2002-01-24 23:17:16 +00:00
Alasdair Kergon
b849de1d18
Fix the device cache to cope reasonably safely with device name changes.
...
This should be a rare occurrence so the aim is to recover if it's
straightforward to do so, otherwise just to abort the operation.
If people *knowingly* change device names, they should always run vgscan
afterwards.
A few bytes of memory gets leaked inside a pool each time an alias
has to be discarded - it's not worth restructuring the code to reuse it.
More of LVM2 needs updating to pass device objects (or uuids) about
instead of pathnames so that resolution of pathname->object only happens
once per operation.
dev_cache_get() should now always return the *current* device at the path given
dev_name_confirmed() replaces dev_name() whenever it's important to
know that name for the device is still current (ie when opening it).
If the cache doesn't know a current name, the function fails.
dev_open() guarantees that the file descriptor returned is for the dev_t
of the device structure it was passed.
2002-01-24 23:16:19 +00:00
Alasdair Kergon
7743c8685e
Clear a FIXME about checking for identical devices by comparing dev_t
...
instead of name.
2002-01-24 22:37:24 +00:00
Heinz Mauelshagen
ff783e52c9
removed ~64limit for PEs per PV agk introduced
2002-01-24 19:20:35 +00:00
Joe Thornber
58c18efc07
o Limit for number of extents should be 65534.
2002-01-24 17:32:56 +00:00
Alasdair Kergon
b2207a1c40
Improve allocation error messages when PVs in a VG have the allocatable
...
flag unset.
2002-01-24 17:26:00 +00:00
Alasdair Kergon
0d89ea9918
Impose max PE limit for each PV.
2002-01-24 17:24:32 +00:00
Joe Thornber
2fe9b1387b
o Add check for > 65k extents in a single lv.
2002-01-24 17:16:36 +00:00
Joe Thornber
0cf2445bb7
o Add extra parameter to lv_manip fns
2002-01-24 17:15:49 +00:00
Joe Thornber
9b88d8b78d
o Remove pointless calculation.
2002-01-24 14:15:42 +00:00
Alasdair Kergon
ba76e378e9
Ignore all except one PV found with the same UUID. Use one which
...
has the md major number if there is such.
2002-01-24 13:36:33 +00:00
Alasdair Kergon
333658d5f8
Fix dev_close arg.
2002-01-24 13:31:18 +00:00
Alasdair Kergon
610c25e8b1
o Remove redundant symlink-handling code.
...
o When opening device, return error if its cached name is incorrect (eg if
it's changed since the cache was generated). This prevents use until
the cache is rebuilt (eg with vgscan). Doesn't catch every case.
2002-01-23 18:55:01 +00:00
Alasdair Kergon
d518bc39f3
Avoid using VG metadata on PVs that are not in VGs.
2002-01-23 15:50:34 +00:00
Alasdair Kergon
58f323bc80
Silently remove any existing symlink before creating a new one.
2002-01-22 19:58:37 +00:00
Alasdair Kergon
7a403967d5
Customisable message output prefix / indentation.
2002-01-22 15:33:40 +00:00
Alasdair Kergon
c490c2f281
Insert a missing hash_remove.
2002-01-21 19:04:13 +00:00
Joe Thornber
75e4d06ade
o Allow fractional parts for size args. eg, lvcreate -L 34.4M
...
o Fix a couple of bugs related to the earlier lv_list change
2002-01-21 17:43:10 +00:00
Joe Thornber
f868d63582
o Similar changes for lv_list.
2002-01-21 16:49:32 +00:00
Joe Thornber
4d67a0787f
o Typo in comment
2002-01-21 16:10:36 +00:00
Joe Thornber
cc282870dd
o Changed
...
struct pv_list {
struct list list;
struct physical_volume pv;
};
to
struct pv_list {
struct list list;
struct physical_volume *pv;
};
o New function in toollib 'create_pv_list', which creates a list of pv's
from a given command line array of pv's.
o Changed lvcreate/extend to use this (fixes lvextend [pv list] bug).
2002-01-21 16:05:23 +00:00
Patrick Caulfield
94722ba71f
Fixx OB1 error in max LV and max PV numbers
2002-01-21 14:53:47 +00:00
Joe Thornber
e586401ecb
o Changed find_pv_in_vg, and find_lv_in_vg to return a struct pv_list * and
...
struct lv_list * respectively.
2002-01-21 14:28:12 +00:00
Joe Thornber
752e80cd5a
o names.[hc]
2002-01-21 13:11:03 +00:00
Joe Thornber
7fbaf10a79
o lvdisplay now gives a segment map for the -m option.
2002-01-21 12:05:39 +00:00
Joe Thornber
d29265b97d
o removed display_uuid
...
o use id_write_format from lib/uuid/uuid.h instead
2002-01-21 11:29:06 +00:00
Joe Thornber
12137231d3
o move the path building functions to lib/activate/names.c
...
o Update activate.c and fs.c to use them
o device names are now of the form <vg>:<lv>
2002-01-21 11:06:32 +00:00
Alasdair Kergon
682c0fef74
Allow syslog facility to be set, or turned off, from the config file.
2002-01-18 21:26:37 +00:00
Alasdair Kergon
0e63603659
Display something in the "hypothetical" unknown log level case.
2002-01-18 19:38:19 +00:00
Alasdair Kergon
fae0c5764f
Support --version argument and 'version' shell command.
2002-01-17 16:39:24 +00:00
Alasdair Kergon
add7dc2d5a
o pvcreate --uuid to specify the uuid (required before using vgcfgrestore
...
onto a new device). uuid specified must not already exist on the system.
o More message tidying.
o When checking for label, only read PV metadata.
o Add ataraid. [Needs moving into config/defaults files.]
2002-01-16 18:10:08 +00:00
Alasdair Kergon
93ea39697f
o Don't update vgcache when (not really) writing in test mode.
...
o Don't continue iterating through a possibly-deleted list.
2002-01-16 14:43:27 +00:00
Alasdair Kergon
3c06874035
Remove a duplicate disk read (can_handle).
2002-01-16 13:09:26 +00:00
Patrick Caulfield
d738054256
#include <string.h>
2002-01-16 12:02:06 +00:00
Joe Thornber
22d1879c60
o Set the segment counter back to 1, for a new LV.
2002-01-16 11:34:29 +00:00
Joe Thornber
5c83f05e81
o Knock out the "'%s' is not a block device" debug message.
2002-01-16 09:23:28 +00:00
Alasdair Kergon
e0d452a032
Reduce 'no label found' message severity to debug level.
2002-01-16 00:01:36 +00:00
Alasdair Kergon
deb8a3b7c9
Fix function typecasts.
2002-01-15 23:47:56 +00:00
Alasdair Kergon
48a00f1320
o More comprehensive config parameter debugging messages.
...
o Make /proc configurable.
o Review hard-coded "/dev"s - made 2 more of them configurable.
2002-01-15 23:34:13 +00:00
Alasdair Kergon
288adea256
o missing labeller free
...
o updated vgcfgrestore args
o change _check_for_open_devices only to check devices present in the hash
table instead of using dev_iter which triggers a full scan even when only
displaying command line help
2002-01-15 21:28:04 +00:00
Joe Thornber
f2f2634990
o vgcfgrestore works ! (with the couple of examples I tried).
2002-01-15 17:37:23 +00:00
Joe Thornber
6036e5e0f7
o split the uuid -> device map out from vgcache
...
o roll vgcache back to agk's implementation, we'll revisit this as part
of the cluster integration.
o change the extra_info field in a label to be a void *
2002-01-15 10:24:48 +00:00
Joe Thornber
406d287ae1
o Non-caching implementation of new vgcache interface.
2002-01-14 11:43:52 +00:00
Joe Thornber
9056f65b0c
o LVM1 labeller.
2002-01-14 10:00:56 +00:00
Joe Thornber
ea31a9b09c
o Reformat comment and correct typo.
2002-01-14 09:59:12 +00:00
Patrick Caulfield
4c0d6e283a
Couple of typos fixed.
2002-01-11 11:34:53 +00:00
Joe Thornber
ee27c57b58
o Put in the pv_hash which stores the pv section name -> pv struct mapping.
2002-01-11 11:09:12 +00:00
Joe Thornber
493656dd3c
o label.c now compiles.
2002-01-11 10:43:32 +00:00
Patrick Caulfield
391f02b1b5
Change lvm2_label to use Joe's new label switch system.
2002-01-11 10:39:56 +00:00
Alasdair Kergon
4a624ca055
o ACTIVE is no longer a status flag - lv_active() used to check if an LV
...
is active in the device-mapper.
o Many operations can be carried out regardless of whether the VG is
active or not.
o vgscan does not activate anything - use vgchange.
o Change lvrename to support renaming of active LVs.
o Remove '//' appearing in some pathnames.
o Dummy lv_check_segments() for compilation.
2002-01-10 23:21:07 +00:00
Joe Thornber
c6cc24ea3f
o _read_id function for import.c
2002-01-10 18:12:26 +00:00
Alasdair Kergon
7e56005011
More steps towards successful compilation.
2002-01-10 16:48:28 +00:00
Alasdair Kergon
2801ddcacc
Add 'get' functions.
2002-01-10 16:47:58 +00:00
Alasdair Kergon
cf633b70c2
More detail in error msgs.
2002-01-10 16:47:25 +00:00
Alasdair Kergon
b80f32dd0a
Clarify terminology:
...
VG is resizeable - PVs can be added or removed
PV is allocatable - free extents on it may be allocated to LVs
2002-01-10 15:09:51 +00:00
Joe Thornber
fc63d04f42
o Moved the current label.[hc] sideways to lvm2_label.[hc]
...
o First pass at low level labelling switch. This allows us to
register different label types (eg, lvm1, lvm2).
2002-01-10 15:01:58 +00:00
Joe Thornber
88cc3edf2e
o vgcfgrestore.
2002-01-10 14:27:47 +00:00
Alasdair Kergon
9b6934ba33
Temporary file creation & renaming.
2002-01-10 12:22:17 +00:00
Joe Thornber
9b5db6c270
o First pass at import.c. Still waiting for label code for the uuid->pv
...
mapping.
2002-01-10 11:18:08 +00:00
Joe Thornber
e2031c81b5
o Put in the 'out of memory' log_err for pool.
2002-01-10 09:35:55 +00:00
Alasdair Kergon
dff36d2a77
Renamed to archive.c
2002-01-09 19:17:11 +00:00
Alasdair Kergon
952d12a5f5
o Rename many occurrences of 'backup' to 'archive' to reduce confusion.
...
o Extract file creation/renaming code into a library and change backup code
to use it too.
o Support umask.
o Bring lvm.conf man page up-to-date.
2002-01-09 19:16:48 +00:00
Alasdair Kergon
4bbf2c3418
Accept octal values for numbers (such as umask).
2002-01-09 18:53:07 +00:00
Joe Thornber
9588155a4e
o Let the comment wars begin.
2002-01-09 14:14:07 +00:00
Joe Thornber
ab1885c8aa
o Reformat comments.
2002-01-09 13:56:11 +00:00
Alasdair Kergon
89f1e3ddf0
o Try to improve NFS-safety for temporary file creation (unique name; O_APPEND
...
+ fcntl lock) and rename (using hard link), avoiding any "real" archive
files ever being zero length.
o Fix filename parsing & ordered list handling.
2002-01-09 13:16:19 +00:00
Alasdair Kergon
d413c0ce38
Explicitly close (=>flush) files.
2002-01-09 13:07:03 +00:00
Alasdair Kergon
67fb2a39a7
Allow pool_begin_object in empty pool.
2002-01-09 13:06:02 +00:00
Joe Thornber
145eef414b
o Remove anomalous punctuation.
2002-01-08 10:51:13 +00:00
Joe Thornber
18ce960755
o Introduction to pool for those without psychic powers.
2002-01-08 10:47:17 +00:00
Alasdair Kergon
2bc25b546a
Support for read-only.
2002-01-07 22:28:36 +00:00
Alasdair Kergon
75e5ea90c2
Missing close() in error case.
2002-01-07 22:25:57 +00:00
Joe Thornber
5a72a50367
o vgcreate wasn't setting vg->cmd
2002-01-07 15:27:55 +00:00
Joe Thornber
16ab7a0da2
o New function 'merge_segments'
...
o Call said function at end of lv_extend
2002-01-07 15:08:28 +00:00
Joe Thornber
f5549805b6
o tidy up renaming of archive files.
2002-01-07 14:21:33 +00:00
Joe Thornber
197c3f2ab4
o sync tool changes for backup stuff.
2002-01-07 11:12:11 +00:00
Joe Thornber
330c46317c
o Added find_config_bool
2002-01-07 10:23:52 +00:00
Joe Thornber
3eb1b74b29
o Get format-text.c compiling.
2002-01-07 09:16:20 +00:00
Joe Thornber
e59204fc22
o sync laptop to test machine.
2002-01-07 09:05:31 +00:00
Joe Thornber
9640f93d8c
o Revert to the 6-4-4-4-4-4-6 format for uuid's
...
o When reading a uuid all -'s are stripped, wherever they are.
2002-01-04 16:55:14 +00:00
Alasdair Kergon
b94703a187
Put device name in quotes.
2002-01-03 17:47:48 +00:00
Alasdair Kergon
5671fce111
Fix final comma in arrays.
2002-01-03 12:43:01 +00:00
Alasdair Kergon
cc21948339
o Add autobackup support to tools (follows most vg_write calls).
...
o Skip autobackup when in test mode.
o Set test mode from config file.
o Create system/backup dirs if not present (unless LVM_SYSTEM_DIR holds "").
2001-12-31 21:27:39 +00:00
Alasdair Kergon
41b2fd5f4d
o Use lvm_snprintf wherever return value is used
...
o Add parameters to set retention limits for backups
2001-12-31 19:09:51 +00:00
Alasdair Kergon
67e4897b2c
Redundant.
2001-12-31 17:26:42 +00:00
Alasdair Kergon
6c94692bc6
Fix C99 error case handling (snprintf ret value >= buffer size).
2001-12-31 15:17:34 +00:00
Alasdair Kergon
52f71ce77b
Fixes for compilation.
2001-12-31 15:14:44 +00:00
Joe Thornber
2041d905a9
o Added a quick vgcfgbackup, needs parameters as yet.
2001-12-20 16:05:14 +00:00
Joe Thornber
493793dcbc
o Debug version of the pool_grow stuff.
2001-12-20 12:27:41 +00:00
Joe Thornber
9f44467d44
o sync backup changes
2001-12-20 11:52:54 +00:00
Patrick Caulfield
8cdf0a831c
Wipe the first label if writing the second one failed.
2001-12-18 14:39:32 +00:00
Joe Thornber
e8bacbc465
o sync the backup stuff
2001-12-17 19:46:10 +00:00
Joe Thornber
39b633c1de
o lvm_snprintf
...
Could everyone please use this from now on.
2001-12-17 14:04:10 +00:00
Heinz Mauelshagen
3813dd120e
Typos in error messages
2001-12-17 11:07:33 +00:00
Patrick Caulfield
515df8784a
Write the location of both labels in the labels so we can check them. I don't do
...
much with this ATM (apart from check that they all match up).
Use a different CRC routine.
2001-12-14 13:15:15 +00:00
Joe Thornber
6b4657e81f
o I figure if I can't remember how to use my code, then I should add
...
a comment. It's quite cool, wish I remember writing it.
2001-12-13 16:09:06 +00:00
Alasdair Kergon
839f595181
Handle orphan PVs too, so hints remain valid after vgreduce.
2001-12-13 15:08:58 +00:00
Patrick Caulfield
75f7aa5563
made the hard-coded 512 into BLOCK_SIZE just for neatness sake.
...
log_error() if writing the label fails so someone knows which was in error.
2001-12-13 08:40:47 +00:00
Alasdair Kergon
faa556e759
Add internal cache holding a 'hint' list of the PVs belonging to each VG.
...
A substantial speed-up - particularly in readline mode.
If the hints turn out to be wrong, the relevant parts get thrown away.
vgscan destroys it totally. In both cases it then rebuilds itself as
required.
2001-12-13 00:07:29 +00:00
Alasdair Kergon
394fae7fc5
fix for clean compilation
2001-12-12 16:25:53 +00:00
Joe Thornber
0803634cd1
o silly bugs
2001-12-12 16:22:38 +00:00
Joe Thornber
8a14dc290a
o pool-debug version of end_object wasn't returning the object.
2001-12-12 16:05:52 +00:00
Joe Thornber
c155eb83c2
o Add error checking in _new_chunk
2001-12-12 14:54:24 +00:00
Joe Thornber
2fbe588881
o pool-debug versions of begin_object, grow_object etc.
2001-12-12 14:25:20 +00:00
Patrick Caulfield
5aed44459e
Build label code into the library
2001-12-12 09:09:04 +00:00
Patrick Caulfield
8a51c23765
Use a proper CRC calculation.
2001-12-12 09:05:44 +00:00
Patrick Caulfield
f4a7ce7c49
- Change label format to include a string disk_type and a version number.
...
- The iterator can find labels by string and also appropriate version number (==,
<= or any) if you want.
- Add labels_match() call that compares the two labels and returns an error if
they do not match.
- Write labels in sector 1 & last rather than 2 & last as per Joe.
2001-12-11 16:49:40 +00:00
Patrick Caulfield
c41413c499
Fix label filter.
2001-12-11 14:17:10 +00:00
Joe Thornber
370e18e437
o Add output_date
2001-12-11 12:29:25 +00:00
Joe Thornber
57ba050c58
o flags.c reads and writes a status bitset
2001-12-11 12:18:56 +00:00
Joe Thornber
d96dea9abf
o Split import-export.c into two files.
2001-12-11 12:16:58 +00:00
Joe Thornber
a76318a698
o Update sample to a format that supports multiple vg's per file.
2001-12-11 12:15:08 +00:00
Patrick Caulfield
3dd5cbe54f
Label reading/writing code.
...
Not tested the filter yet.
2001-12-11 11:42:30 +00:00
Joe Thornber
db73838ca4
o Pretty print and read for uuid's
2001-12-11 11:40:34 +00:00
Patrick Caulfield
52864eda2e
Add a dev_get_sectsize call.
2001-12-11 10:18:49 +00:00
Alasdair Kergon
b74c8033a2
Fixes for allocation of striped volumes.
2001-12-07 21:17:12 +00:00
Alasdair Kergon
b546cd6d69
Correct activation message.
2001-12-05 00:04:18 +00:00
Alasdair Kergon
a299e38810
Added more log messages.
2001-12-04 23:20:27 +00:00
Joe Thornber
85028e021c
o sync
2001-12-04 14:14:07 +00:00
Alasdair Kergon
a03f232063
Tweaks for make install. -m args replaces verbose to display maps.
2001-12-03 20:23:53 +00:00
Alasdair Kergon
7a61472a0a
More striping support & fixes.
2001-12-03 16:27:16 +00:00
Joe Thornber
c0ca88c287
o Comparison function was sorting things in ascending rather than
...
descending order.
o free off the sort array when finished with it.
2001-11-30 09:19:46 +00:00
Joe Thornber
488a58a998
o Striped allocator
...
o Changed pv_map.c to maintain the list of free areas in size order, which
is more helpful to the allocators. If you want to allocate a bit of an
area call consume_area(area, size), this will adjust the area if there's
some space left and shuffle it to the correct place in the list.
Not tested.
2001-11-29 18:45:35 +00:00
Joe Thornber
74af29faae
o I was reading striped volumes incorrectly.
2001-11-29 14:13:43 +00:00
Alasdair Kergon
c2d72fd402
Add -t or --test arg to all tools that update metadata to avoid
...
committing metadata changes or (de)activating.
2001-11-28 18:03:11 +00:00
Joe Thornber
6c4ee29605
o Output the correct format for the stripe target
2001-11-28 17:52:27 +00:00
Joe Thornber
252c7708f5
o pool_free was leaving one block hanging around.
2001-11-28 14:58:33 +00:00
Alasdair Kergon
579944d327
o Tool support for segments.
...
o vgmerge working.
2001-11-28 13:45:50 +00:00
Joe Thornber
4a8d120415
o pool-debug.c contains an alternative implementation of pool that gets
...
a seperate chunk of memory from dbg_malloc for each pool_alloc. This
will allow the bounds checking code in dbg_malloc to do it's stuff.
o The normal implementation moved to pool-fast.c
o pool.c now just contains a #ifdef and includes the appropriate .c file.
Alasdair, could you make sure that gcc -MM get's passed all the
CFLAGS please, otherwise the dependencies get calculated incorrectly.
2001-11-28 09:13:00 +00:00
Alasdair Kergon
b9adad95c8
Fix a memory smash.
2001-11-27 23:12:06 +00:00