Ext2resize is a tool that can increase/decrease the ext2/ext3 file system. There are two commands after installation: ext2resize and ext2online, ext2resize.
You must unmount the file system before you can use it. Ext2online can reset the file system size online.
The following is a demonstration of the specific operation. This is the test server we developed. Because there is not enough space, we need to expand the space online now.
First of all, ext2resize
[root @ SVR-d b-test ~]# wget FTP://FTP . pbone . net/mirror/FTP 5 . gwdg . de/pub/opensuse/repositories/home:/janptitan/SLE _ 10/x86 _ 64/ ext 2 resize- 1. 1. 19-3. 1.x86 _ 64 . rpm
2. install ext2resize
[root @ SVR-d b-test ~]# rpm-IVH ext 2 resize- 1. 1. 19-3. 1 . x86 _ 64 . rpm
3. Create a physical volume PV
[root @ SVR-d b-test ~]# pvcreate/dev/sdb 1
4. Add the added pv to the volume group to be expanded (VolGroup_ID_20886).
[root @ SVR-d b-test ~]# vgextend vol group _ ID _ 20886/dev/sdb 1
5. Check the space usage of the existing system.
[root@svr-db-test ~]# df -h
File system? Capacity? Used Available Used% Mount Point
/dev/mapper/vol group _ ID _ 20886-logvol 1
3.9G? 2.2G? 1.6G? 60% /
/dev/sda3 190M? 26M? 156M? 14%/ boot
tmpfs 3.9G 0? 3.9G? 0% /dev/shm
/dev/mapper/vol group _ ID _ 20886-log vol 2
3.9G? 137M? 3.6G? 4% /tmp
/dev/mapper/vol group _ ID _ 20886-log vol 5
24G? 3.4G? 19G? 16%/ USA
/dev/mapper/vol group _ ID _ 20886-log vol 4
3.9G? 2. 1G? 1.7G? 57% /var
/dev/mapper/vol group _ ID _ 20886-LogVolHome
95G? 8 1G? 9.4G? 90%/ home
6. Increase the space of logical volume (/dev/volgroup _ ID _ 20886/logvolhome).
[root @ SVR-d b-test ~]# lvextend-L+20000m/dev/vol group _ ID _ 20886/LogVolHome
Expand the logical volume LogVolHome to 1 15.50 GB.
The logical volume LogVolHome was successfully resized.
You have new mail in /var/spool/mail/root.
7. Online file system extension/home directory
[root @ SVR-d b-test ~]# ext 2 online/dev/vol group _ ID _ 20886/LogVolHome
For EXT2FS 0.5b, ext2online v1.1.18-20065438+0/03/18.
8. Check the disk space after online expansion.
[root@svr-db-test ~]# df -h
File system? Capacity? Used Available Used% Mount Point
/dev/mapper/vol group _ ID _ 20886-logvol 1
3.9G? 2.2G? 1.6G? 60% /
/dev/sda3 190M? 26M? 156M? 14%/ boot
tmpfs 3.9G 0? 3.9G? 0% /dev/shm
/dev/mapper/vol group _ ID _ 20886-log vol 2
3.9G? 137M? 3.6G? 4% /tmp
/dev/mapper/vol group _ ID _ 20886-log vol 5
24G? 3.4G? 19G? 16%/ USA
/dev/mapper/vol group _ ID _ 20886-log vol 4
3.9G? 2. 1G? 1.7G? 57% /var
/dev/mapper/vol group _ ID _ 20886-LogVolHome
1 14G? 8 1G? 28G? 75%/ home
[root@svr-db-test ~]#
9.? /home's space has been changed? 9.4 grams to 28 grams
-End-