Generalise --virtualoriginsize to --virtualsize.
Version 2.02.48 -
===============================
+ Make --snapshot optional with lvcreate --virtualsize.
+ Generalise --virtualoriginsize to --virtualsize.
Skip virtual origins in process_each_lv_in_vg().
Fix counting of virtual origin LVs in vg_validate.
Attempt to load dm-zero module if zero target needed but not present.
\-L|\-\-size LogicalVolumeSize[kKmMgGtT]}
[\-c|\-\-chunksize ChunkSize]
\-n|\-\-name SnapshotLogicalVolumeName
-\-s|\-\-snapshot
-[OriginalLogicalVolumePath | VolumeGroupName \-\-virtualoriginsize VirtualOriginSize]
+{{\-s|\-\-snapshot}
+OriginalLogicalVolumePath |
+[\-s|\-\-snapshot]
+VolumeGroupName \-\-virtualsize VirtualSize}
.SH DESCRIPTION
lvcreate creates a new logical volume in a volume group ( see
.B vgcreate(8), vgchange(8)
rate at which the snapshot data is growing so you can avoid running out
of space.
.TP
-.I \-\-virtualoriginsize VirtualOriginSize
-In conjunction with \-\-snapshot, create a sparse device of the given size
-(in MB by default). Anything written to the device will be returned when
-reading from it. Reading from other areas of the device will return
-blocks of zeros. It is implemented by creating a hidden virtual device of the
+.I \-\-virtualsize VirtualSize
+Create a sparse device of the given size (in MB by default) using a snapshot.
+Anything written to the device will be returned when reading from it.
+Reading from other areas of the device will return blocks of zeros.
+It is implemented by creating a hidden virtual device of the
requested size using the zero target. A suffix of _vorigin is used for
this device.
.TP
arg(rows_ARG, '\0', "rows", NULL, 0)
arg(dataalignment_ARG, '\0', "dataalignment", size_kb_arg, 0)
arg(virtualoriginsize_ARG, '\0', "virtualoriginsize", size_mb_arg, 0)
+arg(virtualsize_ARG, '\0', "virtualsize", size_mb_arg, 0)
/* Allow some variations */
arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
"\t[--version]\n"
"\tVolumeGroupName [PhysicalVolumePath...]\n\n"
- "lvcreate -s|--snapshot\n"
+ "lvcreate \n"
+ "\t{ {-s|--snapshot} OriginalLogicalVolume[Path] |\n"
+ "\t [-s|--snapshot] VolumeGroupName[Path] --virtualsize VirtualSize}\n"
"\t[-c|--chunksize]\n"
"\t[-A|--autobackup {y|n}]\n"
"\t[--addtag Tag]\n"
"\t[-t|--test]\n"
"\t[-v|--verbose]\n"
"\t[--version]\n"
- "\t[OriginalLogicalVolume[Path] |\n"
- "\t VolumeGroupName[Path] --virtualoriginsize VirtualOriginSize]]\n"
+
"\t[PhysicalVolumePath...]\n\n",
addtag_ARG, alloc_ARG, autobackup_ARG, chunksize_ARG, contiguous_ARG,
corelog_ARG, extents_ARG, major_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG,
name_ARG, nosync_ARG, permission_ARG, persistent_ARG, readahead_ARG,
regionsize_ARG, size_ARG, snapshot_ARG, stripes_ARG, stripesize_ARG,
- test_ARG, type_ARG, virtualoriginsize_ARG, zero_ARG)
+ test_ARG, type_ARG, virtualoriginsize_ARG, virtualsize_ARG, zero_ARG)
xx(lvdisplay,
"Display information about a logical volume",
if (arg_count(cmd, name_ARG))
lp->lv_name = arg_value(cmd, name_ARG);
- if (lp->snapshot && !arg_count(cmd, virtualoriginsize_ARG)) {
+ if (lp->snapshot && !arg_count(cmd, virtualsize_ARG)) {
if (!argc) {
log_err("Please specify a logical volume to act as "
"the snapshot origin.");
}
/* Size returned in kilobyte units; held in sectors */
- if (arg_count(cmd, virtualoriginsize_ARG)) {
- if (arg_sign_value(cmd, virtualoriginsize_ARG, 0) == SIGN_MINUS) {
+ if (arg_count(cmd, virtualsize_ARG)) {
+ if (arg_sign_value(cmd, virtualsize_ARG, 0) == SIGN_MINUS) {
log_error("Negative virtual origin size is invalid");
return 0;
}
- lp->voriginsize = arg_uint64_value(cmd, virtualoriginsize_ARG,
+ lp->voriginsize = arg_uint64_value(cmd, virtualsize_ARG,
UINT64_C(0));
if (!lp->voriginsize) {
log_error("Virtual origin size may not be zero");
if (arg_count(cmd, stripes_ARG) && lp->stripes == 1)
log_print("Redundant stripes argument: default is 1");
- if (arg_count(cmd, snapshot_ARG) || seg_is_snapshot(lp))
+ if (arg_count(cmd, snapshot_ARG) || seg_is_snapshot(lp) ||
+ arg_count(cmd, virtualsize_ARG))
lp->snapshot = 1;
lp->mirrors = 1;
log_error("-c is only available with snapshots");
return 0;
}
- if (arg_count(cmd, virtualoriginsize_ARG)) {
- log_error("--virtualoriginsize is only available with snapshots");
- return 0;
- }
}
if (lp->mirrors > 1) {
/* Must zero cow */
status |= LVM_WRITE;
- if (arg_count(cmd, virtualoriginsize_ARG))
+ if (arg_count(cmd, virtualsize_ARG))
origin_active = 1;
else {
}
if (lv_is_virtual_origin(org)) {
log_error("Can't share virtual origins. "
- "Use --virtualoriginsize.");
+ "Use --virtualsize.");
return 0;
}
if (lv_is_cow(org)) {
/* Handle synonyms */
if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) ||
!_merge_synonym(cmd, allocation_ARG, allocatable_ARG) ||
- !_merge_synonym(cmd, allocation_ARG, resizeable_ARG))
+ !_merge_synonym(cmd, allocation_ARG, resizeable_ARG) ||
+ !_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG))
return EINVALID_CMD_LINE;
/* Zero indicates success */