Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Linux partitions with Amazon EC2

I am relatively new to Linux. In one of our projects, we use amazon's EC2 instance for processing of some files. We upload files to S3 server after processing. EC2 instance is booted using an existing AMI

Recently I got an error no space left on disk, hence processing of files was halted. I cleaned up some older files and the processing continued.

Now when I look at available space using df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            9.9G  5.7G  3.7G  61% /
none                  3.7G     0  3.7G   0% /dev/shm
/dev/xvdb             414G  199M  393G   1% /mnt
/dev/xvdc             414G  199M  393G   1% /data

I can see my files are effecting only /dev/xvda1.

I have following queries

  1. What is the use of other partitions when I can see my files only effecting /dev/xvda1
  2. It looks like we are only using 10 GB of space effectively and other is being wasted. How can I use other space? Can I move some disk space to /dev/xvda1 or directly store files in other areas?
like image 537
Kamal Avatar asked Aug 06 '12 11:08

Kamal


1 Answers

As you can see from the output of df -h, there are two large partitions mouted on /mnt and /data respectively. I suggest that you use those partitions by processing the files in one of those directories. If you cannot move where the processing happens for some reason, you can remount the partitions in the appropriate place.

If for example your files are processed in the directory /var/mydir and you cannot change that, do the following (as root):

umount /mnt
mount /dev/xvdb /var/mydir

You can use the other partition as well of course if you prefer that.

like image 141
Lars Kotthoff Avatar answered Oct 20 '22 21:10

Lars Kotthoff