Linux在线硬盘扩容的几种解决办法
2014-02-10 22:33
429 查看
贴一篇自己写的Linux在线硬盘扩容的几种解决办法,算是经验总结吧。 注:转帖请注明出处!
If disk space not enough issue can't be fixed by deleted unused or unnecessary temp files. We could use resize2fs command to extend the disk space on line, will not infect the system. I neatened a guide in details about how to extend the disk space on line including the normal situation and abnormal status here. resize2fs - ext2/ext3/ext4 file system resize, listed on different RHEL system, the according command. Ps. Should use root account do the admin operation. On RHEL6 # e.g. /sbin/resize2fs/dev/vg00/lvol9 On RHEL5 # e.g. /sbin/resize3fs/dev/vg00/lvol9 On RHEL4 # e.g. /sbin/ext2online/dev/vg00/lvol9 The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an un-mounted file system located on device. If the file system is mounted, it can be used to expand the size of the mounted file system, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for file-systems mounted using ext3 only). Using the command to check the kernel version # uname -r 2.6.32-71.el6.x86_64 Normal Situation 1. Extended the disk space on line: # /sbin/tune2fs -l /dev/mapper/vg00-lvol9 //To check how much space we can extend. # /usr/sbin/vgdisplay //To check whether it can be extended or not. Free PE / Size 30354 / 118.57 GiB # df -h /opt //To check where it will be extended Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lvol9 50G 0G 50G 100% /opt # /usr/sbin/lvextend -L+5G /dev/mapper/vg00-lvol9 //Extend on line. # /sbin/resize2fs /dev/vg00/lvol9 //To take it into effect Abnormal Situation 1. Situation when device is busy # fuser -m /opt //identify processes using files or sockets /opt: 1244c 2721c 16747c 19635c # kill -9 1244 2721 16747 19635 //kill all the processes. # umount /opt //umount the directory # /sbin/resize2fs /dev/vg00/lvol9 resize2fs 1.35 (28-Feb-2004) Please run 'e2fsck -f /dev/vg00/lvol9' first. # e2fsck -f /dev/vg00/lvol9 //To check ext2|ext3|ext4 file system correctness! e2fsck 1.35 (28-Feb-2004) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/vg00/lvol9: 1406312/6553600 files (2.8% non-contiguous), 12277130/13107200 blocks # /sbin/resize2fs /dev/vg00/lvol9 resize2fs 1.35 (28-Feb-2004) Resizing the filesystem on /dev/vg00/lvol9 to 14417920 (4k) blocks. The filesystem on /dev/vg00/lvol9 is now 14417920 blocks long. # mount /opt # df -h /opt Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lvol9 55G 47G 5.4G 90% /opt 2. Situation when volume group mapper doesn't exist… # /usr/sbin/lvextend -L+5G /dev/mapper/vg00-lvol9 Volume group mapper doesn't exist # /usr/sbin/lvextend -L+5G /dev/vg00/lvol9 3. Situation when iNode of '/' directory is full… # df -ih//To check the iNode usage touched 100% or not. If it is. Extended / directory first, after that then adding others disk space. <p></p><pre code_snippet_id="182965" snippet_file_name="blog_20140210_1_8231303">
相关文章推荐
- linux挂载硬盘重启后出现an error occurred during the file system check错误最有效的解决办法(转)
- FreeBSD/Linux 中避免/etc/resolv.conf 被改写的几种解决办法的比较
- FreeBSD/Linux 中避免 /etc/resolv.conf 被改写 + 几种解决办法的比较 !
- Linux挂载NTFS硬盘错误解决办法
- FreeBSD/Linux 中避免 /etc/resolv.conf 被改写 + 几种解决办法的比较 !
- 在linux字体下的显示问题及几种解决办法
- 在Linux上删除大容量文件后硬盘空间大小还不变,解决办法
- FreeBSD/Linux 中避免 /etc/resolv.conf 被改写 + 几种解决办法的比较 !
- linux挂载硬盘重启后出现an error occurred during the file system check错误最有效的解决办法
- FreeBSD/Linux 中避免 /etc/resolv.conf 被改写 + 几种解决办法的比较 !
- linux 主机名被修改成bogon问题的几种解决办法
- linux硬盘大分区的解决办法
- 解决CentOS/Ubuntu/Fedora/RHEL Linux下硬盘切换到AHCI模式后无法启动的办法
- linux挂载硬盘重启后出现an error occurred during the file system check错误最有效的解决办法
- 润乾报表在linux字体下的显示问题及几种解决办法
- 删除Linux分区导致系统无法启动的解决办法
- linux环境下,双击直连ping私有地址时候出现Destination host unreachable 解决办法
- Linux 2.6.x 内核模块加载错误 “Invalid module format” 解决办法
- wps for linux显示系统缺失字体解决办法
- linux下出现connect failed: Permission denied错误的解决办法