Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Initially i had EBS boot as AMI image with 10GB EBS volume. Then i created new 20Gb EBS volume and then attached that to old instance and booted

Then i see that i still have 10GB mounted as /dev/xvda1

Then i follow this tut

http://blog.linuxacademy.com/linux/resizing-root-partition-on-linux-in-amazon-ec2/

i did this

sudo  resize2fs /dev/xvda1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 2620603 blocks long.  Nothing to do!

$ sudo su
[root@ip-]# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/xvda1               10077      7096      2470  75% /
none                       828         1       828   1% /dev/shm
/dev/xvdb2              144578        33    144545   1% /mnt/ephemeral

what to do next

This is my lsblk output

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvda    202:0    0    20G  0 disk
`-xvda1 202:1    0    10G  0 part /
xvdb    202:16   0 149.1G  0 disk
|-xvdb1 202:17   0   7.9G  0 part [SWAP]
`-xvdb2 202:18   0 141.3G  0 part /mnt/ephemeral
share|improve this question

2 Answers 2

It sounds like you created a new device (probably called /dev/xvdc). You'd have to create a filesystem on that then mount it.

UPDATE: You need to understand the relationship between the block device, the partition and the filesystem. The block device is the physical layout of the disk. Partitions are a way to carve up disks into logically-separated chunks. Filesystems are where your files actually go, there's generally a one-to-one relationship between partitions and filesystems. You expanded the physical disk:

xvda    202:0    0    20G  0 disk

... But your xvda1 partition is still 10G:

`-xvda1 202:1    0    10G  0 part /

If this wasn't AWS, you would just boot into a LiveCD and expand the partition. As it stands, there's probably no good way to expand that partition. Amazon does some magic with partitions and takes care of the tricky stuff when you create instances from your AMIs. You'll have to make an AMI, launch a new instance from that AMI, and specify the new size in the wizard.

Once the instance is running you'd expand the filesystem (again, not the same thing as the partition, which Amazon will extend for you magically).

share|improve this answer
    
I have also edited the question and added the lsblk output. what to do next. can u give me some commands on what to do. –  Pandora Jul 10 '13 at 2:03
    
@Pandora Updated the answer with details. –  Joel E Salas Jul 10 '13 at 2:11
    
I tried as you said but lsblk again shows me same output. i did mention 20GB in there but i get same output. i have terminated my old instance and volume as welkl –  Pandora Jul 10 '13 at 2:45
    
I had created a new partiion /dev/xvda2 but i was not able to increase the size of root partition –  Pandora Jul 10 '13 at 4:11

I ran across this problem some time ago, and remembered finding this blog post which helped me through this. I can't guarantee this still works, but it did work for me a couple of years ago, so you might want to give it a shot. The principles behind it are sound.

http://alestic.com/2010/02/ec2-resize-running-ebs-root

All credit goes to @eric-hammond

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.