Difference between revisions of "Lvreduce"

From wikieduonline
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<code>lvreduce</code> - Reduce the size of a logical volume
 
<code>lvreduce</code> - Reduce the size of a logical volume
  
Shrinking is not supported on a GFS2 or [[XFS]] file system
+
Shrinking is not supported on a [[GFS2]] or [[XFS]] file system
  
  
 
== Examples ==
 
== Examples ==
 
Reduce to a total size of 1GB:
 
Reduce to a total size of 1GB:
* <code>lvreduce --[[resizefs]] -L 1GB vg01/lvol1</code>
+
* TOTAL 1GB: <code>lvreduce --[[resizefs]] -L 1GB vg01/lvol1</code>
 +
 +
Example:
 +
lvreduce --resizefs -L 4TB VG_NAME/LV_NAME
 +
Do you want to unmount "/srv" ? [Y|n] y
 +
fsck from util-linux 2.31.1
 +
Resizing the filesystem on /dev/mapper/VG_NAME-LV_NAME to 1073741824 (4k) blocks.
 +
The filesystem on /dev/mapper/VG_NAME-LV_NAME is now 1073741824 (4k) blocks long.
 +
  Size of logical volume VG_NAME/LV_NAME changed from <6.00 TiB (1572863 extents) to 4.00 TiB (1048576 extents).
 +
  Logical volume VG_NAME/LV_NAME successfully resized.
  
 
+
Related commands:
* <code>lvreduce --resizefs -L 84M vg01/lvol1</code>
+
* <code>[[resize2fs]]</code>
 +
* <code>[[chfs]]</code> ([[AIX]])
  
 
== See also ==
 
== See also ==
 
* {{LVM}}
 
* {{LVM}}
 +
 +
 +
[[Category:LVM]]

Latest revision as of 10:26, 7 January 2020

lvreduce - Reduce the size of a logical volume

Shrinking is not supported on a GFS2 or XFS file system


Examples[edit]

Reduce to a total size of 1GB:

  • TOTAL 1GB: lvreduce --resizefs -L 1GB vg01/lvol1
Example:
lvreduce --resizefs -L 4TB VG_NAME/LV_NAME
Do you want to unmount "/srv" ? [Y|n] y
fsck from util-linux 2.31.1
Resizing the filesystem on /dev/mapper/VG_NAME-LV_NAME to 1073741824 (4k) blocks.
The filesystem on /dev/mapper/VG_NAME-LV_NAME is now 1073741824 (4k) blocks long.
 Size of logical volume VG_NAME/LV_NAME changed from <6.00 TiB (1572863 extents) to 4.00 TiB (1048576 extents).
 Logical volume VG_NAME/LV_NAME successfully resized.

Related commands:

See also[edit]

scan: pvscan vgscan
LVM: lvs lvmscan lvm fullreport lvmreport lvmconfig lvmdump lvmcheck lvm dumpconfig
Scan: pvs vgs lvs pvscan vgscan
PV: pvcreate pvremove pvscan pvremove pvscan pvs pvchange pvck pvdisplay pvresize
LV: lvdisplay lvcreate lvremove, lvresize, lvextend, lvreduce, lvrename
VG: vgdisplay,vgcreate,vgremove, vgextend, vgreduce, vgscan, vgchange, vgrename, vgcfgbackup, vgcfgrestore, vgimportclone, vgck
Check commands: pvck vgck

Advertising: