Alasdair Kergon
4c64ed4ced
New column-based reporting tools: lvs, pvs & vgs.
2002-12-12 20:55:49 +00:00
Alasdair Kergon
69e2befd15
Use sync_dir().
2002-12-05 22:56:22 +00:00
Alasdair Kergon
0fc1d0788d
Add sync_dir()
2002-12-05 22:51:15 +00:00
Alasdair Kergon
28879d4174
Fix display alignment of zero.
2002-12-05 22:42:31 +00:00
Alasdair Kergon
8a95d67e26
Maintain snapshot_count correctly.
2002-12-05 22:30:39 +00:00
Alasdair Kergon
a14e14efdd
Keep some ld versions happy.
2002-12-05 22:27:43 +00:00
Alasdair Kergon
a648372757
New devices/types config file entry to add new types of block devices.
2002-12-03 16:20:38 +00:00
Alasdair Kergon
11779747ef
Show PV uuid; single stripe is 'linear'; suppress snapshot fields for origin.
2002-12-03 13:26:17 +00:00
Alasdair Kergon
66a8d8b4b2
Show stripesize in KB.
2002-11-26 21:56:57 +00:00
Alasdair Kergon
22d2827b41
Skip config file reload attempt if no config file location.
2002-11-26 12:14:37 +00:00
Alasdair Kergon
50d7e96c6d
Remove 2 TB LV size restriction message.
2002-11-18 16:21:00 +00:00
Alasdair Kergon
c3aa104a8d
Missing sector->k conversion in "logical volumes cannot be larger than" mesg.
2002-11-18 16:08:45 +00:00
Alasdair Kergon
5a52dca9c2
Some new features.
2002-11-18 14:04:08 +00:00
Alasdair Kergon
d1d9800ef1
Refactoring.
2002-11-18 14:01:16 +00:00
Alasdair Kergon
74b27447c1
A new cache.
2002-11-18 13:53:58 +00:00
Alasdair Kergon
f2187638dc
Don't let LVM2 access a VG if the original LVM driver appears to be using it.
2002-11-01 19:57:25 +00:00
Joe Thornber
6086b60455
o inline _step_matcher
2002-08-29 15:05:16 +00:00
Joe Thornber
22a0881ded
o Anchor support for the regex engine.
2002-08-29 14:46:30 +00:00
Patrick Caulfield
da253e3aac
Remove O_DIRECT as it causes problems with some systems.
...
Harumph.
2002-08-14 14:58:00 +00:00
Joe Thornber
b1545f2985
o Make sure the status parsing code can deal with an empty array.
2002-08-01 12:51:48 +00:00
Joe Thornber
07bb413a8f
o Added new value type CFG_EMPTY_ARRAY, to indicate '[]', useful since we use
...
the arrays to hold a symbolic set of flags.
2002-08-01 12:46:52 +00:00
Joe Thornber
ffa879d092
o 0 was used rather than NULL in a couple of places.
...
o Indent output with tabs rather than single spaces.
2002-08-01 08:22:09 +00:00
Patrick Caulfield
7a0ed4a40c
Rename lock_resource to file_lock_resource to avoid name clashes
2002-07-25 09:04:30 +00:00
Patrick Caulfield
6b3b4a250b
Use O_DIRECT for writing to devices.
...
Doesn't work on HPPA due to a kernel bug but other archs shuld be OK.
2002-07-22 08:10:54 +00:00
Alasdair Kergon
12caf445d4
Remove hard-coded extent_size from snapshot target (field no longer used).
2002-07-17 17:00:54 +00:00
Joe Thornber
7cc602c800
i) Add the VISIBLE flag to the text format. (Other changes are pending
...
for lib/activate.)
2002-07-11 15:28:49 +00:00
Joe Thornber
291906a208
i) Added a little macro to aid defining the status flags.
2002-07-11 14:36:45 +00:00
Joe Thornber
097d49e73d
i) There's now a seperate field in struct logical_volume that stores the
...
allocation policy. This can currently take one of three values:
typedef enum {
ALLOC_NEXT_FREE,
ALLOC_STRICT,
ALLOC_CONTIGUOUS
} alloc_policy_t;
Notice that 'SIMPLE' has turned into the slightly more meaningful NEXT_FREE.
ii) Put code into display.[hc] for converting one of these enums to a
text representation and back again.
ii) Updated the text format so this also has the alloc_policy field.
2002-07-11 14:21:49 +00:00
Alasdair Kergon
407332cb9a
tidy
2002-07-11 14:09:26 +00:00
Alasdair Kergon
48450b8f43
Add get_config_str
2002-07-11 14:07:43 +00:00
Patrick Caulfield
38f3949b25
Don't log an error if we can't write the cache file because the FS is read-only.
...
Gets rid of that annoying error at shutdown.
2002-07-11 09:23:29 +00:00
Alasdair Kergon
48ad31920d
Add --ignorelockingfailure
2002-07-10 20:43:32 +00:00
Alasdair Kergon
0dbd22124b
Merge adjacent "Missing" segments.
2002-07-10 13:54:17 +00:00
Joe Thornber
7df3006c6b
o Add version number to text format.
2002-07-02 18:47:43 +00:00
Patrick Caulfield
b40b90f035
Flush on open as well as close.
2002-06-25 14:02:28 +00:00
Patrick Caulfield
aefa3c6d82
Get rid of compile warnings on 64bit platforms.
2002-06-07 08:37:07 +00:00
Alasdair Kergon
70d6838fb0
Tidy
2002-05-31 19:28:37 +00:00
Alasdair Kergon
61e9603be5
Remember to update VG free_count when reducing size of an LV.
2002-05-30 16:08:19 +00:00
AJ Lewis
fa6a82c9af
o fix changed function names
2002-05-23 14:13:21 +00:00
Alasdair Kergon
5f05971a84
Fix LVM1 backwards compatibility issue when LV with a low LV number is deleted.
2002-05-23 11:37:51 +00:00
Alasdair Kergon
c826c0d17c
Rename; add some FIXMEs.
2002-05-22 14:03:45 +00:00
Alasdair Kergon
1f835295d8
Revert to standard linux macros (for correct behaviour on rare architectures).
2002-05-21 12:37:07 +00:00
Andres Salomon
6106741bea
ack, missing include
2002-05-19 04:11:34 +00:00
Andres Salomon
6e0fa64c7b
update create_dir() comment
2002-05-19 03:52:38 +00:00
Andres Salomon
310a81c90c
support recursive mkdir in create_dir()
2002-05-19 03:46:34 +00:00
Alasdair Kergon
031079703f
Rewrite missing/corrupt metadata in more cases.
2002-05-13 12:38:54 +00:00
AJ Lewis
39ed033adb
o the _status fxns now take more arguments - this way i don't get the
...
preparsed status info, shove it all into a string, and then parse it
again to get the info back out (which is what i was doing before)
o basically that's it...i like this *much* better than the previous
method and i think it makes the _status fxn more flexible if we need
to use it to get other info out.
2002-05-10 16:06:06 +00:00
AJ Lewis
1951dba955
o Actually read snapshot percentage from the kernel - what a pain! :)
...
o Not sure if the code in dev_manager is really optimal, but it works..
will look at adjusting it a bit now.
o I *think* it works right when one snapshot if full but others aren't,
but I haven't really been able to test it because the full snapshot
somehow resets itself and weird things start happening to the system...
2002-05-09 21:17:57 +00:00
Alasdair Kergon
64ad493eac
Remove a no-op.
2002-05-09 12:03:55 +00:00
AJ Lewis
29152f6ef0
o header should only be printed once...
2002-05-08 17:58:52 +00:00
AJ Lewis
fccc39a3a7
o Added function find_snapshots to snapshot_manip.c that returns a list
...
of snapshots whose origin is the lv passed in.
o Used this new function to make lvdisplay properly display all snapshots
attached to a origin.
2002-05-08 16:57:46 +00:00
Andres Salomon
8ac9aae78a
implement our own swabbing functions, instead of relying on the kernel's.
2002-05-07 15:28:59 +00:00
Alasdair Kergon
c5e08c6c83
Default values for some display output settings
2002-05-07 12:50:01 +00:00
Alasdair Kergon
5be981bab5
Tweaks
2002-05-07 12:47:11 +00:00
Andres Salomon
b9923fe3f2
Make lvm2 compile on big endian archs; use the kernel/glibc's endian
...
conversion stuff, instead of implementing our own. Tested on a little
endian system (x86); I'll let the debian handle big endian testing. :)
2002-05-07 05:54:14 +00:00
AJ Lewis
b7749b7a96
o Will now correctly remove expired achive files from the system when
...
archive_vg is called.
o Added a #define to the top of the file - not sure if this is the
appropriate place for it though
2002-05-03 19:28:07 +00:00
Alasdair Kergon
6b4c9ff740
Some partial VG support with format_text.
2002-04-30 17:12:37 +00:00
Alasdair Kergon
e1f93d52e3
get_vgs must check for text format VGs when no lvm1 format VGs present
2002-04-30 12:27:13 +00:00
AJ Lewis
6e2ff7fb35
o Updated *display output for LVM1 compatibility
...
o There is still a bit missing
+ all are missing the {PV,VG,LV} # - that is not applicable in LVM2
+ pvdisplay doesn't show how many LVs are contained on it
+ much of the snapshot information isn't available for lvdisplay
o Look at the code for other potiential FIXMEs :)
2002-04-29 21:43:14 +00:00
Alasdair Kergon
25b733809a
Merge with text format branch.
...
Lots of changes/very little testing so far => there'll be bugs!
Use 'vgcreate -M text' to create a volume group with its metadata stored
in text files. Text format metadata changes should be reasonably atomic,
with a (basic) automatic recovery mechanism if the system crashes while a
change is in progress.
Add a metadata section to lvm.conf to specify multiple directories if
you want (recommended) to keep multiple copies of the metadata (eg on
different filesystems).
e.g. metadata {
dirs = ["/etc/lvm/metadata1","/usr/local/lvm/metadata2"]
}
Plenty of refinements still in the pipeline.
2002-04-24 18:20:51 +00:00
Joe Thornber
e3528bcda7
o Stop printing errors if flushing fails (could be an unconfigured device).
2002-04-24 08:37:34 +00:00
Alasdair Kergon
de3bec7f81
Missing seg->lv gives segfault when activating from text format.
2002-04-16 19:41:54 +00:00
Alasdair Kergon
69e8a53ee4
Allow deactivation of final snapshot.
2002-04-16 14:42:20 +00:00
Alasdair Kergon
7e3d403b88
Implement a no_locking module that *does* attempt activation.
2002-04-11 14:10:32 +00:00
Patrick Caulfield
584404f8f4
Return status from _lv_activate and friends.
...
Alasdair, I think this is right (and I need it) but you may like to check.
2002-04-11 09:14:04 +00:00
Patrick Caulfield
426bc429ef
Remove \n from log messages.
2002-04-10 15:49:47 +00:00
Joe Thornber
f31c47ade8
o Perform a BLKFLSBUF ioctl whenever a block device is closed.
...
Patrick, can you see if this fixes your cluster syncing problem please ?
If so I'll make it so it only syncs if you have actually written to the
device.
2002-04-08 18:59:50 +00:00
Patrick Caulfield
2fab033e9b
Implement an external locking interface.
2002-04-08 16:04:50 +00:00
Patrick Caulfield
c34d34e6a0
Fix prototype.
2002-04-08 13:35:09 +00:00
Alasdair Kergon
ab053ad6c1
Fix lv_setup() not to generate a new lvid each time if asked to setup the
...
same LV more than once - subsequent times validate only.
2002-04-05 14:32:22 +00:00
Patrick Caulfield
ae70673752
Make lock type numbers match the DLM numbers in use, and move UNLOCK out
...
of the way.
2002-04-04 13:31:21 +00:00
Alasdair Kergon
8856889d10
Rename LCK_NONE to LCK_UNLOCK
2002-04-04 11:18:45 +00:00
Alasdair Kergon
607bcd61d0
Tidying.
2002-04-03 12:17:55 +00:00
Alasdair Kergon
7bb6856a7e
Cope with creation of additional snapshots while active.
...
(More work on suspension dependencies still needed.)
2002-03-27 18:17:43 +00:00
Alasdair Kergon
4bb3eccf2b
New-style persistent minor support.
2002-03-26 13:41:37 +00:00
Alasdair Kergon
e04c519896
o read-only device support
...
o name/uuid disambiguation
2002-03-25 18:54:59 +00:00
Alasdair Kergon
c1b5fc6673
Fix typo.
2002-03-25 18:50:37 +00:00
Alasdair Kergon
9585e50fef
Better support for LVs with hyphens in names.
2002-03-19 16:41:44 +00:00
Alasdair Kergon
2ed2a72439
lvrename works on snapshots now
2002-03-18 23:25:50 +00:00
Alasdair Kergon
a76ba817a8
Tie all snapshot (de)activation requests to (de)activation of origin device.
2002-03-18 13:09:27 +00:00
Alasdair Kergon
20ce742691
s/Removing/Unloading/ in messages to reduce confusion
2002-03-15 23:01:59 +00:00
Alasdair Kergon
a69de4919b
Cut the number of device-mapper calls.
2002-03-15 22:59:12 +00:00
Alasdair Kergon
a6bf4bcfa2
New function to enable suppression of messages to stdout/stderr.
2002-03-15 22:54:04 +00:00
Alasdair Kergon
568d7229bf
Review locking: block signals instead of ignoring them and restore state
...
afterwards; avoid race condition with unlink; add LCK_HOLD to process_each_vg.
2002-03-15 16:07:38 +00:00
Alasdair Kergon
14a9cda63b
Reduce the number of dm info calls.
2002-03-14 21:17:30 +00:00
Alasdair Kergon
20c5fcf764
Integrate suspend.
2002-03-14 15:36:07 +00:00
Joe Thornber
d8e7d77316
o dev_manager_suspend, untested.
2002-03-14 10:56:09 +00:00
Alasdair Kergon
dd420615d5
Set LV uuid.
2002-03-13 15:11:29 +00:00
Alasdair Kergon
251502f9a1
Move is_empty_dir to lvm-file
2002-03-11 22:23:24 +00:00
Joe Thornber
bb13858120
o Actually check that the vg directory is empty rather than speculatively
...
rmdiring it. Work around for devfs bug.
2002-03-11 20:43:58 +00:00
Joe Thornber
2ec94d4daf
o This should complete the dev_manager alg. Please could people now
...
report any activation oddities they see.
2002-03-11 20:36:04 +00:00
Alasdair Kergon
41967a0276
lv_info replaces lv_active etc.
2002-03-11 19:02:28 +00:00
Alasdair Kergon
be326a2f1b
o activate/reactivate merge
...
o unlocking macro
2002-03-11 15:08:39 +00:00
Joe Thornber
323a167b49
o dm->active_list now filled in, ATM this is based on the layer name rather
...
than the uuid.
2002-03-11 11:27:48 +00:00
Joe Thornber
fd6932b18b
o Comment out some new code that was preventing pjc activating
...
snapshots. This will go back in when the active_list is working.
2002-03-11 10:38:16 +00:00
Joe Thornber
5295f36cb4
o knock out the offset for origin targets.
2002-03-08 10:45:01 +00:00
Joe Thornber
4526747997
o Add active_list to dev_manager
...
o Origin layer is only added to snapshots if a snapshot is in the
active_list.
2002-03-08 10:41:48 +00:00
Joe Thornber
11d2da4036
o First cut at dev scanning.
...
o Split up _expand_lv
2002-03-07 17:37:38 +00:00
Joe Thornber
0fe3a2c512
o Add comment describing what we're aiming for with dev_manager.
...
o Remove dev_manager_reactivate, since it'll be the same as activate.
o Merge the mark, visible and dirty fields into the same flags field.
2002-03-07 16:48:46 +00:00
Joe Thornber
eea1d6932c
o Top level device is now just called <vg>-<lv> (there's no 'top'
...
layer appended).
o Got rid of the unused layer->type field and enum.
2002-03-07 15:29:31 +00:00
Alasdair Kergon
15c325f06a
o Use new LCK_HOLD flag to indicate whether lock should be held on return
...
from lock_vol() - otherwise it now attempts to acquire the lock and then
immediately releases it.
o Extend the id field in struct logical_volume to hold VG uuid + LV uuid
for format1. This unique lvid can be used directly when calling lock_vol().
o Add the VG uuid to vgcache to make VG uuid lookups possible. (Another
step towards using them instead of VG names internally.)
2002-03-05 20:03:09 +00:00
Alasdair Kergon
2731508b34
Fix activation for VG with more than one LV.
2002-03-04 18:50:34 +00:00
Joe Thornber
fdec53fb9c
o Add a line to lvdisplay to say if the volume is a snapshot.
2002-03-04 15:12:30 +00:00
Joe Thornber
d30321a6cf
o Bad dependency, meant the origin was always getting activated.
2002-03-04 15:10:30 +00:00
Alasdair Kergon
3bf898526a
Remove unused fns.
2002-03-04 14:27:25 +00:00
Joe Thornber
3a84c18bdd
o I was tearing down device bottom-up instead of top down. Which
...
is why lvremove of snapshots wasn't working.
2002-03-04 14:26:43 +00:00
Joe Thornber
9db196e6c5
o Break creating a snapshot down into:
...
i) create cow
ii) activate cow
iii) zero cow
iv) deactivate
v) add snapshot info
vi) reactivate
2002-03-04 13:46:37 +00:00
Alasdair Kergon
8c013da41f
More use of LV locking.
2002-03-01 19:08:11 +00:00
Joe Thornber
6ed0234393
o point snapshots at origin:real rather than origin:top, and *ping*
...
snapshots work.
2002-03-01 09:07:00 +00:00
Alasdair Kergon
f4cbeaf0ac
o Lock mechanism for LV activation
...
o #defines for common lock flag combinations
o Try out hyphens instead of colons in device-mapper names - does this
make messages containing filenames easier to read?
2002-02-27 12:26:41 +00:00
Joe Thornber
841da63e77
o Format1 wasn't recording the snapshot chunk size properly
...
o Activation of snapshots now works - though the resulting device
doesn't (pjc ?)
o text format wasn't setting vg->cmd.
2002-02-26 16:48:52 +00:00
Alasdair Kergon
6761081ab4
Clearer link pathname display.
2002-02-26 16:08:22 +00:00
Joe Thornber
349f09e401
o _build_name was allocating 1 byte too few, which meant the
...
terminating zero was falling off at some later point.
o Don't try and iterate from a deleted node in _prune_unmarked.
2002-02-26 14:44:13 +00:00
Joe Thornber
de6c918392
o Removed old files
...
o rewrote activate.c to use dev-manager, I'm sure these two will merge
at some point.
o Rename is broken ATM
o dev-manager puts the calls through to fs.c for layers that have the
'visible' flag set.
2002-02-26 11:49:17 +00:00
Joe Thornber
c15334eb4e
o More dev_manager fns.
2002-02-25 16:53:12 +00:00
Joe Thornber
999e584511
o In go the populate functions.
2002-02-25 15:19:53 +00:00
Joe Thornber
fc28b60f9c
o More dev_manager work.
2002-02-25 14:46:57 +00:00
Alasdair Kergon
413cc9189e
Begin conversion so LV id is passed to activation unit instead of
...
struct logical_volume.
2002-02-25 12:56:16 +00:00
Joe Thornber
ca73e23fd0
o Sync with cvs, dev_manager still needs to be wired into activate.c
2002-02-25 12:02:33 +00:00
Joe Thornber
7b9e789f9c
o Remove the vg argument from find_cow
2002-02-25 11:55:39 +00:00
Joe Thornber
b00094bdeb
o hash_iterate -> hash_iter
2002-02-25 11:54:15 +00:00
Joe Thornber
7e682f4f93
o Added a macro called hash_iterate, that is similar to list_iterate
...
o Renamed hash_iterate function, hash_iter.
2002-02-25 11:52:58 +00:00
Alasdair Kergon
bb403f3361
indent
2002-02-24 22:31:55 +00:00
Patrick Caulfield
6f3a8d5bd3
Fill in format_text functions.
...
Sort of seems to work.
2002-02-22 11:44:56 +00:00
Alasdair Kergon
187cf4c97d
o Convert lv->id back to lv_number when writing back to disk
...
o Use first unused lv_number when creating new LV
o Use lv_number for refs to snapshots
o Update persistent minor logic after the lvcreate restructure
o Reset all parameters before use in lvcreate.
2002-02-21 19:04:37 +00:00
Heinz Mauelshagen
257ec146b2
Avoid ambigous volume_group argument in vg_add_snapshot()
2002-02-21 18:31:48 +00:00
Alasdair Kergon
b5ed53273a
Generate LV uuid from lv_number when reading in LVs.
2002-02-21 15:26:44 +00:00
Joe Thornber
e680d3190f
o typo
2002-02-21 10:17:01 +00:00
Joe Thornber
0e32e054df
o add find_cow function.
2002-02-21 10:16:33 +00:00
Alasdair Kergon
cc8b2cd706
Try out using LV locking for reactivation.
2002-02-20 21:30:27 +00:00
Alasdair Kergon
14a81c5a03
Remove lv_update_write_access: use lv_reactivate directly now instead.
2002-02-20 21:28:22 +00:00
Alasdair Kergon
078cab224b
Suppress meaningless <backtrace> msg on screen (no prog/line number given)
2002-02-20 21:26:40 +00:00
Alasdair Kergon
bf1b684e2e
lvd->lv_access & LV_SNAPSHOT not lvd->lv_status
2002-02-20 21:24:45 +00:00
Alasdair Kergon
b6afcf6458
Remove VG arg from lv_is_cow() and lv_is_origin() - use lv->vg instead.
2002-02-20 19:04:55 +00:00
Alasdair Kergon
a45f546fe0
o Use 'pvcreate --setphysicalvolumesize' with no short form (instead of -s)
...
and add severe warning if it's used to make a device seem bigger than
it really is. This is not an option people should be using as it
breaks metadata integrity.
o Use uint64_t throughout (rather than unsigned long long)
o Convert a few messages that contain pathnames into the more common form:
pathname: message
2002-02-20 18:29:30 +00:00
Joe Thornber
5986ec940f
o Removed the -z (suspend) option from the tools
...
o New function: int lv_setup_cow_store(struct logical_volume *lv)
This zeroes the start of the cow device.
o Made lvcreate call above fn.
2002-02-18 15:52:48 +00:00
Joe Thornber
d7783cc8b8
o small bug in the format1 export code for snapshots.
...
o tidied newlines in the snapshot section of format text.
2002-02-18 11:25:43 +00:00
Heinz Mauelshagen
e1d93eb457
Second path on "pvcreate -s"
2002-02-15 14:33:59 +00:00
Heinz Mauelshagen
f48d3bcbd0
First cut on "pvcreate -s"
2002-02-15 01:26:16 +00:00
Joe Thornber
e56598a84d
o Initialise the snapshot list properly in vgcreate.
2002-02-14 15:06:24 +00:00
Joe Thornber
0d3075f5ba
o Define _read_uint32
2002-02-14 14:52:21 +00:00
Heinz Mauelshagen
69019d6e9e
test printf removed
2002-02-13 21:30:51 +00:00
Heinz Mauelshagen
df89b641bb
LV maximum size limit of 2TB ensured in _lv_setup()
2002-02-13 21:28:56 +00:00
Heinz Mauelshagen
00a9d5417a
spaces
2002-02-13 21:28:15 +00:00
Heinz Mauelshagen
e5e5d6decd
> 2TB numbers in vgdisplay_full
2002-02-13 20:21:13 +00:00
Joe Thornber
294ddff8a6
o snapshot support for the text format.
...
The logical_volumes, and snapshots sections of the text format are now
optional.
2002-02-13 13:29:16 +00:00
Joe Thornber
0a9f8bcf97
o First pass at format1 snapshot support.
2002-02-13 11:43:29 +00:00
Joe Thornber
7d68b08028
o First changes to add snapshot support.
...
I'm taking a different route from LVM1 here in that snapshots are a
seperate entity from the logical volumes, I think of them as an
application of an LV (or two lvs rather). As such there is a list of
snapshots held against the vg, and there is *not* a SNAPSHOT, or
SHAPSHOT_ORG flag in lv->status.
2002-02-12 16:31:31 +00:00
Patrick Caulfield
f09d2b350f
use portable <inttypes.h> macros for printing.
2002-02-12 14:12:13 +00:00
Joe Thornber
fdc7af232a
o Turn the device_create_* functions into device_populate_*, they only
...
fill in an already created dm_task. This allows common code, such
as minor number selection, and read_only to be lifted.
2002-02-12 11:15:45 +00:00
Alasdair Kergon
60274aba6e
Preparation for an LVM2 liblvm - pass cmd_context into each tool and
...
link some globals that the tools need into that structure.
2002-02-11 20:50:53 +00:00
Alasdair Kergon
8d6a8717bb
Now that most of the usage of 'stack' only occurs when there's an error,
...
don't suppress it from the screen output any longer.
2002-02-11 18:25:18 +00:00
Alasdair Kergon
33e8b747ac
dbg_free(tc->desc)
2002-02-11 18:21:54 +00:00
Alasdair Kergon
a62ee8ad27
Document return codes.
2002-02-11 17:42:02 +00:00
Joe Thornber
6d52fb460b
o Split activate.c into a high level (remaining in activate.c) and low level (ll-activate.[hc]) API.
...
o Creation of a device from an lv now lives in activate-lv.c
2002-02-11 15:48:34 +00:00
Alasdair Kergon
7d0e6e800e
o Support locking with local lock files
...
o Disable control-c during updates (except if blocked waiting for a lock)
2002-02-11 15:42:34 +00:00
Joe Thornber
03888774a5
o Added functions to display what's in the archive.
...
o For now vgcfgrestore -l <vg> displays this list.
A bit hacky, but it'll get better.
2002-02-11 11:43:17 +00:00
Alasdair Kergon
d1ad45cc41
Locking prototypes.
2002-02-08 14:30:37 +00:00
Alasdair Kergon
075ffca52a
move defaults.h
2002-02-08 14:28:52 +00:00
Joe Thornber
59d6420b9a
o I decided that the archive_format shouldn't really be a format at
...
all since it only supports vg_write. It has been replaced with:
int archive_vg(struct volume_group *vg,
const char *dir,
const char *desc,
uint32_t retain_days,
uint32_t min_archive);
which is now called directly by tools/archive.c
2002-02-08 11:58:18 +00:00
Joe Thornber
e74999af51
o Add cmd_line field to struct cmd_context
...
o Text format now has a description and time field at the top level.
o archiving and backup set the description appropriately. eg,
for an archive:
description = "Created *before* executing 'lvextend test_vg/lvol0 -l +1'."
creation_time = 1013166332
for a backup:
description = "Created *after* executing 'lvextend test_vg/lvol0 -l +1'."
creation_time = 1013166332
This is preparing the way for a simple vgcfgundo command.
2002-02-08 11:13:47 +00:00
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