Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
Hello, im looking for a way to expand the storage (lvextend -l +100%FREE /dev/mapper/debian--vg-root) but im being very careful as is an live production server i manged to get the other system done just fine months ago but forgotten the steps
storage is 1.3TB as you can see on fdisk, but on /dev/mapper/debian--vg-root is only showing 119GB. any help will be great thanks
root@mx:~# fdisk -l
Quote:
Disk /dev/sda: 1.3 TiB, 1395864371200 bytes, 2726297600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1652c7ed
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 251656191 251154434 119.8G 5 Extended
/dev/sda5 501760 251656191 251154432 119.8G 8e Linux LVM
--- Physical volume ---
PV Name /dev/sda5
VG Name debian-vg
PV Size 119.76 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 30658
Free PE 0
Allocated PE 30658
PV UUID dXxbLy-2Kf5-kCEh-8gWa-JBKl-5Arx-h3zGEl
root@mx:~# vgdisplay
Quote:
--- Volume group ---
VG Name debian-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
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 119.76 GiB
PE Size 4.00 MiB
Total PE 30658
Alloc PE / Size 30658 / 119.76 GiB
Free PE / Size 0 / 0
VG UUID 6ckK2L-IaM8-fZOK-i6qD-DPpN-VdBz-KpZTbT
Go get a good LVM guide - the RHEL LVM admin guide is one such. It is available (from RH) for free download, no registration required.
The pv needs to be enlarged first, then the vg, and lastly the lv. Then as suggested, the filesystem - fsadm will likely do the last two at once for you, depending on filesystem.
Rather than mess with enlarging the pv, a safer (and preferred by me) option is to create a new pv on the free space and add it to the vg, then processd as normal. See the admin guide above.
Go get a good LVM guide - the RHEL LVM admin guide is one such. It is available (from RH) for free download, no registration required.
The pv needs to be enlarged first, then the vg, and lastly the lv. Then as suggested, the filesystem - fsadm will likely do the last two at once for you, depending on filesystem.
Rather than mess with enlarging the pv, a safer (and preferred by me) option is to create a new pv on the free space and add it to the vg, then processd as normal. See the admin guide above.
Your extended partition is using just 119.8GB, and not the full 1.3TB of the disk. It is fully used by sda5. To create a logical partition sda6 you first have to enlarge the extended partition. You can do that with gparted and create sda6. Since you presently have just 2 primary partitions, you could also just create sda3 in the available ~1.24TB. Either of those is going to require a reboot to let the kernel use the new partitioning.
Your extended partition is using just 119.8GB, and not the full 1.3TB of the disk. It is fully used by sda5. To create a logical partition sda6 you first have to enlarge the extended partition. You can do that with gparted and create sda6. Since you presently have just 2 primary partitions, you could also just create sda3 in the available ~1.24TB. Either of those is going to require a reboot to let the kernel use the new partitioning.
If you expand the extended partition (sda2), then you will be able to expand sda5. After you expand sda5, you will then need to tell LVM to expand the LVM physical volume to use the space. Just run "pvresize /dev/sda5". The space will then be available to expand logical volumes or create new ones. If you do expand an LV, don't forget to use the "--resizefs" option to adjust the filesystem structure too.
If you expand the extended partition (sda2), then you will be able to expand sda5. After you expand sda5, you will then need to tell LVM to expand the LVM physical volume to use the space. Just run "pvresize /dev/sda5". The space will then be available to expand logical volumes or create new ones. If you do expand an LV, don't forget to use the "--resizefs" option to adjust the filesystem structure too.
You do not need step 2 (and it's out of order anyway -- should be last). The "--resizefs" in the lvextend command will take care of resizing the filesystem at the proper time. And really the command should be
You do not need step 2 (and it's out of order anyway -- should be last). The "--resizefs" in the lvextend command will take care of resizing the filesystem at the proper time. And really the command should be
root@mx:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda5
VG Name debian-vg
PV Size 119.76 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 30658
Free PE 0
Allocated PE 30658
PV UUID dXxbLy-2Kf5-kCEh-8gWa-JBKl-5Arx-h3zGEl
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.