Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Amazon EC2 instance where I have low disk space

[root@ip-10-59-143-73 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde1            5.7G  3.3G  2.3G  60% /
none                  1.9G     0  1.9G   0% /dev/shm

I added "Elastic Block" > Volumes > 5GB volume and attached to the instance ID.

I rebooted the instance and got a new disk device in /dev/

[root@ip-10-59-143-73 ~]# ll /dev/xvd*
brw-rw---- 1 root disk 202,  65 Jun 12 12:16 /dev/xvde1
brw-rw---- 1 root disk 202, 144 Jun 12 12:16 /dev/xvdj
brw-rw---- 1 root disk 202, 146 Jun 12 12:28 /dev/xvdj2 <<<< new one

[root@ip-10-59-143-73 ~]# cat /proc/partitions
major minor  #blocks  name

 202       65    6291456 xvde1  <<<< Old 6GB volume
 202      144  419395584 xvdj
 202      146    5242880 xvdj2  <<<< new one

[root@ip-10-59-143-73 ~]# mount
/dev/xvde1 on / type ext4 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

[root@ip-10-59-143-73 ~]# cat /etc/fstab
LABEL=_/   /         ext4    defaults        1 1
none       /proc     proc    defaults        0 0
none       /sys      sysfs   defaults        0 0
none       /dev/pts  devpts  gid=5,mode=620  0 0
none       /dev/shm  tmpfs   defaults        0 0

xvde1 was old one xvdj2 may be the new one.

How do I add the new disk to my usable disk space?

Follow up:

1) Clear the confusion: - Amazon EC2 does all automatic but adding disk space is not automated, it has to be manually (not like there Elastic IP or VPC like).

2) Feed

$ ll /dev/xvd*
brw-rw---- 1 root disk 202,  65 Jun 12 12:37 /dev/xvde1
brw-rw---- 1 root disk 202, 144 Jun 12 12:37 /dev/xvdj
brw-rw---- 1 root disk 202, 146 Jun 12 12:37 /dev/xvdj2

$ mkfs.ext4 /dev/xvdj
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
26214400 inodes, 104848896 blocks
5242444 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3200 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: <<< hit enter
done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

$ cat /etc/fstab # Before
LABEL=_/   /         ext4    defaults        1 1
none       /proc     proc    defaults        0 0
none       /sys      sysfs   defaults        0 0
none       /dev/pts  devpts  gid=5,mode=620  0 0
none       /dev/shm  tmpfs   defaults        0 0

$ cat /etc/fstab # After
LABEL=_/   /         ext4    defaults        1 1
none       /proc     proc    defaults        0 0
none       /sys      sysfs   defaults        0 0
none       /dev/pts  devpts  gid=5,mode=620  0 0
none       /dev/shm  tmpfs   defaults        0 0
/dev/xvdj   /volume_one  ext4  noatime  0 0

$ mkdir /volume_one
$ mount /volume_one
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvde1            5.7G  3.3G  2.3G  60% /
none                  1.9G     0  1.9G   0% /dev/shm
/dev/xvdj             394G  199M  374G   1% /volume_one
share|improve this question
1  
Is the new disk detected during boot (check your dmesg log)? Did you partition it (gpart, fdisk, ...). Did you format any of those partitions (e.g. mke2fs)? Did you add it to /etc/fstab? –  Hennes Jun 12 '13 at 16:32
    
blkfront: xvdj2: barriers disabled dmesg shows this log. I just added the volume. Thinking that Amazon automagically will manage that, cause most of the extra thing when we add it automatically add (such as Elastic IP, it auto apply the changes). So for new Disk space i was expecting they do it auto. But i dont know if it has to be manually done like you explained? –  YumYumYum Jun 12 '13 at 16:39
1  
You have the new disk, but you need to create volumes on it. First either 1a) partition the disk with gpart /dev/xvdj2. or 1B) decide to use the whole disk raw. 2) Format those volume(s). 3) Mount the newly formatted volume. Preferably automatically on reboot. For this edit the filesystem tables (e.g. vi /etc/fstab). –  Hennes Jun 12 '13 at 16:47
    
@Hennes: Thank you please see my Follow up section. Confused why its showing 374G ? i took only 5GB disk making no sense to me. What have i done wrong???? –  YumYumYum Jun 12 '13 at 17:05
1  
I do not know why it is showing 374G for xvdj. Maybe that is the total disk space which Amazon is ready to hand out to users at this location? Note that I am just guessing here. I never used an Amazon instance. My answers are from generic unix/Linux knowledge. –  Hennes Jun 12 '13 at 17:15
show 1 more comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.