Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=277dd0aa7a901369…
Commit: 277dd0aa7a9013697ae99164900d8d8ec12a2850
Parent: ded9452174664b7e204f5ce266bbd5c770714474
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 6 14:55:24 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:23:55 2015 +0200
tests: check devices with prefix aren't in use
Avoid running tests, when prefix already exist in the system.
As prefix just uses PID number, we may hit a case for long
running tests, where devices from some previous runs were not
properly cleared away - detect this and fail early.
(Such machine should be inspected and fixed).
---
test/lib/inittest.sh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index a5eeb57..4ed8d20 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -29,6 +29,9 @@ TESTOLDPWD=$(pwd)
COMMON_PREFIX="LVMTEST"
PREFIX="${COMMON_PREFIX}$$"
+# Check we are not conflickting with some exiting setup
+dmsetup table | not grep "$PREFIX" || die "DM table already has devices with prefix $PREFIX!"
+
if test -z "$LVM_TEST_DIR"; then LVM_TEST_DIR=$TMPDIR; fi
TESTDIR=$(mkdtemp "${LVM_TEST_DIR:-/tmp}" "$PREFIX.XXXXXXXXXX") || \
die "failed to create temporary directory in ${LVM_TEST_DIR:-$TESTOLDPWD}"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ded9452174664b7e…
Commit: ded9452174664b7e204f5ce266bbd5c770714474
Parent: 4b1cadbd87a0814a46b36b07cfe94eda7baacb28
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 6 14:55:09 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:23:55 2015 +0200
man: lvcreate continue
Finish remaing bits of updating pages for better rendering
with -Thtml, -Tps.
---
man/lvchange.8.in | 3 +
man/lvcreate.8.in | 277 ++++++++++++++++++++++++++++++----------------------
man/lvm.8.in | 1 +
3 files changed, 164 insertions(+), 117 deletions(-)
diff --git a/man/lvchange.8.in b/man/lvchange.8.in
index 62bdca1..8ae17a0 100644
--- a/man/lvchange.8.in
+++ b/man/lvchange.8.in
@@ -431,7 +431,10 @@ Suppress locking failure messages.
Changes the permission on volume lvol1 in volume group vg00 to be read-only:
.sp
.B lvchange \-pr vg00/lvol1
+.
.SH SEE ALSO
+.
+.nh
.BR lvm (8),
.BR lvmetad (8),
.BR lvs (8),
diff --git a/man/lvcreate.8.in b/man/lvcreate.8.in
index 8a364c4..2ce39dd 100644
--- a/man/lvcreate.8.in
+++ b/man/lvcreate.8.in
@@ -1,7 +1,22 @@
.TH LVCREATE 8 "LVM TOOLS #VERSION#" "Sistina Software UK" \" -*- nroff -*-
+.
+.\" Use 1st. parameter with \% to fix 'man2html' rendeing on same line!
+.de SIZE_G
+. IR \\$1 \c
+. RB [ b | B | s | S | k | K | m | M | g | G ]
+..
+.de SIZE_E
+. IR \\$1 \c
+. RB [ b | B | s | S | k | K | m | M | \c
+. BR g | G | t | T | p | P | e | E ]
+..
+.
.SH NAME
+.
lvcreate \- create a logical volume in an existing volume group
+.
.SH SYNOPSIS
+.
.ad l
.B lvcreate
.RB [ \-a | \-\-activate
@@ -17,7 +32,7 @@ lvcreate \- create a logical volume in an existing volume group
.RB { passthrough | writeback | writethrough }]
.RB [ \-\-cachepolicy
.IR policy ]
-.RB [ \-\-cachepool
+.RB \%[ \-\-cachepool
.IR CachePoolLogicalVolume ]
.RB [ \-\-cachesettings
.IR key \fB= value ]
@@ -25,7 +40,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR ChunkSize ]
.RB [ \-\-commandprofile
.IR ProfileName ]
-.RB [ \-C | \-\-contiguous
+.RB \%[ \-C | \-\-contiguous
.RB { y | n }]
.RB [ \-d | \-\-debug ]
.RB [ \-\-discards
@@ -78,7 +93,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR Rate ]
.RB [ \-r | \-\-readahead
.RB { \fIReadAheadSectors | auto | none }]
-.RB [ \-k | \-\-setactivationskip
+.RB \%[ \-k | \-\-setactivationskip
.RB { y | n }]
.RB [ \-s | \-\-snapshot ]
.RB [ \-V | \-\-virtualsize
@@ -94,9 +109,10 @@ lvcreate \- create a logical volume in an existing volume group
.RB { y | n }]
.RB [ \-Z | \-\-zero
.RB { y | n }]
-.RI [ VolumeGroup [ \fB/ { ExternalOrigin |\: Origin |
-.IR Pool } LogicalVolumeName ]
-.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]
+.RI [ VolumeGroup \c
+.RB [ / \c
+.RI { ExternalOrigin | Origin | Pool } LogicalVolumeName
+.RI [ PhysicalVolumePath [ \fB: \fIPE \fR[ \fB\- PE ]]...]]
.LP
.B lvcreate
.RB [ \-l | \-\-extents
@@ -107,7 +123,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR LogicalVolumeSize ]
.RB [ \-c | \-\-chunksize
.IR ChunkSize ]
-.RB [ \-\-commandprofile
+.RB \%[ \-\-commandprofile
.IR Profile\%Name ]
.RB [ \-\-noudevsync ]
.RB [ \-\-ignoremonitoring ]
@@ -118,11 +134,13 @@ lvcreate \- create a logical volume in an existing volume group
.RB [ \-n | \-\-name
.IR SnapshotLogicalVolume ]
.BR \-s | \-\-snapshot | \-H | \-\-cache
-.RI \%{[ VolumeGroup \fB/ ] OriginalLogicalVolume
-.BR \-V | \-\-virtualsize
-.IR VirtualSize }
+.RI \%{[ VolumeGroup \fB/\fP] OriginalLogicalVolume
+.RB \%[ \-V | \-\-virtualsize
+.IR VirtualSize ]}
.ad b
+.
.SH DESCRIPTION
+.
lvcreate creates a new logical volume in a volume group (see
.BR vgcreate "(8), " vgchange (8))
by allocating logical extents from the free physical extent pool
@@ -151,40 +169,41 @@ for common options.
.br
Controls the availability of the Logical Volumes for immediate use after
the command finishes running.
-By default, new Logical Volumes are activated (\fB\-a\fIy\fR).
-If it is possible technically, \fB\-a\fIn\fR will leave the new Logical
+By default, new Logical Volumes are activated (\fB\-ay\fP).
+If it is possible technically, \fB\-an\fP will leave the new Logical
Volume inactive. But for example, snapshots of active origin can only be
-created in the active state so \fB\-a\fIn\fR cannot be used with
-\fB-\-type\fP \fIsnapshot\fP. This does not apply to thin volume snapshots,
+created in the active state so \fB\-an\fP cannot be used with
+\fB-\-type snapshot\fP. This does not apply to thin volume snapshots,
which are by default created with flag to skip their activation
-(\fB-k\fP\fIy\fP).
-Normally the \fB\-\-zero\fP \fIn\fP argument has to be supplied too because
+(\fB-ky\fP).
+Normally the \fB\-\-zero n\fP argument has to be supplied too because
zeroing (the default behaviour) also requires activation.
-If autoactivation option is used (\fB\-a\fIay\fR), the logical volume is
+If autoactivation option is used (\fB\-aay\fP), the logical volume is
activated only if it matches an item in the
-.IR activation / auto_activation_volume_list
+\fBactivation/auto_activation_volume_list\fP
set in \fBlvm.conf\fP(5).
-For autoactivated logical volumes, \fB\-\-zero\fP \fIn\fP and
-\fB\-\-wipesignatures\fP \fIn\fP is always assumed and it can't
+For autoactivated logical volumes, \fB\-\-zero n\fP and
+\fB\-\-wipesignatures n\fP is always assumed and it can't
be overridden. If the clustered locking is enabled,
-\fB\-a\fIey\fR will activate exclusively on one node and
-.IR \fB\-a { a | l } y
+\fB\-aey\fP will activate exclusively on one node and
+.BR \-a { a | l } y
will activate only on the local node.
.
.HP
.BR \-H | \-\-cache
.br
-Creates cache or cache pool logical volume or both.
-Specifying the optional argument \fB\-\-size\fP will cause the creation of
-the cache logical volume.
+Creates cache or cache pool logical volume.
+.\" or both.
+Specifying the optional argument \fB\-\-extents\fP or \fB\-\-size\fP
+will cause the creation of the cache logical volume.
.\" Specifying the optional argument \fB\-\-pooldatasize\fP will cause
.\" the creation of the cache pool logical volume.
-Specifying both arguments will cause the creation of cache with its
-cache pool volume.
+.\" Specifying both arguments will cause the creation of cache with its
+.\" cache pool volume.
When the Volume group name is specified together with existing logical volume
-name which is NOT a cache pool name, such volume is treaded
-as cache origin volume and cache pool is created. In this case
-the \fB\-\-size\fP is used to specify size of cache pool volume.
+name which is NOT a cache pool name, such volume is treated
+as cache origin volume and cache pool is created. In this case the
+\fB\-\-extents\fP or \fB\-\-size\fP is used to specify size of cache pool volume.
See \fBlvmcache\fP(7) for more info about caching support.
Note that the cache segment type requires a dm-cache kernel module version
1.3.0 or greater.
@@ -228,19 +247,18 @@ and removes it from the list of settings stored in lvm2 metadata.
.
.HP
.BR \-c | \-\-chunksize
-.IR ChunkSize \c
-.RB [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%ChunkSize
.br
Gives the size of chunk for snapshot, cache pool and thin pool logical volumes.
Default unit is in kilobytes.
.br
-For \fIsnapshots\fP the value must be power of 2 between 4KiB and 512KiB
+For snapshots the value must be power of 2 between 4KiB and 512KiB
and the default value is 4KiB.
.br
-For \fIcache pools\fP the value must a multiple of 32KiB
+For cache pools the value must a multiple of 32KiB
between 32KiB and 1GiB. The default is 64KiB.
.br
-For \fIthin pools\fP the value must be a multiple of 64KiB
+For thin pools the value must be a multiple of 64KiB
between 64KiB and 1GiB.
Default value starts with 64KiB and grows up to
fit the pool metadata size within 128MiB,
@@ -279,7 +297,7 @@ Default is \fBpassdown\fP.
Configures thin pool behaviour when data space is exhausted.
Default is \fBn\fPo.
Device will queue I/O operations until target timeout
-(see dm-thin-pool kernel module option \fIno_space_timeout\fP)
+(see dm-thin-pool kernel module option \fPno_space_timeout\fP)
expires. Thus configured system has a time to i.e. extend
the size of thin pool data device.
When set to \fBy\fPes, the I/O operation is immeditelly errored.
@@ -313,7 +331,7 @@ PhysicalVolume(s) with the suffix \fB%PVS\fP, or (for a snapshot) as a
percentage of the total space in the Origin Logical Volume with the
suffix \fB%ORIGIN\fP (i.e. \fB100%ORIGIN\fP provides space for the whole origin).
When expressed as a percentage, the number is treated
-as an approximate upper limit for the total number of physical extents
+as an approximate upper limit for the number of physical extents
to be allocated (including extents used by any mirrors, for example).
.
.HP
@@ -330,7 +348,7 @@ numbers are dynamically assigned.
.BR \-\-metadataprofile
.IR ProfileName
.br
-Uses and attaches the ProfileName configuration profile to the logical
+Uses and attaches the \fIProfileName\fP configuration profile to the logical
volume metadata. Whenever the logical volume is processed next time,
the profile is automatically applied. If the volume group has another
profile attached, the logical volume profile is preferred.
@@ -448,7 +466,7 @@ Otherwise it is \fBn\fPo.
.
.HP
.BR \-\-poolmetadatasize
-.BR \fIMetadataVolumeSize [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%MetadataVolumeSize
.br
Sets the size of pool's metadata logical volume.
Supported values are in range between 2MiB and 16GiB for thin pool,
@@ -469,7 +487,7 @@ Default is \fBy\fPes.
.
.HP
.BR \-\- [ raid ] maxrecoveryrate
-.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%Rate
.br
Sets the maximum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
@@ -478,7 +496,7 @@ recovery rate to 0 means it will be unbounded.
.
.HP
.BR \-\- [ raid ] minrecoveryrate
-.BR \fIRate [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%Rate
.br
Sets the minimum recovery rate for a RAID logical volume. \fIRate\fP
is specified as an amount per second for each device in the array.
@@ -498,7 +516,7 @@ a suitable value automatically.
.
.HP
.BR \-R | \-\-regionsize
-.BR \fIMirrorLogRegionSize [ b | B | s | S | k | K | m | M | g | G ]
+.SIZE_G \%MirrorLogRegionSize
.br
A mirror is divided into regions of this size (in MiB), and the mirror log
uses this granularity to track which regions are in sync.
@@ -522,9 +540,7 @@ where the state of the flag is reported within \fBlv_attr\fP bits.
.
.HP
.BR \-L | \-\-size
-.BR \fILogicalVolumeSize [ b | B | s | S | k | K | m | M | \c
-.BR g | G | t | T | p | P | e | E ]
-.\" man2html cannot handle all those changes in 1 line
+.SIZE_E \%LogicalVolumeSize
.br
Gives the size to allocate for the new logical volume.
A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
@@ -533,8 +549,11 @@ A size suffix of \fBB\fP for bytes, \fBS\fP for sectors as 512 bytes,
or \fBE\fP for exabytes is optional.
.br
Default unit is megabytes.
-.TP
-.IR \fB\-s ", " \fB\-\-snapshot " " OriginalLogicalVolume { Name | Path }
+.
+.HP
+.BR \-s | \fB\-\-snapshot
+.IR OriginalLogicalVolume { Name | Path }
+.br
Creates a snapshot logical volume (or snapshot) for an existing, so called
original logical volume (or origin).
Snapshots provide a 'frozen image' of the contents of the origin
@@ -567,29 +586,35 @@ External origin volume can be used/shared for many thin volumes
even from different thin pools. See
.BR lvconvert (8)
for online conversion to thin volumes with external origin.
-.TP
-.BR \-i ", " \-\-stripes " " \fIStripes
+.
+.HP
+.BR \-i | \-\-stripes
+.IR Stripes
+.br
Gives the number of stripes.
This is equal to the number of physical volumes to scatter
the logical volume. When creating a RAID 4/5/6 logical volume,
the extra devices which are necessary for parity are
-internally accounted for. Specifying
-.BI \-i 3
+internally accounted for. Specifying \fB\-i 3\fP
would use 3 devices for striped logical volumes,
4 devices for RAID 4/5, and 5 devices for RAID 6. Alternatively,
RAID 4/5/6 will stripe across all PVs in the volume group or
-all of the PVs specified if the
-.B \-i
+all of the PVs specified if the \fB\-i\fP
argument is omitted.
-.TP
-.BR \-I ", " \-\-stripesize " " \fIStripeSize
+.
+.HP
+.BR \-I | \-\-stripesize
+.IR StripeSize
+.br
Gives the number of kilobytes for the granularity of the stripes.
.br
StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
For metadata in LVM2 format, the stripe size may be a larger
power of 2 but must not exceed the physical extent size.
-.TP
-.IR \fB\-T ", " \fB\-\-thin
+.
+.HP
+.BR \-T | \-\-thin
+.br
Creates thin pool or thin logical volume or both.
Specifying the optional argument \fB\-\-size\fP or \fB\-\-extents\fP
will cause the creation of the thin pool logical volume.
@@ -600,81 +625,93 @@ thin pool and thin volume using this pool.
See \fBlvmthin\fP(7) for more info about thin provisioning support.
Thin provisioning requires device mapper kernel driver
from kernel 3.2 or greater.
-.TP
-.IR \fB\-\-thinpool " " ThinPoolLogicalVolume { Name | Path }
+.
+.HP
+.BR \-\-thinpool
+.IR ThinPoolLogicalVolume { Name | Path }
+.br
Specifies the name of thin pool volume name. The other way to specify pool name
is to append name to Volume group name argument.
-.TP
-.B \-\-type \fISegmentType
+.
+.HP
+.BR \-\-type
+.IR SegmentType
+.br
Creates a logical volume with the specified segment type.
Supported types are:
-.IR cache ,
-.IR cache-pool ,
-.IR error ,
-.IR linear ,
-.IR mirror,
-.IR raid1 ,
-.IR raid4 ,
-.IR raid5_la ,
-.IR raid5_ls " (= " raid5 ),
-.IR raid5_ra ,
-.IR raid5_rs ,
-.IR raid6_nc ,
-.IR raid6_nr ,
-.IR raid6_zr " (= " raid6 ) ,
-.IR raid10 ,
-.IR snapshot ,
-.IR striped,
-.IR thin ,
-.IR thin-pool
+.BR cache ,
+.BR cache-pool ,
+.BR error ,
+.BR linear ,
+.BR mirror,
+.BR raid1 ,
+.BR raid4 ,
+.BR raid5_la ,
+.BR raid5_ls
+.RB (=
+.BR raid5 ),
+.BR raid5_ra ,
+.BR raid5_rs ,
+.BR raid6_nc ,
+.BR raid6_nr ,
+.BR raid6_zr
+.RB (=
+.BR raid6 ),
+.BR raid10 ,
+.BR snapshot ,
+.BR striped,
+.BR thin ,
+.BR thin-pool
or
-.IR zero .
+.BR zero .
Segment type may have a commandline switch alias that will
enable its use.
When the type is not explicitly specified an implicit type
is selected from combination of options:
-.BR \-H | \-\-cache | \-\-cachepool " (" \fIcache
-or
-.IR cachepool ),
-.BR \-T | \-\-thin | \-\-thinpool " (" \fIthin
-or
-.IR thinpool ),
-.BR \-m | \-\-mirrors " (" \fIraid1
-or
-.IR mirror ),
-.BR \-s | \-\-snapshot | \-V | \-\-virtualsize " (" \fIsnapshot
-or
-.IR thin ),
-.BR \-i | \-\-stripes " (" \fIstriped ).
-Default type is \fIlinear\fP.
-.TP
-.BR \-V ", " \-\-virtualsize " " \fIVirtualSize [ \fIbBsSkKmMgGtTpPeE ]
+.BR \-H | \-\-cache | \-\-cachepool
+(cache or cachepool),
+.BR \-T | \-\-thin | \-\-thinpool
+(thin or thinpool),
+.BR \-m | \-\-mirrors
+(raid1 or mirror),
+.BR \-s | \-\-snapshot | \-V | \-\-virtualsize
+(snapshot or thin),
+.BR \-i | \-\-stripes
+(striped).
+Default segment type is \fBlinear\fP.
+.
+.HP
+.BR \-V | \-\-virtualsize
+.SIZE_E \%VirtualSize
+.br
Creates a thinly provisioned device or a sparse device of the given size (in MiB by default).
See
.BR lvm.conf (5)
-settings
-.IR global / sparse_segtype_default
+settings \fBglobal/sparse_segtype_default\fP
to configure default sparse segment type.
See \fBlvmthin\fP(7) for more info about thin provisioning support.
Anything written to a sparse snapshot will be returned when reading from it.
Reading from other areas of the device will return blocks of zeros.
-Virtual snapshot 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. Note: using sparse snapshots is not efficient for larger
+Virtual snapshot (sparse snapshot) 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.
+Note: using sparse snapshots is not efficient for larger
device sizes (GiB), thin provisioning should be used for this case.
-.TP
-.BR \-W ", " \-\-wipesignatures " {" \fIy | \fIn }
+.
+.HP
+.BR \-W | \-\-wipesignatures
+.RB { y | n }
+.br
Controls wiping of detected signatures on newly created Logical Volume.
If this option is not specified, then by default signature wiping is done
-each time the zeroing (\fB\-Z\fP/\fB\-\-zero\fP) is done. This default behaviour
-can be controlled by
-.IR allocation / wipe_signatures_when_zeroing_new_lvs
+each time the zeroing (
+.BR \-Z | \-\-zero
+) is done. This default behaviour
+can be controlled by \fB\%allocation/wipe_signatures_when_zeroing_new_lvs\fP
setting found in
.BR lvm.conf (5).
.br
-If blkid wiping is used
-.IR allocation / use_blkid_wiping
-setting in
+If blkid wiping is used \fBallocation/use_blkid_wiping\fP setting in
.BR lvm.conf (5))
and LVM2 is compiled with blkid wiping support, then \fBblkid\fP(8) library is used
to detect the signatures (use \fBblkid \-k\fP command to list the signatures that are recognized).
@@ -682,17 +719,21 @@ Otherwise, native LVM2 code is used to detect signatures (MD RAID, swap and LUKS
signatures are detected only in this case).
.br
Logical volume is not wiped if the read only flag is set.
-.TP
-.BR \-Z ", " \-\-zero " {" \fIy | \fIn }
+.
+.HP
+.BR \-Z | \-\-zero
+.RB { y | n }
+.br
Controls zeroing of the first 4KiB of data in the new logical volume.
-Default is \fIy\fPes.
+Default is \fBy\fPes.
Snapshot COW volumes are always zeroed.
Logical volume is not zeroed if the read only flag is set.
-
.br
Warning: trying to mount an unzeroed logical volume can cause the system to
hang.
+.
.SH Examples
+.
Creates a striped logical volume with 3 stripes, a stripe size of 8KiB
and a size of 100MiB in the volume group named vg00.
The logical volume name will be chosen by lvcreate:
@@ -701,8 +742,8 @@ The logical volume name will be chosen by lvcreate:
Creates a mirror logical volume with 2 sides with a useable size of 500 MiB.
This operation would require 3 devices (or option
-.BI \-\-alloc \ anywhere
-) - two for the mirror devices and one for the disk log:
+\fB\-\-alloc \%anywhere\fP) - two for the mirror
+devices and one for the disk log:
.sp
.B lvcreate \-m1 \-L 500M vg00
@@ -794,8 +835,10 @@ volume (i.e. the origin LV), creating a cache LV.
.\" Create a 1G cached LV "lvol1" with 10M cache pool "vg00/pool".
.\" .sp
.\" .B lvcreate \-\-cache \-L 1G \-n lv \-\-pooldatasize 10M vg00/pool
-
+.
.SH SEE ALSO
+.
+.nh
.BR lvm (8),
.BR lvm.conf (5),
.BR lvmcache (7),
diff --git a/man/lvm.8.in b/man/lvm.8.in
index 8ff31ae..31f7187 100644
--- a/man/lvm.8.in
+++ b/man/lvm.8.in
@@ -757,6 +757,7 @@ directly.
.
.SH SEE ALSO
.
+.nh
.BR lvm.conf (5),
.BR lvmcache (7),
.BR lvmthin (7),
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4b1cadbd87a0814a…
Commit: 4b1cadbd87a0814a46b36b07cfe94eda7baacb28
Parent: 2506275c3b5ec7db8c76ef7fdb07d4f3083a3684
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 5 12:28:00 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 6 15:21:36 2015 +0200
man: fsadm
---
man/fsadm.8.in | 95 ++++++++++++++++++++++++++++++++++++-----------------
scripts/fsadm.sh | 4 +-
2 files changed, 66 insertions(+), 33 deletions(-)
diff --git a/man/fsadm.8.in b/man/fsadm.8.in
index 2aecd65..02431c5 100644
--- a/man/fsadm.8.in
+++ b/man/fsadm.8.in
@@ -2,72 +2,105 @@
.SH "NAME"
fsadm \(em utility to resize or check filesystem on a device
.SH SYNOPSIS
+.
+.PD 0
+.ad l
+.HP 5
.B fsadm
.RI [ options ]
-.B check
-.I device
-.sp
+.BR check
+.IR device
+.
+.HP
.B fsadm
.RI [ options ]
-.B resize
-.I device
-.RI [ new_size [ BKMGTEP ]]
-.sp
+.BR resize
+.IR device
+.RI [ new_size ]
+.PD
+.ad b
+.
.SH DESCRIPTION
+.
fsadm utility checks or resizes the filesystem on a device.
-It tries to use the same API for
-.IR ext2 ", " ext3 ", " ext4 ", " ReiserFS " and " XFS
+It tries to use the same API for
+.BR ext2 ,
+.BR ext3 ,
+.BR ext4 ,
+.BR ReiserFS
+.RB and
+.BR XFS
filesystem.
+.
.SH OPTIONS
-.TP
-.BR \-e ", " \-\-ext\-offline
+.
+.HP
+.BR \-e | \-\-ext\-offline
+.br
Unmount ext2/ext3/ext4 filesystem before doing resize.
-.TP
-.BR \-f ", " \-\-force
+.
+.HP
+.BR \-f | \-\-force
+.br
Bypass some sanity checks.
-.TP
-.BR \-h ", " \-\-help
+.
+.HP
+.BR \-h | \-\-help
+.br
Display the help text.
-.TP
-.BR \-n ", " \-\-dry\-run
+.
+.HP
+.BR \-n | \-\-dry\-run
+.br
Print commands without running them.
-.TP
-.BR \-v ", " \-\-verbose
+.
+.HP
+.BR \-v | \-\-verbose
+.br
Be more verbose.
-.TP
-.BR \-y ", " \-\-yes
+.
+.HP
+.BR \-y | \-\-yes
+.br
Answer "yes" at any prompts.
-.TP
-.I new_size
+.
+.HP
+.BR \fInew_size [ B | K | M | G | T | P | E ]
+.br
Absolute number of filesystem blocks to be in the filesystem,
or an absolute size using a suffix (in powers of 1024).
If new_size is not supplied, the whole device is used.
-
+.
.SH DIAGNOSTICS
+.
On successful completion, the status code is 0.
A status code of 2 indicates the operation was interrupted by the user.
A status code of 3 indicates the requested check operation could not be performed
-because the filesystem is mounted and does not support an online
+because the filesystem is mounted and does not support an online
.BR fsck (8).
A status code of 1 is used for other failures.
-
+.
.SH EXAMPLES
-Resize the filesystem on logical volume /dev/vg/test to 1000 megabytes.
-If /dev/vg/test contains ext2/ext3/ext4
+.
+Resize the filesystem on logical volume \fI/dev/vg/test\fP to 1000 megabytes.
+If \fI/dev/vg/test\fP contains ext2/ext3/ext4
filesystem it will be unmounted prior the resize.
All [y/n] questions will be answered 'y'.
.sp
.B fsadm \-e \-y resize /dev/vg/test 1000M
+.
.SH ENVIRONMENT VARIABLES
+.
.TP
-.B TMPDIR
-The temporary directory name for mount points. Defaults to "/tmp".
+.B "TMPDIR "
+The temporary directory name for mount points. Defaults to "\fI/tmp\fP".
.TP
.B DM_DEV_DIR
The device directory name.
-Defaults to "/dev" and must be an absolute path.
+Defaults to "\fI/dev\fP" and must be an absolute path.
.SH SEE ALSO
+.nh
.BR lvm (8),
.BR lvresize (8),
.BR lvm.conf (5),
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index f4ea796..e1aacd8 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -86,10 +86,10 @@ NL='
tool_usage() {
echo "${TOOL}: Utility to resize or check the filesystem on a device"
echo
- echo " ${TOOL} [options] check device"
+ echo " ${TOOL} [options] check <device>"
echo " - Check the filesystem on device using fsck"
echo
- echo " ${TOOL} [options] resize device [new_size[BKMGTPE]]"
+ echo " ${TOOL} [options] resize <device> [<new_size>[BKMGTPE]]"
echo " - Change the size of the filesystem on device to new_size"
echo
echo " Options:"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df59db6048a6be79…
Commit: df59db6048a6be79acf231b98fd560b11cce7c7c
Parent: b33d7586e7f629818e881e26677f4431a47d50b5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Oct 2 15:41:23 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Oct 2 15:41:23 2015 -0500
lockd: add error message for EEXIST
The EEXIST error for LV locks is unusual, and
was missing an explanatory error message.
---
lib/locking/lvmlockd.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index afbafcb..f741940 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2010,6 +2010,15 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
return 0;
}
+ if (result == -EEXIST) {
+ /*
+ * This happens if lvchange tries to modify the LV with an ex
+ * LV lock when the LV is already active with a sh LV lock.
+ */
+ log_error("LV is already locked with incompatible mode: %s/%s", vg->name, lv_name);
+ return 0;
+ }
+
if (result == -EMSGSIZE) {
/* Another host probably extended lvmlock. */
if (!refreshed++) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5e5d48348b0c7afd…
Commit: 5e5d48348b0c7afdd7a3fb56ddd6875a8b81dc68
Parent: 26da6a3e10d2b8a84326288b53c8e9a6d82a3846
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 1 11:39:07 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 1 14:23:39 2015 -0500
man lvmcache: updates for mode and policy
Correct some things, e.g. set mode and policy on
the cache lv, not the pool, lvm.conf field for
mode changed.
Add smq which was missing.
Make the sections on cache mode and cache policy
consistent in structure and style.
---
man/lvmcache.7.in | 74 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 42 insertions(+), 32 deletions(-)
diff --git a/man/lvmcache.7.in b/man/lvmcache.7.in
index 7257386..44709d1 100644
--- a/man/lvmcache.7.in
+++ b/man/lvmcache.7.in
@@ -195,6 +195,7 @@ Users who are concerned about the possibility of failures in their fast
devices that could lead to data loss might consider making their cache
pool sub-LVs redundant.
+.I Example
.nf
0. Create an origin LV we wish to cache
# lvcreate \-L 10G \-n lv1 vg /dev/slow_devs
@@ -228,14 +229,18 @@ from the cache pool back to the origin LV. This mode will increase
performance, but the loss of a device associated with the cache pool LV
can result in lost data.
-The cache mode can be specified with the --cachemode option when a cache
-pool LV is created.
+With the \-\-cachemode option, the cache mode can be set when creating a
+cache LV, or changed on an existing cache LV. The current cache mode of a
+cache LV can be displayed with the cache_mode reporting option:
+
+.B lvs \-o+cache_mode VG/CacheLV
.BR lvm.conf (5)
-.B cache_pool_cachemode
+.B allocation/cache_mode
.br
defines the default cache mode.
+.I Example
.nf
0. Create an origin LV we wish to cache (yours may already exist)
# lvcreate \-L 10G \-n lv1 vg /dev/slow
@@ -246,50 +251,55 @@ defines the default cache mode.
2. Create a cache metadata LV
# lvcreate \-L 8M \-n cache1meta vg /dev/fast
-3. Create a cache pool LV specifying cache mode "writethrough"
-# lvconvert \-\-type cache\-pool \-\-poolmetadata vg/cache1meta \\
- \-\-cachemode writethrough vg/cache1
+3. Create a cache pool LV
+# lvconvert \-\-type cache\-pool \-\-poolmetadata vg/cache1meta vg/cache1
-4. Create a cache LV by combining the cache pool LV and origin LV
-# lvconvert \-\-type cache \-\-cachepool vg/cache1 vg/lv1
+4. Create a cache LV by combining the cache pool LV and origin LV,
+ and use the writethrough cache mode.
+# lvconvert \-\-type cache \-\-cachepool vg/cache1 \\
+ \-\-cachemode writethrough vg/lv1
.fi
-The cache mode can be changed on an existing LV with the command:
-.B lvconvert --cachemode writethrough|writeback VG/CacheLV
+.SS Cache policy
+\&
-.SS Cache policy & policy settings
+The cache subsystem has additional per-LV parameters: the cache policy to
+use, and possibly tunable parameters for the cache policy. Three policies
+are currently available: "smq" is the default policy, "mq" is an older
+implementation, and "cleaner" is used to force the cache to write back
+(flush) all cached writes to the origin LV.
-\&
+The "mq" policy has a number of tunable parameters. The defaults are
+chosen to be suitable for the majority of systems, but in special
+circumstances, changing the settings can improve performance.
-The cache subsystem has an additional per-LV parameter, namely the cache policy
-to use, and possibly the tunable parameters of the said cache policy. In the
-current implementation, two policies are available, "mq" which is the default
-policy and "cleaner" which is used to force the cache to write back (flush) all
-cached writes to the origin LV. Moreover, the "mq" policy has a number of
-tunable parameters: the defaults are chosen to be suitable for the vast
-majority of systems. However, under special circumstances, changing the tunable
-settings of the cache policy can improve performance.
+With the \-\-cachepolicy and \-\-cachesettings options, the cache policy
+and settings can be set when creating a cache LV, or changed on an
+existing cache LV (both options can be used together). The current cache
+policy and settings of a cache LV can be displayed with the cache_policy
+and cache_settings reporting options:
-On an existing cache LV, the policy can be set (to "mq") and the cache settings
-can be changed using commands like these:
+.B lvs \-o+cache_policy,cache_settings VG/CacheLV
.I Example
-
.nf
-# lvchange \-\-cachepolicy mq vg/lv1
-# lvchange \-\-cachesettings \(aqmigration_threshold=2048 random_threshold=4\(aq \\
- vg/lv1
+Change the cache policy and settings of an existing cache LV.
+# lvchange \-\-cachepolicy mq \-\-cachesettings \\
+ \(aqmigration_threshold=2048 random_threshold=4\(aq vg/lv1
.fi
-Both commands can be combined, setting both cache policy and its settings
-together. Moreover, when creating a cache LV for the first time (using
-lvcreate), the \-\-cachepolicy and \-\-cachesettings parameters can be used as
-well. The current policy and the policy settings can be listed using the lvs
-command, using 'cache_policy' and 'cache_settings' fields:
+.BR lvm.conf (5)
+.B allocation/cache_policy
+.br
+defines the default cache policy.
+
+.BR lvm.conf (5)
+.B allocation/cache_settings
+.br
+defines the default cache settings.
-# lvs -o +cache_policy,cache_settings
.SS Spare metadata LV