Friday, 15 April 2016

How to increase size of a file system ?


STEP 1. Check the file system
# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-root_lv
              ext4   1008M  229M  728M  24% /
tmpfs        tmpfs    499M     0  499M   0% /dev/shm
/dev/sda1     ext4    248M   32M  204M  14% /boot
/dev/mapper/rootvg-home_lv
              ext4   1008M   45M  913M   5% /home
/dev/mapper/infravg-images_lv
              ext4    2.0G  1.2G  730M  62% /images
/dev/mapper/rootvg-opt_lv
              ext4    504M   61M  418M  13% /opt
/dev/mapper/rootvg-system_lv
              ext4    124M   11M  107M  10% /system
/dev/mapper/rootvg-tmp_lv
              ext4   1008M  139M  819M  15% /tmp
/dev/mapper/rootvg-usr_lv
              ext4    2.0G  787M  1.2G  42% /usr

STEP 2. Identify the File system for which, the size to be increased
For example, You need to increase the space for /dev/mapper/rootvg-opt_lv by adding additional space of 1 GB.


STEP 3. Run following command to increase space for a file system :
# lvextend -L +1G /dev/mapper/rootvg-opt_lv
Syntax : # lvextend -L +SIZE FILESYSTEM


STEP 4. Resize the partition
# resize_reiserfs /dev/mapper/rootvg-opt_lv
OR
# ext2online -d -v /dev/mapper/rootvg-opt_lv
OR
# resize2fs -p /dev/mapper/rootvg-opt_lv


Check the file system again
# df -hT
/dev/mapper/rootvg-opt_lv
              ext4    1.5G   61M  1.4G   5% /opt



Extending the size of logical volume

# df -hT
/dev/mapper/rootvg-opt_lv
              ext4    504M  250M  229M  53% /opt


SUCCESSFULLY DONE WITH FOLLOWING COMMANDS :
# lvextend -L +500M /dev/mapper/rootvg-opt_lv
# resize2fs -p /dev/mapper/rootvg-opt_lv

AFTER
# df -hT
/dev/mapper/rootvg-opt_lv
              ext4   1008M  251M  706M  27% /opt

No comments:

Post a Comment

Note: only a member of this blog may post a comment.