Create EBS volume on the same zone of EC2 instance created
Attach the EBS volume to the EC2 instance
# cat /proc/partitions
major minor #blocks name
202 1 8388608 xvda1
202 80 1048576 xvdf
202 96 1048576 xvdg
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdf 202:80 0 1G 0 disk /mnt/my-data
xvdg 202:96 0 1G 0 disk
xvda1 202:1 0 8G 0 disk /
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 1.1G 6.7G 14% /
devtmpfs 282M 20K 282M 1% /dev
tmpfs 297M 0 297M 0% /dev/shm
/dev/xvdf 1008M 34M 924M 4% /mnt/my-data for xvdf referenced in # lsblk output above
# sudo mkdir /u02 -- Create directory
# mkfs.ext3 /dev/xvdg -- Create filesystem for /dev/xvdg
# sudo mount /dev/xvdg /u02 -- mount newly created file system
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 1.1G 6.7G 14% /
devtmpfs 282M 20K 282M 1% /dev
tmpfs 297M 0 297M 0% /dev/shm
/dev/xvdf 1008M 34M 924M 4% /mnt/my-data
/dev/xvdg 1008M 34M 924M 4% /u02
Attach the EBS volume to the EC2 instance
# cat /proc/partitions
major minor #blocks name
202 1 8388608 xvda1
202 80 1048576 xvdf
202 96 1048576 xvdg
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdf 202:80 0 1G 0 disk /mnt/my-data
xvdg 202:96 0 1G 0 disk
xvda1 202:1 0 8G 0 disk /
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 1.1G 6.7G 14% /
devtmpfs 282M 20K 282M 1% /dev
tmpfs 297M 0 297M 0% /dev/shm
/dev/xvdf 1008M 34M 924M 4% /mnt/my-data for xvdf referenced in # lsblk output above
# sudo mkdir /u02 -- Create directory
# mkfs.ext3 /dev/xvdg -- Create filesystem for /dev/xvdg
# sudo mount /dev/xvdg /u02 -- mount newly created file system
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 1.1G 6.7G 14% /
devtmpfs 282M 20K 282M 1% /dev
tmpfs 297M 0 297M 0% /dev/shm
/dev/xvdf 1008M 34M 924M 4% /mnt/my-data
/dev/xvdg 1008M 34M 924M 4% /u02
Comments