0% found this document useful (0 votes)
63 views3 pages

Author Subject Change / Reviewer: Amit Kumar Linux Volume Manager Arun Nayak 1.0

This document provides instructions for performing various operations with the Linux Volume Manager (LVM) including creating and initializing physical volumes and volume groups, activating and deactivating volume groups, adding or removing physical volumes from volume groups, and creating and removing logical volumes. It outlines the commands needed to perform each operation and any requirements or caveats for each task.

Uploaded by

arunnayak143
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views3 pages

Author Subject Change / Reviewer: Amit Kumar Linux Volume Manager Arun Nayak 1.0

This document provides instructions for performing various operations with the Linux Volume Manager (LVM) including creating and initializing physical volumes and volume groups, activating and deactivating volume groups, adding or removing physical volumes from volume groups, and creating and removing logical volumes. It outlines the commands needed to perform each operation and any requirements or caveats for each task.

Uploaded by

arunnayak143
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

LVM

Version 1.0

LVM

Author Amit Kumar Linux Volume Manager

Subject

Change / Reviewer Arun Nayak

Version 1.0

Submitted By:BirlaSoft Inc

Submitted By: BirlaSoft 1 of 3

Page

LVM
Linux Volume Manager 2

Version 1.0

1. Creating and initializing physical volume group; #pvcreate /dev/hda1 /dev/hdb2 This will create a volume group descriptor at the start of the disk. 2. Creating a volume group; #vgcreate my_vol_group /dev/hda1 /dev/hdb2 and so on. 3. Activating a volume group: #vgchange a y my_vol_group 4. Removing a volume group: Make sure that no logical volumes are present on the volume group. Deactivate the volume group #vgchange a n my_vol_group Now actually you will remove the volume group. #vgremove my_vol_group 5. Adding physical volume to a existing volume group Use vgextentd to add and initialized physical volume to an existing volume group. #vgextentd my_vol_group /dev/hdc1 6. Removing physical volume from a existing volume group Make sure that the physical volume isn't used by any logical volumes by using then 'pvdisplay' command #pvdisplay /dev/hda1 --- Physical volume --PV Name /dev/hda1

Submitted By: BirlaSoft 2 of 3 Classification: GE Birlasoft Confidential

Page

LVM

Version 1.0
VG Name myvg PV Size 1.95 GB / NOT usable 4 MB [LVM: 122 KB] PV# 1 PV Status available Allocatable yes (but full) Cur LV 1 PE Size (KByte) 4096 Total PE 499 Free PE 0 Allocated PE 499 PV UUID Sd44tK-9IRw-SrMC-MOkn-76iP-iftz-OVSen7

Once you are sure that the physical volume is not in used you can remove that from the volume group by the below command. If the physical volume is still used you will have to migrate the data to another physical volume using pvmove. Then use 'vgreduce' to remove the physical volume: # vgreduce my_volume_group /dev/hda1 7. Creating a logical volume To create a 1500MB linear LV named 'testlv' and its block device special '/dev/testvg (This is the name of voume group)/testlv (this is the name of logical volume)': # lvcreate -L1500 -ntestlv testvg 8. Removing a Logical volume: A logical volume must be closed before it can be removed: # umount /dev/myvg/homevol # lvremove /dev/myvg/homevol lvremove -- do you really want to remove "/dev/myvg/homevol"? [y/n]: y lvremove -- doing automatic backup of volume group "myvg" lvremove -- logical volume "/dev/myvg/homevol" successfully removed

----------- END -----------

Submitted By: BirlaSoft 3 of 3 Classification: GE Birlasoft Confidential

Page

You might also like