Work environment : Running redhat linux server which is having two disk sda and sdb
/dev/sda has configured lvm (xfs) will all reqular file systems such as /home, /root, /tmp, etc.
/dev/sdb is and additional disk which is 800 GB this was pationined using ext4, and mounted the hole sdb to a file system called /www
now the requirement is to increase the /www size 800 GB to 1.2 TB. from storage level we have increased the size of the secondary disk sdb -800 GB to 1.2 TB.
after reboot the server # fdisk -l /dev/sdb will reflect the resized size. but mounted file system is not showing updated size.
#df -h /www
/etc/fstab entry we could see the /www got mounted using their disk uuid
# cat /etc/fstab
/dev/disk/by-uuid/0dkdkfjkkui-bokdjkf-kdjfk-hfueu8r9uf /www auto nosuid,nodev,nofail,x-gvfs-show 0 0
we can check uuid using # blkid
ok coming to the core so now resize the file system size using below command
# resize2fs /dev/sdb
then the block size got resized online basis with complete size get resized. then the # df -h /www size got increased automatically
//some useful command for this artical
# mount -a
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 79G 0 part
├─rhel_-root 253:0 0 15G 0 lvm /
├─rhel_-swap 253:1 0 8G 0 lvm [SWAP]
├─rhel_-home 253:2 0 15G 0 lvm /home
├─rhel_ var 253:3 0 13G 0 lvm /var
├─rhel_-opt 253:4 0 13G 0 lvm /opt
├─rhel_-tmp 253:5 0 8G 0 lvm /tmp
└─rhel_spare 253:6 0 7G 0 lvm /spare
sr0 11:0 1 1024M 0 rom
//if it was lvm then
# xfs_growfs -d /dev/sdb
0 Comments