how to create volume with lvcreate when no free space
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to create volume with lvcreate when no free space
how to create new volume using lvcreate, if there is no free space.
I used fdisk -l, but it is giving error.
my output of vgdisplay command
[root@oc0018158158 Desktop]# vgdisplay
--- Volume group ---
VG Name vg_oc1443230061
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 464.78 GiB
PE Size 32.00 MiB
Total PE 14873
Alloc PE / Size 14873 / 464.78 GiB
Free PE / Size 0 / 0
VG UUID HnQ86q-OOT1-akAA-hCPk-8rMZ-mPXc-kOzTkY
You are in bad situation, all space assigned to / .
You have to umount FS to reduce it and this is not possible for / .
Therefore you have to backup everything, because reducing is dangerous.
Then you will boot from rescue disk, not mounting local disk, vgscan, vgimport, vgchange -ay.
resize2fs to reduce / to desired size, lvreduce to same size +1m (to be sure).
Then you will have plenty free space to create whatever.
From other point of view, the new volume will be mounted under / , probably you can skip all
this headache and just mkdir ?
lvreduce has many variations in parameters - hence the ...
The -r parameter will automatically reduce the file system on the logical volume, safely.
Constructions such as
Code:
lvreduce -r --extents 10%LV /dev/vg-name/lv-name
works for me.
(Change the 10% to whatever is required).
If you presently have one giant extent, this can take a very long time to run.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.