mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
1194 lines
26 KiB
Groff
1194 lines
26 KiB
Groff
.TH LVCONVERT 8 "LVM TOOLS #VERSION#" "Red Hat, Inc" \" -*- nroff -*-
|
|
.SH NAME
|
|
lvconvert \(em change LV type and other utilities
|
|
.
|
|
.SH SYNOPSIS
|
|
|
|
.B lvconvert
|
|
.RI [ OPTION ]...
|
|
.IR VolumeGroup / LogicalVolume
|
|
|
|
OPTIONS:
|
|
.br
|
|
.BR \-b ,
|
|
.BR \-\-background
|
|
.br
|
|
.BR \-\-cachepolicy
|
|
.IR Policy
|
|
.br
|
|
.BR \-\-cachepool
|
|
.IR CachePoolLogicalVolume { Name | Path }
|
|
.br
|
|
.BR \-\-cachesettings
|
|
.IB Key = Value
|
|
.br
|
|
.BR \-c ,
|
|
.BR \-\-chunksize
|
|
.BR \fIChunkSize [ b | B | s | S | k | K | m | M | g | G ]
|
|
.br
|
|
.BR \-\-corelog
|
|
.br
|
|
.BR \-\-discards
|
|
.RB { ignore | nopassdown | passdown }
|
|
.br
|
|
.BR \-i ,
|
|
.BR \-\-interval
|
|
.IR Seconds
|
|
.br
|
|
.BR \-\-merge
|
|
.br
|
|
.BR \-\-mirrorlog
|
|
.RB { disk | core | mirrored }
|
|
.br
|
|
.BR \-m ,
|
|
.BR \-\-mirrors
|
|
.IR Number
|
|
.br
|
|
.BR \-n ,
|
|
.BR \-\-name
|
|
.IR Name
|
|
.br
|
|
.BR \-\-noudevsync
|
|
.br
|
|
.BR \-\-originname
|
|
.IR NewExternalOriginVolumeName
|
|
.br
|
|
.BR \-\-poolmetadata
|
|
.IR PoolMetadataLogicalVolume { Name | Path }
|
|
.br
|
|
.BR \-\-poolmetadatasize
|
|
.BR \fIPoolMetadataSize [ b | B | s | S | k | K | m | M | g | G ]
|
|
.br
|
|
.BR \-\-poolmetadataspare
|
|
.RB { y | n }
|
|
.br
|
|
.BR \-r ,
|
|
.BR \-\-readahead
|
|
.RB { \fIReadAheadSectors | auto | none }
|
|
.br
|
|
.BR \-R ,
|
|
.BR \-\-regionsize
|
|
.IR MirrorLogRegionSize
|
|
.br
|
|
.BR \-\-repair
|
|
.br
|
|
.BR \-\-replace
|
|
.IR PhysicalVolume
|
|
.br
|
|
.BR \-\-splitcache
|
|
.br
|
|
.BR \-\-splitmirrors
|
|
.IR Number
|
|
.br
|
|
.BR \-\-splitsnapshot
|
|
.br
|
|
.BR \-\-stripes
|
|
.IR Number
|
|
.br
|
|
.BR \-I ,
|
|
.BR \-\-stripesize
|
|
.IR StripeSize
|
|
.br
|
|
.B \-\-type striped
|
|
.br
|
|
.B \-\-type snapshot
|
|
|
|
|
.B \-\-snapshot
|
|
|
|
|
.B \-s
|
|
.br
|
|
.B \-\-type mirror
|
|
.br
|
|
.B \-\-type raid*
|
|
.br
|
|
.B \-\-type thin
|
|
|
|
|
.B \-\-thin
|
|
|
|
|
.B \-T
|
|
.br
|
|
.B \-\-type cache
|
|
|
|
|
.B \-\-cache
|
|
|
|
|
.B \-H
|
|
.br
|
|
.B \-\-type thin\-pool
|
|
.br
|
|
.B \-\-type cache\-pool
|
|
.br
|
|
.BR \-\-thinpool
|
|
.IR ThinPoolLogicalVolume { Name | Path }
|
|
.br
|
|
.BR \-\-trackchanges
|
|
.br
|
|
.BR \-\-uncache
|
|
.br
|
|
.BR \-Z ,
|
|
.BR \-\-zero
|
|
.RB { y | n }
|
|
.br
|
|
|
|
Common options:
|
|
.br
|
|
.BR \-A ,
|
|
.BR \-\-alloc
|
|
.IR AllocationPolicy
|
|
.br
|
|
.BR \-f ,
|
|
.BR \-\-force
|
|
.br
|
|
.BR \-\-commandprofile
|
|
.IR ProfileName
|
|
.br
|
|
.BR \-h ,
|
|
.BR \-? ,
|
|
.BR \-\-help
|
|
.br
|
|
.BR \-v ,
|
|
.BR \-\-verbose
|
|
.br
|
|
.BR \-y ,
|
|
.BR \-\-yes
|
|
.br
|
|
.BR \-\-version
|
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
lvconvert changes the LV type and includes various LV utilities.
|
|
|
|
To display the current LV type, run the command:
|
|
|
|
.B lvs \-o name,segtype
|
|
.IR VG / LV
|
|
|
|
To change the LV type, run the command:
|
|
|
|
.B lvconvert \-\-type
|
|
.I NewType
|
|
.IR VG / LV
|
|
|
|
.SS LV types
|
|
|
|
The LV type is also called the "segment type" or "segtype".
|
|
|
|
LVs with the following types can be modified by lvconvert:
|
|
.B striped,
|
|
.B snapshot,
|
|
.B mirror,
|
|
.B raid*,
|
|
.B thin,
|
|
.B cache,
|
|
.B thin\-pool,
|
|
.B cache\-pool.
|
|
|
|
The specific operations available on each LV type are listed below.
|
|
|
|
The
|
|
.B linear
|
|
type is equivalent to the
|
|
.B striped
|
|
type when one stripe exists.
|
|
In that case, the types can sometimes be used interchangably.
|
|
|
|
In most cases, the
|
|
.B mirror
|
|
type is deprecated and the
|
|
.B raid1
|
|
type should be used. They are both implementations of mirroring.
|
|
|
|
The
|
|
.B raid*
|
|
type refers to one of many raid levels, e.g.
|
|
.B raid1,
|
|
.B raid5.
|
|
|
|
.SS LV layers
|
|
|
|
In some cases, an LV is a single device mapper (dm) layer above physical
|
|
devices. In other cases, hidden LVs (dm devices) are layered between the
|
|
visible LV and physical devices. LVs in the middle layers are sometimes
|
|
called sub LVs.
|
|
|
|
Changing the LV type will often change the composition of sub LVs.
|
|
|
|
Sub LVs can be displayed with the command
|
|
.B lvs -a.
|
|
|
|
A command run on a visible LV sometimes operates on a sub LV rather than
|
|
the specified LV. These cases are noted below.
|
|
|
|
Sometimes a sub LV must be specified directly on the command line, but
|
|
this is a non-standard form. These cases may change in the future to
|
|
avoid the direct use of hidden LVs.
|
|
|
|
.SH COMMANDS
|
|
|
|
.SS Operations on a StripedLV with type striped or linear:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-merge
|
|
VG/StripedLV
|
|
./" FIXME: use --merge-mirror
|
|
.br
|
|
\[bu]
|
|
Merge StripedLV into an LV when it is a previously split mirror.
|
|
.br
|
|
\[bu]
|
|
Options \-\-background, \-\-interval.
|
|
.br
|
|
\[bu]
|
|
See corresponding operation --splitmirrors.
|
|
|
|
.B lvconvert \-\-type snapshot
|
|
VG/StripedLV VG/SnapshotLV
|
|
.br
|
|
\[bu]
|
|
Recombine StripedLV with SnapshotLV which was previously split.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-zero.
|
|
.br
|
|
\[bu]
|
|
See corresponding operation --splitsnapshot.
|
|
|
|
.B lvconvert \-\-type thin
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type thin with an external origin.
|
|
.br
|
|
\[bu]
|
|
StripedLV becomes a read\-only external origin LV with a new name.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-thinpool to specify the thin pool to use.
|
|
.br
|
|
\[bu]
|
|
Options \-\-originname.
|
|
|
|
.B lvconvert \-\-type cache
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type cache.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-cachepool to specify the cache pool to use.
|
|
.br
|
|
\[bu]
|
|
Options \-\-cachepolicy, \-\-cachesettings.
|
|
|
|
.B lvconvert \-\-type thin\-pool
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type thin\-pool.
|
|
.br
|
|
\[bu]
|
|
The StripedLV is used for thin pool data.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
|
|
.br
|
|
\-\-readahead, \-\-zero.
|
|
|
|
.B lvconvert \-\-type cache\-pool
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type cache\-pool.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-poolmetadata{size,spare}.
|
|
|
|
.B lvconvert \-\-type mirror
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type mirror.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-mirrors to specify the number of mirrors to use.
|
|
.br
|
|
\[bu]
|
|
Options \-\-mirrorlog, \-\-regionsize.
|
|
|
|
.B lvconvert \-\-type raid*
|
|
VG/StripedLV
|
|
.br
|
|
\[bu]
|
|
Convert StripedLV to type raid*.
|
|
.br
|
|
\[bu]
|
|
Required options depend on the raid level.
|
|
|
|
.SS Operations on RaidLV with type raid*:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-mirrors
|
|
Number
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Change the number of images in raid1 RaidLV.
|
|
|
|
.B lvconvert \-\-splitmirrors
|
|
Number
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Split images from raid1 RaidLV and use them to create a new LV.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-name for the new LV, or the use of \-\-trackchanges.
|
|
|
|
.B lvconvert \-\-merge
|
|
VG/RaidLV
|
|
./" FIXME: use --merge-mirror
|
|
.br
|
|
\[bu]
|
|
Merge RaidLV into an LV when it is a previously split mirror.
|
|
.br
|
|
\[bu]
|
|
Options \-\-background, \-\-interval.
|
|
.br
|
|
\[bu]
|
|
See corresponding operation --splitmirrors.
|
|
|
|
.B lvconvert \-\-repair
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Replace failed PVs in RaidLV.
|
|
|
|
.B lvconvert \-\-replace
|
|
PV
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Replace specific PV(s) in a raid* LV with another PV.
|
|
.br
|
|
\[bu]
|
|
The new PV(s) to use can be optionally specified after the LV.
|
|
.br
|
|
\[bu]
|
|
Repeat to replace multiple: \-\-replace PV1 \-\-replace PV2 ...
|
|
|
|
.B lvconvert \-\-type snapshot
|
|
VG/RaidLV
|
|
VG/SnapshotLV
|
|
.br
|
|
\[bu]
|
|
Combine RaidLV with SnapshotLV that was previously split.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-zero.
|
|
.br
|
|
\[bu]
|
|
See corresponding operation \-\-splitsnapshot.
|
|
|
|
.B lvconvert \-\-type thin
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type thin with an external origin.
|
|
.br
|
|
\[bu]
|
|
RaidLV becomes a read\-only external origin LV with a new name.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-thinpool to specify the thin pool to use.
|
|
.br
|
|
\[bu]
|
|
Options \-\-originname.
|
|
|
|
.B lvconvert \-\-type cache
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type cache.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-cachepool to specify the cache pool to use.
|
|
.br
|
|
\[bu]
|
|
Options \-\-cachepolicy, \-\-cachesettings.
|
|
|
|
.B lvconvert \-\-type thin\-pool
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type thin\-pool.
|
|
.br
|
|
\[bu]
|
|
The RaidLV is used for thin pool data.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
|
|
.br
|
|
\-\-readahead, \-\-zero.
|
|
|
|
.B lvconvert \-\-type cache\-pool
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type cache\-pool.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-poolmetadata{size,spare}.
|
|
|
|
.B lvconvert \-\-type raid*
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to use a different raid level.
|
|
.br
|
|
\[bu]
|
|
Required options depend on the raid level.
|
|
|
|
.B lvconvert \-\-type mirror
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type mirror.
|
|
|
|
.B lvconvert \-\-type striped
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type striped.
|
|
|
|
.B lvconvert \-\-type linear
|
|
VG/RaidLV
|
|
.br
|
|
\[bu]
|
|
Convert RaidLV to type linear.
|
|
|
|
.SS Operations on MirrorLV with type mirror:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-mirrors
|
|
Number
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Change the number of images in MirrorLV.
|
|
|
|
.B lvconvert \-\-splitmirrors
|
|
Number
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Split images from MirrorLV and use them to create a new LV.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-name for the new LV.
|
|
|
|
.B lvconvert \-\-mirrorlog
|
|
LogType
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Change the type of log used by MirrorLV.
|
|
|
|
.B lvconvert \-\-repair
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Replace failed PVs in MirrorLV.
|
|
|
|
.B lvconvert \-\-type linear
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Convert MirrorLV to type linear.
|
|
|
|
.B lvconvert \-\-type raid*
|
|
VG/MirrorLV
|
|
.br
|
|
\[bu]
|
|
Convert MirrorLV to type raid*.
|
|
.br
|
|
\[bu]
|
|
Required options depend on the raid level.
|
|
|
|
.SS Operations on CachePoolLV with type cache\-pool:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-splitcache
|
|
VG/CachePoolLV
|
|
.br
|
|
\[bu]
|
|
Split the cache LV from CachePoolLV.
|
|
.br
|
|
\[bu]
|
|
Equivalent to --splitcache on CacheLV.
|
|
|
|
.SS Operations on CacheLV with type cache:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-splitcache
|
|
VG/CacheLV
|
|
.br
|
|
\[bu]
|
|
Split and keep the cache pool from CacheLV.
|
|
|
|
.B lvconvert \-\-uncache
|
|
VG/CacheLV
|
|
.br
|
|
\[bu]
|
|
Split and remove the cache pool from CacheLV.
|
|
|
|
.B lvconvert \-\-splitmirrors
|
|
Number
|
|
VG/CacheLV
|
|
.br
|
|
\[bu]
|
|
Split images from the mirrored origin of CacheLV to create a new LV.
|
|
.br
|
|
\[bu]
|
|
Operates on mirror or raid1 sub LV.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-name for the new LV, or the use of \-\-trackchanges.
|
|
|
|
.B lvconvert \-\-type thin\-pool
|
|
VG/CacheLV
|
|
.br
|
|
\[bu]
|
|
Convert CacheLV to type thin-pool.
|
|
.br
|
|
\[bu]
|
|
The CacheLV is used for thin pool data.
|
|
.br
|
|
\[bu]
|
|
Options \-\-chunksize, \-\-discards, \-\-poolmetadata{size,spare},
|
|
.br
|
|
\-\-readahead, \-\-zero.
|
|
|
|
|
|
.SS Operations on ThinPoolLV with type thin\-pool:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-splitcache
|
|
VG/ThinPoolLV
|
|
.br
|
|
\[bu]
|
|
Split and keep the cache pool from the data portion of ThinPoolLV.
|
|
.br
|
|
\[bu]
|
|
Operates on the data sub LV of the thin pool LV.
|
|
.br
|
|
\[bu]
|
|
The data sub LV of the thin pool must be a cache LV.
|
|
|
|
.B lvconvert \-\-uncache
|
|
VG/ThinPoolLV
|
|
.br
|
|
\[bu]
|
|
Split and remove the cache pool from the data portion of ThinPoolLV.
|
|
.br
|
|
\[bu]
|
|
Operates on the data sub LV of the thin pool LV.
|
|
.br
|
|
\[bu]
|
|
The data sub LV of the thin pool must be a cache LV.
|
|
|
|
.B lvconvert \-\-type cache
|
|
VG/ThinPoolLV
|
|
.br
|
|
\[bu]
|
|
Convert the data portion of ThinPoolLV to type cache.
|
|
.br
|
|
\[bu]
|
|
Requires \-\-cachepool to specify the cache pool to use.
|
|
.br
|
|
\[bu]
|
|
Operates on the data sub LV of the thin pool LV.
|
|
.br
|
|
\[bu]
|
|
Options \-\-cachepolicy, \-\-cachesettings.
|
|
|
|
.B lvconvert \-\-repair
|
|
VG/ThinPoolLV
|
|
.br
|
|
\[bu]
|
|
Repair ThinPoolLV.
|
|
|
|
.SS Operations on ThinLV with type thin:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-merge
|
|
VG/ThinLV
|
|
./" FIXME: use --merge-snapshot
|
|
.br
|
|
\[bu]
|
|
Merge ThinLV into its origin LV.
|
|
.br
|
|
\[bu]
|
|
ThinLV must have been created as a snapshot of another thin LV.
|
|
.br
|
|
\[bu]
|
|
Options \-\-background, \-\-interval.
|
|
|
|
.SS Operations on SnapshotLV with type snapshot:
|
|
|
|
\&
|
|
|
|
.B lvconvert \-\-splitsnapshot
|
|
VG/SnapshotLV
|
|
.br
|
|
\[bu]
|
|
Separate COW snapshot SnapshotLV from its origin LV.
|
|
|
|
.B lvconvert \-\-merge
|
|
VG/SnapshotLV
|
|
./" FIXME: use --merge-snapshot
|
|
.br
|
|
\[bu]
|
|
Merge COW snapshot SnapshotLV into its origin.
|
|
.br
|
|
\[bu]
|
|
Options \-\-background, \-\-interval.
|
|
|
|
.SH OPTIONS
|
|
.
|
|
See \fBlvm\fP(8) for common options.
|
|
.br
|
|
.
|
|
.HP
|
|
.BR \-b ,
|
|
.BR \-\-background
|
|
.br
|
|
If the operation requires polling, this option causes the command to
|
|
return before the operation is complete, and polling is done in the
|
|
background.
|
|
.
|
|
.HP
|
|
.BR \-\-cachepolicy
|
|
.IR Policy
|
|
.br
|
|
Specifies the cache policy for a cache LV. Also see
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-\-cachepool
|
|
.IR CachePoolLogicalVolume { Name | Path }
|
|
.br
|
|
Specifies the cache pool to use when converting an LV to a cache LV. If
|
|
CachePoolLogicalVolume is not yet a cache pool, the command will attempt
|
|
to convert it into a cache pool prior to the cache LV conversion.
|
|
Also see
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-\-cachesettings
|
|
.IB Key = Value
|
|
.br
|
|
Specifies tunable values for a cache LV. (The default values should
|
|
usually be adequate.) The special string value \fBdefault\fP switches
|
|
settings back to their default kernel values and removes them from the
|
|
list of settings stored in LVM metadata.
|
|
Also see
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-c ,
|
|
.BR \-\-chunksize
|
|
.BR \fIChunkSize [ b | B | s | S | k | K | m | M | g | G ]
|
|
.br
|
|
Sets the chunk size for a snapshot, cache pool or thin pool.
|
|
The default unit is in kilobytes.
|
|
.sp
|
|
For snapshots, the value must be a power of 2 between 4KiB and 512KiB
|
|
and the default value is 4.
|
|
.sp
|
|
For a cache pool the value must be between 32KiB and 1GiB and
|
|
the default value is 64.
|
|
.sp
|
|
For a thin pool the value must be between 64KiB and
|
|
1GiB and the default value starts with 64 and scales
|
|
up to fit the pool metadata size within 128MiB,
|
|
if the pool metadata size is not specified.
|
|
The value must be a multiple of 64KiB.
|
|
(Early kernel support until thin target version 1.4 required the value
|
|
to be a power of 2. Discards were not supported for non-power of 2 values
|
|
until thin target version 1.5.)
|
|
.
|
|
.HP
|
|
.BR \-\-corelog
|
|
.br
|
|
Specifies or changes the log type for a mirror LV.
|
|
It is an alias for \fB\-\-mirrorlog core\fP.
|
|
(This option does not apply to the \fBraid1\fP LV type.)
|
|
.
|
|
.HP
|
|
.BR \-\-discards
|
|
.RB { ignore | nopassdown | passdown }
|
|
.br
|
|
Specifies if discards will be processed by the thin layer in the
|
|
kernel and passed down to the Physical Volume. This applies only
|
|
to thin pools. The default is \fBpassdown\fP.
|
|
Also see
|
|
.BR lvmthin (7).
|
|
.
|
|
.HP
|
|
.BR \-H ,
|
|
.BR \-\-cache
|
|
.br
|
|
Alias for
|
|
.B \-\-type cache.
|
|
See COMMANDS description for
|
|
.br
|
|
.B lvconvert \-\-type cache.
|
|
.
|
|
.HP
|
|
.BR \-i ,
|
|
.BR \-\-interval
|
|
.IR Seconds
|
|
.br
|
|
Report progress as a percentage at regular intervals.
|
|
.
|
|
.HP
|
|
.BR \-\-merge
|
|
.br
|
|
Merges a snapshot that was split from an origin LV using
|
|
\fB\-\-splitsnapshot\fP, back into the origin LV.
|
|
|
|
Merges a raid1 image that was split from a raid1 LV using
|
|
\fB\-\-splitsnapshot\fP and \fB\-\-trackchanges\fP, back into
|
|
the original raid1 LV.
|
|
|
|
To check if the kernel supports the snapshot merge feature, look for
|
|
"snapshot\-merge" in the output of \fBdmsetup targets\fP.
|
|
|
|
When merging a snapshot, if both the origin and snapshot LVs are not open,
|
|
the merge will start immediately. Otherwise, the merge will start the
|
|
first time either the origin or snapshot LV are activated and both are
|
|
closed. Merging a snapshot into an origin that cannot be closed, for
|
|
example a root filesystem, is deferred until the next time the origin
|
|
volume is activated. When merging starts, the resulting LV will have the
|
|
origin's name, minor number and UUID. While the merge is in progress,
|
|
reads or writes to the origin appear as being directed to the snapshot
|
|
being merged. When the merge finishes, the merged snapshot is removed.
|
|
Multiple snapshots may be specified on the command line or a @tag may be
|
|
used to specify multiple snapshots be merged to their respective origin.
|
|
.
|
|
.HP
|
|
.BR \-\-mirrorlog
|
|
.RB { disk | core | mirrored }
|
|
.br
|
|
Specifies or changes the log type for a mirror LV.
|
|
The default is \fBdisk\fP, which is persistent and requires
|
|
a small amount of storage space, usually on a separate device
|
|
from the data being mirrored.
|
|
\fBCore\fP may be useful for short-lived mirrors. It means the mirror is
|
|
regenerated by copying the data from the first device again every
|
|
time the device is activated - e.g. possibly after every reboot.
|
|
Using \fBmirrored\fP will create a persistent log that is itself mirrored.
|
|
(This option does not apply to the \fBraid1\fP LV type.)
|
|
.
|
|
.HP
|
|
.BR \-m ,
|
|
.BR \-\-mirrors
|
|
.IR Number
|
|
.br
|
|
Specifies the number mirror images in addition to the original LV image,
|
|
e.g. \fB\-\-mirrors 1\fP means two copies of the data, the original and
|
|
one mirror image.
|
|
|
|
The current maximum is 9 providing 10 raid1 images.
|
|
|
|
This option is required when converting an LV to a \fBraid1\fP or
|
|
\fBmirror\fP LV.
|
|
|
|
This option can be used alone to change the number of mirror images in an
|
|
existing \fBraid1\fP or \fBmirror\fP LV.
|
|
|
|
The special case \fB\-\-mirrors 0\fP has been used historically to
|
|
indicate a linear LV with no mirror images.
|
|
.
|
|
.HP
|
|
.BR \-n ,
|
|
.BR \-\-name
|
|
.IR Name
|
|
.br
|
|
Specifies the name to use when the command is creating a new LV, e.g.
|
|
.B \-\-splitmirrors.
|
|
.
|
|
.HP
|
|
.BR \-\-noudevsync
|
|
.br
|
|
Disables udev synchronisation. The process will not wait for notification
|
|
from udev. It will continue irrespective of any possible udev processing
|
|
in the background. You should only use this if udev is not running or has
|
|
rules that ignore the devices LVM creates.
|
|
.
|
|
.HP
|
|
.BR \-\-originname
|
|
.IR NewExternalOriginVolumeName
|
|
.br
|
|
Specifies the name to use for the external origin LV when converting an LV
|
|
to a thin LV. The LV being converted becomes a read\-only external origin
|
|
with this name.
|
|
.br
|
|
Without this option, the default name of "lvol<n>" will be generated where
|
|
<n> is the LVM internal number of the LV.
|
|
.br
|
|
.
|
|
.\" .HP
|
|
.\" .BR \-\-pooldatasize
|
|
.\" .IR PoolDataVolumeSize [ \fBbBsSkKmMgGtTpPeE ]
|
|
.\" .br
|
|
.\" Sets the size of pool's data logical volume.
|
|
.\" The option \fB\-\-size\fP could be still used with thin pools.
|
|
.
|
|
.HP
|
|
.BR \-\-poolmetadata
|
|
.IR PoolMetadataLogicalVolume { Name | Path }
|
|
.br
|
|
Specifies the LV to use for thin pool metadata when converting an LV to a
|
|
thin pool LV.
|
|
.br
|
|
Specifies the LV to use for cache pool metadata when converting an LV to a
|
|
cache pool LV.
|
|
.br
|
|
The size should be between 2MiB and 16GiB.
|
|
.br
|
|
(This option can also be used when a thin pool or cache pool are created
|
|
as an auxiliary operation within a different command.)
|
|
Also see
|
|
.BR lvmthin (7),
|
|
and
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-\-poolmetadatasize
|
|
.BR \fIPoolMetadataSize [ b | B | s | S | k | K | m | M | g | G ]
|
|
.br
|
|
Specifies the size of a cache pool metadata LV or a thin pool metadata LV.
|
|
This is used if a command creates a pool metadata LV automatically as part
|
|
of the operation. This option is not used when an existing LV is
|
|
specified as the pool metadata LV, i.e. \fB\-\-poolmetadata\fP.
|
|
The default unit is megabytes.
|
|
Also see
|
|
.BR lvmthin (7),
|
|
and
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-\-poolmetadataspare
|
|
.RB { y | n }
|
|
.br
|
|
Specifies if a spare pool metadata LV should be created.
|
|
A spare pool metadata LV will be used for pool repair.
|
|
Only one spare pool metadata LV is maintained within a VG, with the size
|
|
of the largest existing pool metadata LV.
|
|
The default is \fBy\fPes.
|
|
.
|
|
.HP
|
|
.BR \-r ,
|
|
.BR \-\-readahead
|
|
.RB { \fIReadAheadSectors | auto | none }
|
|
.br
|
|
Specifies the read ahead sector count of a thin pool metadata LV.
|
|
The default value is \fBauto\fP which allows the kernel to choose
|
|
a suitable value automatically.
|
|
\fBNone\fP is equivalent to specifying zero.
|
|
.
|
|
.HP
|
|
.BR \-R ,
|
|
.BR \-\-regionsize
|
|
.IR MirrorLogRegionSize
|
|
.br
|
|
A mirror LV is divided into regions of this size (in MB), and the mirror
|
|
log uses this granularity to track which regions are in sync.
|
|
(This option does not apply to the \fBraid1\fP LV type.)
|
|
.
|
|
.HP
|
|
.BR \-\-repair
|
|
.br
|
|
Replaces failed PVs in a raid1 or mirror LV with other PVs available in
|
|
the VG. By default, the original number of mirror images will be restored
|
|
if possible. Specify \fB\-y\fP on the command line to skip the prompts.
|
|
Use \fB\-f\fP if you do not want any replacement. You may use
|
|
\fB\-\-use\-policies\fP to use the device replacement policy specified in
|
|
\fBlvm.conf\fP(5), see \fBactivation/mirror_log_fault_policy\fP or
|
|
\fBactivation/mirror_device_fault_policy\fP.
|
|
|
|
When used with a thin pool LV, this option automates the use of the
|
|
\fBthin_repair\fP(8) tool on the thin pool. This repairs a very limitted
|
|
number of problems. Only inactive thin pools can be repaired. There is
|
|
no validation of metadata between kernel and LVM. This requires further
|
|
manual work. After successfull repair the old unmodified metadata are
|
|
still available in "<pool>_meta<n>" LV.
|
|
Also see
|
|
.BR lvmthin (7).
|
|
.
|
|
.HP
|
|
.BR \-\-replace
|
|
.IR PhysicalVolume
|
|
.br
|
|
Remove the specified device \fIPhysicalVolume\fP and replace it with one
|
|
that is available in the VG, or from a specific list of PVs specified on
|
|
the command line following the LV name. This option may be repeated multiple
|
|
times depending on the RaidLV type.
|
|
.
|
|
.HP
|
|
.BR \-s ,
|
|
.BR \-\-snapshot
|
|
.br
|
|
Alias for
|
|
.B \-\-type snapshot.
|
|
See COMMANDS description for
|
|
.br
|
|
.B lvconvert \-\-type snapshot.
|
|
.HP
|
|
.BR \-\-split
|
|
.br
|
|
Separates \fISplitableLogicalVolume\fP.
|
|
This option tries to detect the necessary split operation from its arguments.
|
|
Avoid using this option and use one of the following instead:
|
|
.B \-\-splitcache, \-\-splitmirrors, \-\-splitsnapshot.
|
|
.
|
|
.HP
|
|
.BR \-\-splitcache
|
|
.br
|
|
Separates a cache pool from a cache LV, and keeps the unused cache pool
|
|
LV. Before the separation, the cache is flushed. See similar option
|
|
.B \-\-uncache.
|
|
Also see
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-\-splitmirrors
|
|
.IR Number
|
|
.br
|
|
Splits the specified number of images from a \fBraid1\fP or \fBmirror\fP
|
|
LV and uses them to create a new LV.
|
|
|
|
If \fB\-\-trackchanges\fP is also specified, changes to the raid1 LV are
|
|
tracked while the split LV remains detached.
|
|
.B lvconvert \-\-merge
|
|
can be used to recombine the split images with the original raid1 LV.
|
|
|
|
A name can be specified for the new LV with \fB\-\-name\fP (a name is
|
|
required without \fB\-\-trackchanges\fP).
|
|
.
|
|
.HP
|
|
.BR \-\-splitsnapshot
|
|
.br
|
|
Separates a COW snapshot from its origin LV. The LV that is split off
|
|
contains the chunks that differ from the origin LV along with metadata
|
|
describing them. This LV can be wiped and then destroyed with lvremove.
|
|
See corresponding operation
|
|
.B lvconvert \-\-type snapshot.
|
|
.
|
|
.HP
|
|
.BR \-\-stripes
|
|
.IR Number
|
|
.br
|
|
Specifies the number of stripes in a striped LV. This is the number of
|
|
physical volumes (devices) that a striped LV is spread across. Data that
|
|
appears sequential in the LV is spread across multiple devices in units of
|
|
the stripe size (see \fB\-\-stripesize\fP). This does not apply to
|
|
existing allocated space, only newly allocated space can be striped.
|
|
.
|
|
.HP
|
|
.BR \-I ,
|
|
.BR \-\-stripesize
|
|
.IR StripeSize
|
|
.br
|
|
Specifies the stripe size in kilobytes for a striped LV. The stripe size
|
|
is the number of kilobytes written to each stripe, i.e. to one device,
|
|
before writing to the next stripe/device. StripeSize must be a power of 2
|
|
and cannot exceed the VG physical extent (PE) size.
|
|
.
|
|
.HP
|
|
.BR \-\-type
|
|
.IR SegmentType
|
|
.br
|
|
Converts an LV from one segment type to another.
|
|
See COMMANDS section for a description of converting between each type.
|
|
.
|
|
.HP
|
|
.BR \-\-thinpool
|
|
.IR ThinPoolLogicalVolume { Name | Path }
|
|
.br
|
|
Specifies the thin pool to use when converting an LV to a thin LV. If
|
|
ThinPoolLogicalVolume is not yet a thin pool, the command will attempt to
|
|
convert it to a thin pool prior to the thin LV conversion.
|
|
Also see
|
|
.BR lvmthin (7).
|
|
.
|
|
.HP
|
|
.BR \-\-trackchanges
|
|
.br
|
|
Can be used with \fB\-\-splitmirrors\fP on a raid1 LV. This causes
|
|
changes to the original raid1 LV to be tracked while the split images
|
|
remain detached. This allows the read\-only detached image(s) to be
|
|
merged efficiently back into the raid1 LV later. Only the regions with
|
|
changed data are resynchronized during merge. (This option only applies
|
|
to the \fBraid1\fP LV type.)
|
|
.
|
|
.HP
|
|
.BR \-T ,
|
|
.BR \-\-thin
|
|
.br
|
|
Alias for
|
|
.B \-\-type thin.
|
|
See COMMANDS description for
|
|
.br
|
|
.B lvconvert \-\-type thin.
|
|
.
|
|
.HP
|
|
.BR \-\-uncache
|
|
.br
|
|
Separates a cache pool from a cache LV, and removes the unused cache pool
|
|
LV. Before the separation, the cache is flushed. See similar option
|
|
.B \-\-splitcache.
|
|
Also see
|
|
.BR lvmcache (7).
|
|
.
|
|
.HP
|
|
.BR \-Z ,
|
|
.BR \-\-zero
|
|
.RB { y | n }
|
|
.br
|
|
For snapshots, this controls zeroing of the first 4KiB of data in the
|
|
snapshot. If the LV is read\-only, the snapshot will not be zeroed.
|
|
|
|
For thin pools, this controls zeroing of provisioned blocks.
|
|
Provisioning of large zeroed chunks negatively impacts performance.
|
|
Also see
|
|
.BR lvmthin (7).
|
|
.
|
|
|
|
.SH Examples
|
|
.
|
|
Convert a linear LV to a two-way mirror LV:
|
|
.br
|
|
.B lvconvert \-\-type mirror \-\-mirrors 1 vg/lvol1
|
|
|
|
Convert a linear LV to a two-way RAID1 LV:
|
|
.br
|
|
.B lvconvert \-\-type raid1 \-\-mirrors 1 vg/lvol1
|
|
|
|
Convert a mirror LV to use an in\-memory log:
|
|
.br
|
|
.B lvconvert \-\-mirrorlog core vg/lvol1
|
|
|
|
Convert a mirror LV to use a disk log:
|
|
.br
|
|
.B lvconvert \-\-mirrorlog disk vg/lvol1
|
|
|
|
Convert a mirror or raid1 LV to a linear LV:
|
|
.br
|
|
.B lvconvert --type linear vg/lvol1
|
|
|
|
Convert a mirror LV to a raid1 LV with the same number of images:
|
|
.br
|
|
.B lvconvert \-\-type raid1 vg/lvol1
|
|
|
|
./" Split and merge a COW snapshot:
|
|
./" TODO
|
|
Convert a linear LV to a two-way mirror LV, allocating new extents from specific
|
|
PV ranges:
|
|
.br
|
|
.B lvconvert \-\-mirrors 1 vg/lvol1 /dev/sda:0\-15 /dev/sdb:0\-15
|
|
|
|
Convert a mirror LV to a linear LV, freeing physical extents from a specific PV:
|
|
.br
|
|
.B lvconvert \-\-type linear vg/lvol1 /dev/sda
|
|
|
|
Split one image from a mirror or raid1 LV, making it a new LV:
|
|
.br
|
|
.B lvconvert \-\-splitmirrors 1 \-\-name lv_split vg/lvol1
|
|
|
|
Split one image from a raid1 LV, and track changes made to the raid1 LV
|
|
while the split image remains detached:
|
|
.br
|
|
.B lvconvert \-\-splitmirrors 1 \-\-trackchanges vg/lvol1
|
|
|
|
Merge an image (that was previously created with \-\-splitmirrors and
|
|
\-\-trackchanges) back into the original raid1 LV:
|
|
.br
|
|
.B lvconvert \-\-merge vg/lvol1_rimage_1
|
|
./" FIXME: use merge-mirror
|
|
|
|
Replace PV /dev/sdb1 with PV /dev/sdf1 in a raid1/4/5/6/10 LV:
|
|
.br
|
|
.B lvconvert \-\-replace /dev/sdb1 vg/lvol1 /dev/sdf1
|
|
|
|
Replace 3 PVs /dev/sd[b-d]1 with PVs /dev/sd[f-h]1 in a raid1 LV:
|
|
.br
|
|
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 \-\-replace /dev/sdd1
|
|
.RS
|
|
.B vg/lvol1 /dev/sd[fgh]1
|
|
.RE
|
|
|
|
Replace the maximum of 2 PVs /dev/sd[bc]1 with PVs /dev/sd[gh]1 in a raid6 LV:
|
|
.br
|
|
.B lvconvert \-\-replace /dev/sdb1 \-\-replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
|
|
|
|
Convert an LV into a thin LV in the specified thin pool. The existing LV
|
|
is used as an external read\-only origin for the new thin LV.
|
|
.br
|
|
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1 vg/lvol1
|
|
|
|
Convert an LV into a thin LV in the specified thin pool. The existing LV
|
|
is used as an external read\-only origin for the new thin LV, and is
|
|
renamed "external":
|
|
.br
|
|
.B lvconvert \-\-type thin \-\-thinpool vg/tpool1
|
|
.RS
|
|
.B \-\-originname external vg/lvol1
|
|
.RE
|
|
|
|
Convert an LV to a cache pool LV using another specified LV for cache pool
|
|
metadata:
|
|
.br
|
|
.B lvconvert \-\-type cache-pool \-\-poolmetadata vg/poolmeta1 vg/lvol1
|
|
|
|
Convert an LV to a cache LV using the specified cache pool and chunk size:
|
|
.br
|
|
.B lvconvert \-\-type cache \-\-cachepool vg/cpool1 \-c 128 vg/lvol1
|
|
|
|
Detach and keep the cache pool from a cache LV:
|
|
.br
|
|
.B lvconvert \-\-splitcache vg/lvol1
|
|
|
|
Detach and remove the cache pool from a cache LV:
|
|
.br
|
|
.B lvconvert \-\-uncache vg/lvol1
|
|
|
|
.SH SEE ALSO
|
|
.BR lvm (8),
|
|
.BR lvm.conf (5),
|
|
.BR lvmcache (7),
|
|
.BR lvmthin (7),
|
|
.BR lvdisplay (8),
|
|
.BR lvextend (8),
|
|
.BR lvreduce (8),
|
|
.BR lvremove (8),
|
|
.BR lvrename (8),
|
|
.BR lvscan (8),
|
|
.BR vgcreate (8),
|
|
.BR cache_dump (8),
|
|
.BR cache_repair (8),
|
|
.BR cache_restore (8),
|
|
.BR thin_dump (8),
|
|
.BR thin_repair (8),
|
|
.BR thin_restore (8)
|