how to use lvcreate command and its examples

  • About lvcreate: To create a logical volume in an existing volume group
  • It comes from “lvm2-2.02.72” package.
  • Configuration Files:
  • Path: /sbin/lvcreate

Examples:

1. To Power of 2 chunk size for the snapshot logical volume between 4k and 512k

$ lvcreate -c ChunkSize
$ lvcreate –chunksize ChunkSize 

2. To Sets or resets the contiguous allocation policy for logical  volumes

$ lvcreate -C y|n
$ lvcreate –contiguous y|n 

3. To give the number of stripes

$ lvcreate -i stripes
$ lvcreate –stripes stripes 

4. To Gives the number of kilobytes for the granularity of the stripes

$ lvcreate -I StripeSize
$ lvcreate –stripesize StripeSize 

5. To give the number of logical extents to allocate for the new logical volume

$ lvcreate -l LogicalExtentsNumber[%{VG|PVS|FREE|ORIGIN}
$ lvcreate –extents LogicalExtentsNumber[%{VG|PVS|FREE|ORIGIN} 

6. To give the size to allocate for the new logical volume

$ lvcreate -L –size LogicalVolumeSize[bBsSkKmMgGtTpPeE]

 7. To set the minor number

$ lvcreate –minor minor

8. To Set to y to make the minor number specified persistent

$ lvcreate -M y|n
$ lvcreate –persistent y|n 

9. To creates a mirrored logical volume with Mirrors copies

$ lvcreate -m mirrors
$ lvcreate –mirrors mirrors 

10. To give name for the new logical volume

$ lvcreate -n LogicalVolumeName
$ lvcreate –name LogicalVolumeName 

11. To disable  udev synchronization

$ lvcreate –noudevsync

 12. To Start or avoid monitoring a mirrored or snapshot logical volume with dmeventd

$ lvcreate –monitor y|n

13. To Make no attempt to interact with dmeventd unless –monitor is specified

$ lvcreate –ignoremonitoring

14. To Set access permissions to read only or read and write

$ lvcreate -p r|rw
$ lvcreate –permission r|rw 

15. To set read ahead sector count of this logical volume

$ lvcreate -r ReadAheadSectors|auto|none
$ lvcreate –readahead ReadAheadSectors|auto|none 

16. To divide the mirror into regions

$ lvcreate -R MirrorLogRegionSize
$ lvcreate –regionsize MirrorLogRegionSize 

17. To Create a snapshot logical volume (or snapshot) for an existing

$ lvcreate -s
$ lvcreate –snapshot 

18. To create a logical volume that uses the specified segment type

$ lvcreate –type SegmentType

19. To Create a sparse device of the given size (in MB by default) using a snapshot

$ lvcreate –virtualsize VirtualSize

20. To Controls zeroing of the first KB of data in the new logical volume

$ lvcreate -Z y|n
$ lvcreate –zero y|n 

Related Commands: lvm, vgcreate, lvremove, lvrename lvextend, lvreduce, lvdisplay, lvscan 

Leave a Reply

Your email address will not be published. Required fields are marked *