SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I recently set up a spare hdd with LVM2. I happen not to have partitionned the disk with LV sizes suitable for my environment, but LVM is supposed to help make those changes a breeze right???
Ok so basically when I do:
bash-3.1# vgdisplay
--- Volume group ---
VG Name my_vg_name
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
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 17.12 GB
PE Size 4.00 MB
Total PE 4384
Alloc PE / Size 4352 / 17.00 GB
Free PE / Size 1332 / 5.12 GB
VG UUID CLj3Qx-SoIh-j2Ls-vCkt-T13V-eTYA-5Kz5ct
Which is about right (supposed to be 18G hdd though).
What happens is that the disk was actually setup with 3 LVs at first. I tried to reduce the third LV so that I could then extend the the second LV but this didn't work, so I lvremoved the third LV.
Then:
lvextend -L+3G /dev/my_vg/my_logical_volume#2
Extending logical volume lvm2 to 9.00 GB
Insufficient free space: 2304 extents needed, but only 1312 available
Which makes sense half way since 2304 extents are needed but only 1312 are available. Though vgdisplay clearly states that there is 5.12GB left free on the disk...
Let's try to recreate a third LV:
lvcreate -L5G -n my_logical_volume#3 my_volume_group
Logical volume "my_logical_volume#3" created
And again:
vgdisplay
--- Volume group ---
VG Name my_vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 17.12 GB
PE Size 4.00 MB
Total PE 4384
Alloc PE / Size 4352 / 17.00 GB
Free PE / Size 32 / 128.00 MB
VG UUID CLj3Qx-SoIh-j2Ls-vCkt-T13V-eTYA-5Kz5ct
By comparing the output of vgdisplay, you can see that creating a new LV of 5G uses 1300 PEs but extending an existing LV requires 2304 PEs, however. Is this how it is suposed to work or am I doing things the wrong way around? The LVM-howto also states that there are different mapping modes (linear/stripped) but I haven't got my head around this yet, could that be the source of the problem??
This is the version of LVM that I downloded tried first 2.02.13 from linuxpackages. It must be buggy since after downloading a more recent version and compiled it from source it works ok...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.