Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 instance on Amazon and I am greeted with "No space left on the disk"

I have installed Amazon EC2 fedora instance and copying the files from one location to another. But I am greeted with " No space left on the disk".

I did df -f.

with output:

Filesystem            Size  Used Avail Use% Mounted on /dev/sda1              15G   15G     0 100% / none                  312M     0  312M   0% /dev/shm 

I want to increase the space for ec2 instance on amazon. Can someone help me with it?

like image 556
onkar Avatar asked May 27 '11 11:05

onkar


People also ask

What happens when EC2 runs out of memory?

Memory: EC2 instances don't have allocated swap space by default. Running out of memory can invoke the Linux Out Of Memory (OOM) manager. The OOM manager terminates processes, such as a database, web server, or the SSH service. Networking: Without networking, your system can't answer ARP requests from status checks.

Do EC2 instances come with storage?

Temporary storage: EC2 instance storage provides temporary storage for EC2 instances. Cost: The cost of these storage volumes is included in the cost of the EC2 instance. Different instances may have different storage volumes capacity, but the cost is always included in the price of the EC2 instance.


2 Answers

Here's an even easier method. (My m2.2xlarge instance was created with RedHat Linux 6.2, I discovered it had a paltry 6gb available of it's 850gb):

  1. Via ssh, check space under root: $df -h
Filesystem            Size  Used Avail Use% Mounted on /dev/xvde1              6G    6G    0G   100% / none                   17G     0   17G   0% /dev/shm 
  1. From aws console, stop the instance
  2. From aws console, detach the volume (though note the mount point under attachment info, eg /dev/sda1)
  3. From aws console, take a snapshot of the volume
  4. From aws console, create a new volume using the snapshot (using all the remaining space for the instance type, eg 825gb in my m2.2xlarge case)
  5. From aws console, attach the new volume to original mount point /dev/sda1
  6. From aws console, restart the instance and ssh back in to the instance
  7. From ssh, run resize2fs on the root Filesystem (see df -h output in step 1) [potentially not needed]

$resize2fs /dev/xvde1

  1. wait for a few minutes, possibly go and watch your buddy who is stopping all the root services etc like a boss : )
  2. observe the new cavernous mount: $df -h
Filesystem            Size  Used   Avail Use%   Mounted on /dev/xvde1            813G  3.7G    801G   1%     / none                   17G     0     17G   0%     /dev/shm 
like image 61
Riaz Rizvi Avatar answered Sep 23 '22 04:09

Riaz Rizvi


Modify volume size. From AWS Console, you can modify the size of a volume.

  1. From AWS console, open 'ELASTIC BLOCK STORE/Volume'
  2. Select your volume and Modify volume(from Actions button)
  3. Change size (e.g. 8 to 20gib)
  4. Click Modify.
  5. Reboot from EC2 Dashboard.
  6. check size is changed by df -h
like image 21
Alf Bae Avatar answered Sep 20 '22 04:09

Alf Bae