How to extend Linux file system after increasing my EBS volume on my EC2 instance
[root@anurag ~]#
[root@anurag ~]#
[root@anurag ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 10G 0 disk
├─xvda1 202:1 0 1M 0 part
└─xvda2 202:2 0 10G 0 part /
xvdb 202:16 0 20G 0 disk /u01/oracle
xvdc 202:32 0 20G 0 disk /u01/oradata
xvdd 202:48 0 8G 0 disk /u01/FRA
[root@anurag ~]#
[root@anurag ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/xvda2 10G 4.3G 5.7G 44% /
/dev/xvdc 7.9G 5.8G 1.7G 78% /u01/oradata
/dev/xvdd 7.9G 1.5G 6.0G 20% /u01/FRA
/dev/xvdb 7.9G 7.4G 0 100% /u01/oracle
tmpfs 378M 0 378M 0% /run/user/1002
tmpfs 378M 0 378M 0% /run/user/1000
[root@anurag ~]#
[root@anurag ~]#
[root@anurag ~]# resize2fs /dev/xvdb
resize2fs 1.45.4 (23-Sep-2019)
Filesystem at /dev/xvdb is mounted on /u01/oracle; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
The filesystem on /dev/xvdb is now 5242880 (4k) blocks long.
[root@anurag ~]#
[root@anurag ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/xvda2 10G 4.3G 5.7G 44% /
/dev/xvdc 7.9G 5.8G 1.7G 78% /u01/oradata
/dev/xvdd 7.9G 1.5G 6.0G 20% /u01/FRA
/dev/xvdb 20G 7.5G 12G 40% /u01/oracle
tmpfs 378M 0 378M 0% /run/user/1002
tmpfs 378M 0 378M 0% /run/user/1000
[root@anurag ~]#
[root@anurag ~]# resize2fs /dev/xvdc
resize2fs 1.45.4 (23-Sep-2019)
Filesystem at /dev/xvdc is mounted on /u01/oradata; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
The filesystem on /dev/xvdc is now 5242880 (4k) blocks long.
[root@anurag ~]#
[root@anurag ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 17M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/xvda2 10G 4.3G 5.7G 44% /
/dev/xvdc 20G 5.8G 14G 31% /u01/oradata
/dev/xvdd 7.9G 1.5G 6.0G 20% /u01/FRA
/dev/xvdb 20G 7.5G 12G 40% /u01/oracle
tmpfs 378M 0 378M 0% /run/user/1002
tmpfs 378M 0 378M 0% /run/user/1000
[root@anurag ~]#
[root@anurag ~]#