December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories

WordPress Quotes

If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Recent Comments

December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (34)
Ansibile (19)
Apache (133)
Asterisk (2)
cassandra (2)
Centos (209)
Centos RHEL 7 (259)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (28)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (2)
Ldap (5)
Linux (189)
Linux Commands (167)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (22)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (31)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (34)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (60)
Uncategorized (29)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

30 visitors online now
1 guests, 29 bots, 0 members

Hit Counter provided by dental implants orange county

Increase Root Partition Size – LVM – CentOS 7 , Fedora, RHEL 7

Increase Root Partition Size – LVM – CentOS
Linux root partition is different from all other partitions on your system since it holds all of the system files required for your system to run and operate.

This is the reason why you can not increase root partition size as simply as any other partition – you can not just un-mount it because the system will not let you since it is using it.

To increase root partition size, we have to boot off a bootable live CD/DVD or USB image and increase root partition size from there and this requires SYSTEM DOWNTIME! It is not possible to increase root partition size without system downtime!

For this how to i have set up a virtual linux system and filled up it’s root partition, as you can see in the picture below. I will use CentOS ISO to boot a live system which will enable me to increase root partition size.

Let’s learn how to Increase Root Partition Size!

1. Prepare Your CentOS 7 Live CD/DVD or USB Image

Make sure you have a live CD/DVD or USB image to boot off from. In this how to i will use CentOS 7 DVD ISO image, but in the end you can do the same with Fedora, Ubuntu or any other live CD/DVD ISO image.

2. Identify Your Root Partition

Make sure you will be able to identify the root partition when in live system. Since we are increasing a LVM root partition this should be a no brainer else, the easiest way would be remembering it’s size. If you have many partitions the same size you could check the start and end blocks.

Using LVM i identified my root partition as /dev/mapper/centos-root LVM partition (centos/root) which means it is in a VG (Volume Group) called “centos” and a LV (Logical Volume) called “root”. Read more about managing LVM’s HERE.

After this, the CentOS 7 menu should appear.

Choose “Troubleshooting”

When your CentOS 7 ISO boots choose “Troubleshooting” option from the first menu.

 

Add Additional Disk

Add additional disk to your system so we can increase root partition size or make sure you have free space available on your existing disk configuration. Since i am using virtual system i added an additional 20GB disk to it which is recognized as /dev/sdb in my system

 

 

Choose “Troubleshooting”

When your CentOS 7 ISO boots choose “Troubleshooting” option from the first menu.

rootfile 001 rootfile 002

 

Choose “Rescue a CentOS system”

In the second menu choose “Rescue a CentOS System”.

 

rootfile 003

 

Skip Mounting Existing Linux Installations

When asked to find and mount any existing linux installations choose “Skip”. Since we are increasing our root partition, this partition must not be mounted.

 

rootfile 004 rootfile 005

 

 

When hiting “Enter” you will drop to bash shell.

 Prepare New Disk

Since i added a completely new 2GB disk to my virtual system i must prepare this disk for use with LVM. Read more about managing LVM’s HERE. If you are extending your root partition with existing empty partition the process is similar just use the partition identifier (sdaX or sdbX) when running commands.

Checking current disk configuration with “fdisk -l”.

rootfile 006 rootfile 007 rootfile 008

 

e must prepare new additional disk by creating a new PV (Physical Volume) and extend our VG (Volume Group) as shown in the picture below – identified in Step 2 and with fdisk, VG to extend is called “centos”. rootfile 009

rootfile 010

rootfile 011

 Increase Root Partition Size

To wrap things up we need to extend root LV with “lvextend” command. In my case i am extending it by 511 PE (as much as there are free) and i am also using the parameter “-r” at the end of my command which automatically resizes the filesystem too!

The command sytnax i used is “# lvextend -l +100%FREE centos/root -r”. DO NOT FORGET the “+” sign before PE number! If you do, you might loose data!

 

 

rootfile 014

 

Reboot the System

It is time to remove live image from CD/DVD or USB and reboot to boot our existing system. After that we can check the root partition free disk space

rootfile 015

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam