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.

I have EC2 instance running, executing command df -h in the putty i get the following result

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.9G  9.4G   11M 100% /
tmpfs                 854M     0  854M   0% /lib/init/rw
varrun                854M   80K  854M   1% /var/run
varlock               854M     0  854M   0% /var/lock
udev                  854M  104K  854M   1% /dev
tmpfs                 854M     0  854M   0% /dev/shm
/dev/sda2             147G  188M  140G   1% /mnt

It shows that I am running out of space in /dev/sda1, but have 140G free space in /dev/sda2. I am new to linux and EC2 hosting, so can you please solve my following queries

  1. What is /dev/sda1 and /dev/sda2 ??
  2. How can i utilize the space in dev/sda2 ??
  3. How to know total how much space I have ???
share|improve this question

2 Answers 2

up vote 1 down vote accepted

/dev/sda1 and /dev/sda2 are descriptors for filesystems. In order to have those filesystems available to you in linux, they have to be mounted to a specific location (/dev/sda2 is mounted as /mnt, for example). Anything you put in the /mnt directory will be stored on /dev/sda2 and will count against the 147G of space you have available there.

You are already aware of df -h - this is what I use to tell how much space I have available.

share|improve this answer

Assuming /dev/sda2 is empty, you may want to move whatever data fills /dev/sda1 there, I suppose. The process goes something like this. Assuming it is /home filling /dev/sda1:

mount /dev/sda2 /mnt
cp -av /home/* /mnt
mv /home /old.home
mkdir /home
umount /dev/sda2
mount /dev/sda2 /home
rm -rf /old.home

Obviously, these are dangerous commands, so backup, backup, backup. Also, doing this may cause issues if someone is trying to work with files in /home while this process goes on, so please make sure no users are logged in and no public services are running.

share|improve this answer
    
Your answer is good but as a new bee i am little afraid of performing all this task but i can do as calman suggest storing some backup files in /mnt.. thanks –  jimy Apr 8 '11 at 6:28

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.