LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-07-2020, 06:38 PM   #1
sesto77
LQ Newbie
 
Registered: Mar 2020
Posts: 1

Rep: Reputation: Disabled
resize disk/partition in centos 7


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.
 
Old 03-07-2020, 07:47 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
Old 03-07-2020, 08:09 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,159

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Redhat has an excellent LVM guide - I'm sure CentOS still has references to the RH doco.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How To Resize an Existing Hard Disk Partition Using the Boot Disk TracyTiger Slackware 6 10-13-2014 11:48 AM
problem after copying 250GB disk to 1TB disk (cannot resize the old EXTENDED) pabelmont Linux - Newbie 5 02-04-2013 08:38 AM
LVM Resize - After logical resize, FS size does not match physical size. spectra Linux - Software 6 11-01-2006 11:28 AM
How to do this: move image1, resize image1, move image2, resize image2, etc xmrkite Linux - Software 14 10-05-2006 01:26 PM
Disk Partition Resize Trouble and Partition Questions GNewbie Linux - Newbie 2 11-15-2005 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration