Solved

Linux Partitions Resize

Posted on 2014-10-13
6
463 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 62

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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 62

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Economy of Scale - IT Business 4 156
Certificate Request CentOS/Apache 1 50
Cannot seems to get SSHD running CentOS 6.5 3 37
NFS v4 7 70
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

740 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