LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reduce root partition space on ec2 AWS (https://www.linuxquestions.org/questions/linux-newbie-8/reduce-root-partition-space-on-ec2-aws-4175561574/)

unclesamcrazy 12-15-2015 11:48 PM

Reduce root partition space on ec2 AWS
 
I have 64Gb root partition space on ec2 AWS. The instance is centOS 6.7.
Here is output of df -h
Code:

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      64G    12G  52G  19%  /
none            1.9G    0  1.9G  0% /dev/shm

Here is the output of lsblk
Code:

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  64G  0 disk
└─xvda1 202:1    0  64G  0 part /

I will never use this much space, I want to reduce it up to 30 GB.
Please help me to achieve this.

Note : I can not take help from AWS support

Keruskerfuerst 12-16-2015 02:31 AM

1. Make a backup of the data contained of /(root)
2. Use Gparted: http://sourceforge.net/projects/gpar...d-live-stable/

unclesamcrazy 12-16-2015 04:20 AM

Quote:

Originally Posted by Keruskerfuerst (Post 5464948)
1. Make a backup of the data contained of /(root)

where should I keep backup?
Quote:

Originally Posted by Keruskerfuerst (Post 5464948)

I am not facing problem on my local system which can be solved by gparted, I am facing this on ec2 AWS
Can you please help to tell me, how can I use gparted on ec2-AWS?

syg00 12-16-2015 04:44 AM

More than 100 views - they're all probably like me thinking "why can't s?he talk to AWS support ?".
Hmmm.

Cutting 30 Gig out ain't any use unless you can use it elsewhere. You gunna give us some info, or are you just going to accept you are likely not to get any (more) help ?.
What filesystem is that partition ?.

berndbausch 12-16-2015 05:34 AM

Quote:

Originally Posted by unclesamcrazy (Post 5464981)
where should I keep backup?

I'd create a volume (or whatever that is called in AWS), attach it to the instance, perform the backup, recreate the instance, restore, delete the volume.

This is a cloud, no need to allocate LUNs on disk arrays, pull cables, set up iSCSI targets and the like. Easy!

unclesamcrazy 12-16-2015 06:03 AM

Thanks I have done this. I created a snapshot of 64GB volume > create volume of 30 Gb from this snap shot > stop instance > detach old volume > attach new volume > start instance.
But here is the problem, instance does not start with new created volume, connection time out issue.
Now I revert back to the old volume, it starts successfully.

unclesamcrazy 12-16-2015 06:23 AM

...

Habitual 12-16-2015 09:46 AM

I think you need to create a new instance for the "30 Gb from this snap" volume and mount that as/at 30G / on the new instance.

Reference: http://serverfault.com/questions/565...e-ec2-instance
and as usual,
http://docs.aws.amazon.com/AWSEC2/la...ce-resize.html


All times are GMT -5. The time now is 06:21 PM.