[SOLVED] How to extend /home or / partition through LVM
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 can I extend /home or / partition through LVM. Is this possible ?
Thanks
Yes indeed. Have your /home or / partitions been partitioned for LVM use? Are they part of an existing volume group? What does the "vgdisplay" command say?
How can I extend /home or / partition through LVM. Is this possible?
Yes indeedy - that's largely why LVM's were invented in the first place: to give you greater flexibility over "logical volumes" than "physical volumes" permit.
Thanks but I am not able to create physical volume & volume group as I am getting a message that the partition is already mounted.
Also if the /home partition is already mounted (existing partition) than how can LVM work ??
Thanks
You haven't told us very much. Is the /home partition already part of a logical volume group? What about the / partition? Are either full? Do you have any spare PV space to extend to? You haven't even told us what you've tried to produce the errors you're getting.
Thanks but I am not able to create physical volume & volume group as I am getting a message that the partition is already mounted.
OK, so if the partition is already mounted this means you've already formatted a filesystem on it; and mounted it somewhere.
Running df -kh will show exactly where its mounted - and clarify why you're getting this error.
Quote:
Also if the /home partition is already mounted (existing partition) than how can LVM work ??
OK, from this statement its pretty clear you don't have an understanding of how LVM works. At a high level you need to understand firstly how partitioning, filesystem creation and mounting works - before dipping into LVM.
LVM adds another layer of complexity which allows you to make your install more scalable in catering for growth. I suggest you search LQ as there are many threads that explain how LVM works - and I don't want to repeat a long explanation that's already been posted.
Thanks for the response
Actually I am aware of how LVM works but my question is how can I extend/create a LVM on the existing mounted partition when the partition is created at the time of making partition as / & /home are already mounted but not created under LVM.
so I just want to extend my /home dir which is already mounted & now I want to extend the size of the dir as its fully utilized.
Actually I am aware of how LVM works but my question is how can I extend/create a LVM on the existing mounted partition when the partition is created at the time of making partition as / & /home are already mounted but not created under LVM.
With respect, if you did know how LVM works you wouldn't ask this question. If you don't designate a partition as "Linux LVM" when partitioning (either at install or post-install with fdisk); then you cannot allocate this space to a volume group and thus create logical volumes.
As per syg00's post above, post more information and we may be able to help you.
I need your help for extending an LVM partition. I installed fedora 14 a while ago in one partition (probably not the best option) of 50 GB out of a 500 GB single disk. I ran out of space on the partition and I would like to increase it to fill up the whole disk. I have read the LVM info but I am not sure that I can execute those commands adapted to my particular situation without messing up my data. Here is the output of df -hT, fdisk -l, and vgdisplay.
[root@Felix mafelix]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
rootfs rootfs 49G 46G 1.9G 97% /
udev devtmpfs 1.6G 260K 1.6G 1% /dev
tmpfs tmpfs 1.6G 356K 1.6G 1% /dev/shm
/dev/mapper/vg_felix-lv_root
ext4 49G 46G 1.9G 97% /
udev devtmpfs 1.6G 260K 1.6G 1% /dev
/dev/sda1 ext4 194M 156M 29M 85% /boot
[root@Felix mafelix]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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
Disk identifier: 0x00071a01
Device Boot Start End Blocks Id System
/dev/sda1 * 63 409662 204800 83 Linux
/dev/sda2 409663 976768064 488179201 8e Linux LVM
Disk /dev/dm-0: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders, total 419430400 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
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 5586 MB, 5586812928 bytes
255 heads, 63 sectors/track, 679 cylinders, total 10911744 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
Disk identifier: 0x00000000
Disk /dev/dm-1 doesn't contain a valid partition table
[root@Felix mafelix]# vgdisplay
--- Volume group ---
VG Name vg_felix
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
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 465.56 GiB
PE Size 4.00 MiB
Total PE 119184
Alloc PE / Size 52532 / 205.20 GiB
Free PE / Size 66652 / 260.36 GiB
VG UUID 4l1n6I-3vk1-Z4bJ-jpwZ-iIIU-z7xZ-sqGoYo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.