How to increase the size of a /var Filesystem on AWS EC2 centos instance

by kamal   Last Updated May 10, 2018 18:00 PM

currently i have:

xfs_info /var
meta-data=/dev/mapper/ami-var    isize=512    agcount=4, agsize=1966080 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=7864320, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=3840, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0



mount | grep xfs | grep -v selinux
/dev/mapper/ami-root on / type xfs (rw,relatime,attr2,inode64,noquota)
/dev/mapper/ami-opt on /opt type xfs (rw,nodev,relatime,attr2,inode64,noquota)
/dev/mapper/ami-home on /home type xfs (rw,nodev,relatime,attr2,inode64,noquota)
/dev/mapper/ami-tmp on /tmp type xfs (rw,nodev,relatime,attr2,inode64,noquota)
**/dev/mapper/ami-var on /var type xfs** (rw,nodev,relatime,attr2,inode64,noquota)
/dev/mapper/ami-var_log on /var/log type xfs (rw,nosuid,nodev,noexec,relatime,attr2,inode64,noquota)
/dev/xvda1 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
/dev/mapper/ami-var_log_audit on /var/log/audit type xfs (rw,nosuid,nodev,noexec,relatime,attr2,inode64,noquota)
/dev/mapper/ami-var_tmp on /var/tmp type xfs (rw,nosuid,nodev,noexec,relatime,attr2,inode64,noquota)

and:

 df -h
Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/ami-root            20G  1.4G   19G   7% /
devtmpfs                        16G     0   16G   0% /dev
tmpfs                           16G     0   16G   0% /dev/shm
tmpfs                           16G  8.4M   16G   1% /run
tmpfs                           16G     0   16G   0% /sys/fs/cgroup
/dev/mapper/ami-opt             20G  1.8G   19G   9% /opt
/dev/mapper/ami-home            10G   33M   10G   1% /home
/dev/mapper/ami-tmp             10G   33M   10G   1% /tmp
**/dev/mapper/ami-var             30G  219M   30G   1% /var**
/dev/mapper/ami-var_log         30G   34M   30G   1% /var/log
/dev/xvda1                     484M  161M  324M  34% /boot
/dev/mapper/ami-var_log_audit   20G  398M   20G   2% /var/log/audit
/dev/mapper/ami-var_tmp         10G   33M   10G   1% /var/tmp
tmpfs                          3.2G     0  3.2G   0% /run/user/1000

all filesystems are xfs

more /etc/fstab
/dev/mapper/ami-root             /                    xfs     defaults              0 0
LABEL=BOOTFS /boot                                    xfs     defaults              0 0
/dev/mapper/ami-home             /home                xfs     nodev                 0 0
/dev/mapper/ami-opt              /opt                 xfs     nodev                 0 0
/dev/mapper/ami-tmp              /tmp                 xfs     nodev                 0 0
**/dev/mapper/ami-var              /var                 xfs     nodev --grow          0 0**
/dev/mapper/ami-var_tmp          /var/tmp             xfs     nodev,nosuid,noexec   0 0
/dev/mapper/ami-var_log          /var/log             xfs     nodev,nosuid,noexec   0 0
/dev/mapper/ami-var_log_audit    /var/log/audit       xfs     nodev,nosuid,noexec   0 0

tmpfs       /dev/shm   tmpfs          rw,nosuid,nodev,seclabel,noexec       0 0

I logged into aws console, and increased the EBS Volume size to 250 GiB , but cannot find good info on how ot resize /var from 30 GiB to 120 GiB

i tried :

xfs_growfs -d /var
meta-data=/dev/mapper/ami-var    isize=512    agcount=4, agsize=1966080 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=7864320, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=3840, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data size unchanged, skipping


Related Questions



shrinking EBS volume that used as root

Updated September 06, 2017 20:00 PM

AWS - Separate Disk Partitions on Ubuntu

Updated January 14, 2016 08:00 AM

what different is there between /dev/xvdb and /dev/xvdb1

Updated September 25, 2015 07:00 AM