CentOS6 调整硬盘分区大小?
时间:2016-03-23 10:02 来源:互联网 作者:网络 阅读:℃
内容摘要:
调整硬盘分区大小 想增加root空间,减少home空间。 1.查看硬盘使用情况。 [root@npm~]#df-hFilesystemSizeUsedAvailUse%Mountedon/dev/mapper/VolGroup-lv_root48G45G17M100%/tmpfs246M0246M0%/dev/shm/dev/sda1485M33M427M8%/boot/dev/mapper/VolGroup-lv_h
调整硬盘分区大小
想增加root空间,减少home空间。 本文来自Q淘网 www.qqaiqin.com
qqaiqin.com
1.查看硬盘使用情况。
[root@npm ~]# df -h Filesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root 48G 45G 17M 100% /tmpfs 246M 0 246M 0% /dev/shm/dev/sda1 485M 33M 427M 8% /boot/dev/mapper/VolGroup-lv_home 50G 180M 47G 1% /home本文来自Q淘网 www.qqaiqin.com
本文来自Q淘网 www.qqaiqin.com
2.调整home分区大小
[root@npm ~]# umount /home[root@npm ~]# e2fsck -f /dev/mapper/VolGroup-lv_home e2fsck 1.41.12 (17-May-2010)第一步: 检查inode,块,和大小 第二步: 检查目录结构 第3步: 检查目录连接性 Pass 4: Checking reference counts 第5步: 检查簇概要信息 /dev/mapper/VolGroup-lv_home: 11/3303104 files (0.0% non-contiguous), 253351/13207552 blocks[root@npm ~]# resize2fs -p /dev/mapper/VolGroup-lv_home 2G resize2fs 1.41.12 (17-May-2010)Resizing the filesystem on /dev/mapper/VolGroup-lv_home to 524288 (4k) blocks. Begin pass 2 (max = 32768)正在重定位块 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Begin pass 3 (max = 404)正在扫描inode表 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/mapper/VolGroup-lv_home is now 524288 blocks long.[root@npm ~]# mount /home[root@npm ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 48G 45G 17M 100% / tmpfs 246M 0 246M 0% /dev/shm /dev/sda1 485M 33M 427M 8% /boot /dev/mapper/VolGroup-lv_home 2.0G 152M 1.8G 8% /home 本文来自Q淘网 www.qqaiqin.com
本文来自Q淘网
3.释放空间
[root@npm ~]# lvreduce -L 2G /dev/mapper/VolGroup-lv_home WARNING: Reducing active and open logical volume to 2.00 GiB THIS MAY DESTROY YOUR DATA (filesystem etc.)Do you really want to reduce lv_home? [y/n]: y Reducing logical volume lv_home to 2.00 GiB Logical volume lv_home successfully resized [root@npm ~]# df -h Filesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root 48G 45G 16M 100% / tmpfs 246M 0 246M 0% /dev/shm /dev/sda1 485M 33M 427M 8% /boot /dev/mapper/VolGroup-lv_home 2.0G 152M 1.8G 8% /home [root@npm ~]# vgdisplay --- Volume group --- VG Name VolGroup System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size 99.51 GiB PE Size 4.00 MiB Total PE 25474 Alloc PE / Size 13088 / 51.12 GiB Free PE / Size 12386 / 48.38 GiB VG UUID ILLwIo-pQ0o-2Ayw-fYcP-QhcW-A1id-Sozp1f本文来自Q淘网 www.qqaiqin.com
copyright qqaiqin.com
4.增加空余空间到root
[root@npm ~]# lvextend -L +48.38G /dev/mapper/VolGroup-lv_root
Rounding size to boundary between physical extents: 48.38 GiB
Extending logical volume lv_root to 96.54 GiB
Logical volume lv_root successfully resized
[root@npm ~]# resize2fs -p /dev/mapper/VolGroup-lv_rootresize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 7Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 25307136 (4k) blocks.
The filesystem on /dev/mapper/VolGroup-lv_root is now 25307136 blocks long.
[root@npm ~]# df -hFilesystem Size Used Avail Use% Mounted on/dev/mapper/VolGroup-lv_root 96G 45G 46G 50% /
tmpfs 246M 0 246M 0% /dev/shm
/dev/sda1 485M 33M 427M 8% /boot
/dev/mapper/VolGroup-lv_home 2.0G 152M 1.8G 8% /home Q淘网游戏攻略站
相关内容
- ·windows系统下oracle数据库定时自动备份
- ·CentOS6 调整硬盘分区大小?
- ·windows IIS日志文件太多太大耗尽C盘空间
- ·win2k3 iis服务器C盘空间不足满被IIS日志
- ·PHP判断文件内容是否存在的方法?
- ·如何开启apache的gzip功能?
- ·如何使用Xftp连接Centos服务器?
- ·邮件地址混淆 你没权限访问整个邮件地址
- ·SQLSERVER 中GO的作用详解!
- ·解决IIS8.5中ASP上传大文件出现 Request
- ·wordpress添加文章发表具体时间的方法!
- ·Windows下SVNServer安装与配置详解!
- ·windows下svn服务器快速搭建图文教程!
- ·Windows Server 2012 R2 预览版安装全程
- ·windows server 2008 R2 禁用ipv6和隧道
- ·IIS6.0 IIS7.5应用程序池自动停止的解决
热点资讯TOP
- ·windows server 2008 R2 禁用ipv6和隧...
- ·如何使用Xftp连接Centos服务器?...
- ·解决IIS8.5中ASP上传大文件出现 Reques...
- ·linux下mysql如何自动备份shell脚本!...
- ·wordpress添加文章发表具体时间的方法!...
- ·windows下svn服务器快速搭建图文教程!...
- ·Windows Server 2012 R2 预览版安装全...
- ·Windows下SVNServer安装与配置详解!...
- ·IIS6.0 IIS7.5应用程序池自动停止的解...
- ·windows IIS日志文件太多太大耗尽C盘空...
- ·邮件地址混淆 你没权限访问整个邮件地...
- ·mysql字符集和数据库引擎修改方法分享 ...
- ·SQLSERVER 中GO的作用详解!...
- ·恢复sql server 2000误删数据的解决办...
- ·修改MySQL的数据库引擎为INNODB的方法!...
- ·win2k3 iis服务器C盘空间不足满被IIS日...