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.
I have a Centos 7.1 server (no gui).
Im trying to figure out how to extend the partition since its getting full.
output are:
fdisk /dev/sdb
Disk /dev/sdb: 392.2 GB, 392227192832 bytes, 766068736 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 label type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 63 314572799 157286368+ 8e Linux LVM
/dev/sdb2 314572800 524287999 104857600 8e Linux LVM
lvdisplay -v
Using logical volume(s) on command line.
Finding all volume groups.
--- Logical volume ---
LV Path /dev/home/lv_home
LV Name lv_home
VG Name home
LV UUID yGcPFq-WUqZ-56aE-bDXs-Asqd-TnFM-jIQkAa
LV Write Access read/write
LV Creation host, time manualweb01.c2.se, 2014-08-29 12:57:25 +0200
LV Status available
# open 1
LV Size 249.99 GiB
Current LE 63998
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID LWhI39-sHUg-5XBd-R9F3-xOcG-zEJh-Jjbm0i
LV Write Access read/write
LV Creation host, time localhost, 2014-08-29 14:08:29 +0200
LV Status available
# open 1
LV Size 19.53 GiB
Current LE 5000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID lqSGE3-2m2E-EH1Q-c5na-tCi6-nHpT-lNsQB2
LV Write Access read/write
LV Creation host, time localhost, 2014-08-29 14:08:30 +0200
LV Status available
# open 2
LV Size 7.81 GiB
Current LE 2000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/centos/tmp
LV Name tmp
VG Name centos
LV UUID fd1GbH-eZfp-m7sR-MyWL-JQcK-PyWK-Sl8twn
LV Write Access read/write
LV Creation host, time localhost, 2014-08-29 14:08:31 +0200
LV Status available
# open 1
LV Size 1.95 GiB
Current LE 500
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/var
LV Name var
VG Name centos
LV UUID qd4Q9V-9z9x-bLNX-XEyW-vzkf-nNVM-GtrxFo
LV Write Access read/write
LV Creation host, time localhost, 2014-08-29 14:08:32 +0200
LV Status available
# open 1
LV Size 20.50 GiB
Current LE 5248
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:4
partitions are xfs.
Anyone have any ideas on how to extend this? Its /dev/home/lv_home that i want to extend.
Your output would be so much easier to read if you had formatted it as code. In case you want to reformat your question, see my signature for instructions.
To extend a logical volume, use commands vgs or vgsdisplay to see if there is any free space. Then run lvextend with the appropriate size option, either upper-case -L or lower-case -l.
If there is not enough free space in the volume group, you can try to grow the underlying physical volume(s). If the logical volume in question is located on /dev/sdb, parted or gparted may be able to help, but partitions can only be grown if there is free space directly next to them. Or add a physical volume to the volume group; the command is vgextend.
Once the logical volume has the desired size, use xfs_growfs to adjust the size of the filesystem. Be aware that XFS can only be grown, not shrunk.
Last edited by berndbausch; 03-07-2020 at 07:53 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.