This tutorial explains how to view, list, create, add, remove, format, mount, resize and delete Physical Volume, Volume Group and Logical Volumes in Linux step by step with practical examples. Learn fundamental and basic concepts of LVM, LVM management and essential LVM commands in detail. Creating a flexible filesystem in Linux server using Logical volume management which help to expand from small size to large in size on the fly. N create a new partition. Logical volumes can be created only from Volume group space. If VG does not have enough space we can’t create with a Logical volume.
This question already has an answer here:
- How to create LV(Logical Volume) after ubuntu is installed? 1 answer
I have an external disk
sda
on the machine and I want to create an LVM physical volume from free space of the sda
.Here are the partition sizes:Actually, I want to create a
sda4
partition as LVM Physical Volume and create the LVM volume group on that. Can someone tell how can I do that?I should mention that the goal is to set up a Cinder node for the OpenStack. According to the documentation, it should be done using the commands:
But there is not a second disk
sdb
on my machine and I want to know how to do that using just the disk sda
.Soheil Pourbafrani
Soheil PourbafraniSoheil Pourbafrani
marked as duplicate by karel, Eric Carvalho, Fabby, Thomas, Charles GreenDec 3 '18 at 16:40
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1 Answer
Instead of
/dev/sdb
, you can use a partition on your /dev/sda
as a physical LVM partition but you have to create it first.IMPORTANT NOTICE: Make a backup of the whole disk before modifying partitions on your hard drive.
If you can use GUI, use GParted to create the new partition. Otherwise, run:
In the
parted
environment (indicated by the (parted)
prompt), issue:Then issue the following command where
<START>
is replaced by the number given by the previous command as the start of the free space after sda3
.Quit
parted
.Then you should be able to issue the commands:
MelebiusMelebius