Solved

Linux Partitions Resize

Posted on 2014-10-13
6
455 Views
Last Modified: 2014-10-15
OK, I have a VPS server CentOS 6.5 , we have 100GB drive space available but when it was provisioned the partitions were setup as smaller partitions.

I'm not confident enough to resize these without some help.
So yeah, Help please!!!!

Preferably I would like to expand
/ -> 10GB
/usr -> 10GB
/var - > 10GB
/home -> 50GB

Below is some outputs that might be useful, I would like a guide of the commands, and maybe a link to some good reading material to let me figure out how this all works cause it seems pretty confusing to me.

Thanks in Advanced

[root@mx3 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            4.0G  795M  3.2G  20% /
/dev/mapper/vg00-usr  4.0G  1.5G  2.4G  39% /usr
/dev/mapper/vg00-var  4.0G  693M  3.1G  19% /var
/dev/mapper/vg00-home
                      4.0G  233M  3.6G   7% /home
none                  1.5G   64K  1.5G   1% /tmp

[root@mx3 ~]# fdisk -l

Disk /dev/xvda: 100.0 GB, 100000595968 bytes
255 heads, 63 sectors/track, 12157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xad2b2367

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1               1         523     4200966   83  Linux
/dev/xvda2             524         785     2104515   82  Linux swap / Solaris
/dev/xvda3             786       12157    91345590   8e  Linux LVM

Disk /dev/mapper/vg00-usr: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg00-var: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg00-home: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@mx3 ~]#  cat /etc/fstab
/dev/xvda1      /               ext3    defaults,noatime        1 1
/dev/xvda2      none            swap    sw
/dev/vg00/usr   /usr            ext4    defaults,noatime        0 2
/dev/vg00/var   /var            ext4    defaults,usrquota,noatime       0 2
/dev/vg00/home  /home           ext4    defaults,usrquota,noatime       0 2
#/dev/hdd/data  /data           ext4    defaults,usrquota,noatime       0 2
devpts          /dev/pts        devpts  gid=5,mode=620  0 0
none            /proc           proc    defaults        0 0
none            /tmp    tmpfs   defaults        0 0
[root@mx3 ~]#  pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/xvda3 vg00 lvm2 a--  87.11g 75.11g
[root@mx3 ~]# pvscan
  PV /dev/xvda3   VG vg00   lvm2 [87.11 GiB / 75.11 GiB free]
  Total: 1 [87.11 GiB] / in use: 1 [87.11 GiB] / in no VG: 0 [0   ]

Open in new window

0
Comment
Question by:tetrauk
6 Comments
 
LVL 10

Expert Comment

by:Rafael
ID: 40376867
I would do this using Gparted (http://gparted.sourceforge.net/).  Although I've never done it on Cent OS, I've used it on Redhat, Ubuntu, and a few others.  In all cases it has been the same process.  Here is a link with step by step details http://en.kioskea.net/faq/2036-how-to-resize-a-partition-using-gparted-on-linux.

You can also use Mondo Rescue to clone your partition before resizing http://comptia.idglabs.net/?p=4079

-HTH

-Rafael
0
 
LVL 6

Expert Comment

by:Wylie Bayes
ID: 40377024
Yep Gparted is the way to go.
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 500 total points
ID: 40378319
Install "system-config-lvm" and resize partitions to your liking.
While gparted will work, there is supported partitioner included with system that can resize live mounted filesystems without killing data.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Accepted Solution

by:
tetrauk earned 0 total points
ID: 40379331
Couldnt use Gparted as its a hosted virtual server, question was answered best on another forum http://www.linuxquestions.org/questions/showthread.php?p=5253021#post5253021

This was also useful: http://www.linuxuser.co.uk/features/resize-your-disks-on-the-fly-with-lvm
0
 
LVL 1

Author Comment

by:tetrauk
ID: 40380460
I've requested that this question be closed as follows:

Accepted answer: 0 points for tetrauk's comment #a40379331

for the following reason:

Answer provided by external source
0
 
LVL 61

Expert Comment

by:gheist
ID: 40380461
Your second link EXACTLY SUGGESTS system-config-lvm as in http:#a40378319
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now