0

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 ???
jimy
  • 177
  • 2
  • 3
  • 8

2 Answers2

2

/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.

calman
  • 1,150
  • 8
  • 6
0

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.

Bittrance
  • 3,070
  • 3
  • 24
  • 27
  • 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 08 '11 at 06:28