Growing a CentOS Root Partition on an AWS EC2 Instance: Difference between revisions
From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
(Created page with "== Growing a CentOS Root Partition on an AWS EC2 Instance == * Install the [http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm EPEL6 repo] * Install th...") |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Developer Info#AWS_Tips | <<< Back to Developer Info]] | |||
* Install the [http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm EPEL6 repo] | * Install the [http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm EPEL6 repo] |
Latest revision as of 21:44, 10 April 2017
<<< Back to Developer Info
- Install the EPEL6 repo
- Install the cloud-utils-growpart package:
[bash]# yum install cloud-utils-growpart
- Determine the root partition device using the lsblk command:
[bash]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 150G 0 disk └─xvda1 202:1 0 8G 0 part /
- Grow the root partition:
[bash]# growpart /dev/xdva 1
- At this point lsblk will not show a change, but if you use parted you'll see that the deed has indeed been done:
[bash]# parted GNU Parted 2.1 Using /dev/xvda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) unit s (parted) print Model: Xen Virtual Block Device (xvd) Disk /dev/xvda: 314572800s Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 2048s 314568764s 314566717s primary ext4 boot
- The only thing remaining is to resize the filesystem. This will be done automatically by the cloud-init tools after a reboot:
[bash]# reboot now
- When the system is back up, login and use lsblk to confirm your change:
[bash]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 150G 0 disk └─xvda1 202:1 0 150G 0 part /
- WOOT! Many thanks to this autoresize article by Dimitrios Liappis for this most excellent process.