北京SEO

linux 逻辑卷管理 调整分区大小例子

2019/10/10/17:46:19  阅读:1909  来源:谷歌SEO算法  标签: 5G标准出炉

文章就是一个关于linux 逻辑卷管理 调整分区大小例子,我们只要按下面代码操作就完成100%完成逻辑卷管理 调整分区大小了.

测试机各种报错,创建个目录都报错,df看了一下,发现VolGroup-lv_root 100%,虚拟磁盘满了,怎么办呢.

1,解决过程

  1. #df-h//查看分区
  2. #umount/home//取消挂载
  3. #e2fsck-f/dev/mapper/VolGroup-lv_home//分区检测
  4. #resize2fs-p/dev/mapper/VolGroup-lv_home100G//将lv_home虚拟分区设为100G
  5. #mount/home//挂载home
  6. #df-h//查看分区
  7. #lvreduce-L100G/dev/mapper/VolGroup-lv_home//释放空间
  8. #vgdisplay//查看可用空间大小
  9. #lvextend-L+311.47G/dev/mapper/VolGroup-lv_root//扩展lv_root虚拟分区
  10. #resize2fs-p/dev/mapper/VolGroup-lv_root//lv_root重设分区大小
  11. LVM(逻辑磁盘管理),灵活性很高.

2,详细解决过程

  1. [root@localhost~]#df-h
  2. FilesystemSizeUsedAvailUse%Mountedon
  3. /dev/mapper/VolGroup-lv_root50G47G16M100%///lv_root满了
  4. tmpfs1.9G72K1.9G1%/dev/shm
  5. /dev/sda1485M40M420M9%/boot
  6. /dev/mapper/VolGroup-lv_home406G19G366G5%/home//lv_home空间很多
  7. [root@localhost~]#resize2fs-p/dev/mapper/VolGroup-lv_home100G
  8. resize2fs1.41.12(17-May-2010)
  9. Filesystemat/dev/mapper/VolGroup-lv_homeismountedon/home;on-lineresizingrequired
  10. On-lineshrinkingfrom107865088to65536000notsupported.//先umount才能resize2fs
  11. [root@localhost~]#umount/home//umounthome目录
  12. [root@localhost~]#resize2fs-p/dev/mapper/VolGroup-lv_home100G
  13. resize2fs1.41.12(17-May-2010)
  14. 请先运行'e2fsck-f/dev/mapper/VolGroup-lv_home'.//提示要先进行磁盘检测
  15. [root@localhost~]#e2fsck-f/dev/mapper/VolGroup-lv_home
  16. e2fsck1.41.12(17-May-2010)

第一步:检查inode,块,和大小

第二步:检查目录结构

第3步:检查目录连接性

Pass 4:Checking reference counts

第5步:检查簇概要信息

  1. /dev/mapper/VolGroup-lv_home:1459/16384000files(4.0%non-contiguous),5914204/65536000blocks
  2. [root@localhost~]#resize2fs-p/dev/mapper/VolGroup-lv_home100G//重定大小
  3. resize2fs1.41.12(17-May-2010)
  4. Resizingthefilesystemon/dev/mapper/VolGroup-lv_hometo26214400(4k)blocks.
  5. Beginpass2(max=32768)

正在重定位块 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Begin pass 3 (max = 2000)

正在扫描inode表 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  1. Thefilesystemon/dev/mapper/VolGroup-lv_homeisnow26214400blockslong.
  2. [root@localhost~]#mount/home/
  3. [root@localhost~]#df-h
  4. FilesystemSizeUsedAvailUse%Mountedon
  5. /dev/mapper/VolGroup-lv_root50G47G16M100%/
  6. tmpfs1.9G72K1.9G1%/dev/shm
  7. /dev/sda1485M40M420M9%/boot
  8. /dev/mapper/VolGroup-lv_home99G19G75G20%/home
  9. [root@localhost~]#lvreduce-L100G/dev/mapper/VolGroup-lv_home//释放空间
  10. WARNING:Reducingactiveandopenlogicalvolumeto100.00GiB
  11. THISMAYDESTROYYOURDATA(filesystemetc.)
  12. Doyoureallywanttoreducelv_home?[y/n]:y
  13. Reducinglogicalvolumelv_hometo100.00GiB
  14. Logicalvolumelv_homesuccessfullyresized
  15. [root@localhost~]#df-h
  16. FilesystemSizeUsedAvailUse%Mountedon
  17. /dev/mapper/VolGroup-lv_root50G47G16M100%/
  18. tmpfs1.9G72K1.9G1%/dev/shm
  19. /dev/sda1485M40M420M9%/boot
  20. /dev/mapper/VolGroup-lv_home99G19G75G20%/home
  21. [root@localhost~]#vgdisplay
  22. ---Volumegroup---
  23. VGNameVolGroup
  24. SystemID
  25. Formatlvm2
  26. MetadataAreas1
  27. MetadataSequenceNo5
  28. VGAccessread/write
  29. VGStatusresizable
  30. MAXLV0
  31. CurLV3
  32. OpenLV3
  33. MaxPV0
  34. CurPV1
  35. ActPV1
  36. VGSize465.27GiB
  37. PESize4.00MiB
  38. TotalPE119109
  39. AllocPE/Size39372/153.80GiB
  40. FreePE/Size79737/311.47GiB//空闲空间
  41. VGUUIDVt2V4t-Byxs-tQqk-cY0h-IDE3-pabX-LUfkRS
  42. [root@localhost~]#lvextend-L+311.47G/dev/mapper/VolGroup-lv_root//空闲空间加入到lv_root
  43. Roundingsizetoboundarybetweenphysicalextents:311.47GiB
  44. Extendinglogicalvolumelv_rootto361.47GiB
  45. Logicalvolumelv_rootsuccessfullyresized
  46. [root@localhost~]#resize2fs-p/dev/mapper/VolGroup-lv_root
  47. resize2fs1.41.12(17-May-2010)
  48. Filesystemat/dev/mapper/VolGroup-lv_rootismountedon/;on-lineresizingrequired
  49. olddesc_blocks=4,new_desc_blocks=23//这儿要耐心等待,扩大越多,时间越长
  50. Performinganon-lineresizeof/dev/mapper/VolGroup-lv_rootto94757888(4k)blocks.
  51. Thefilesystemon/dev/mapper/VolGroup-lv_rootisnow94757888blockslong.
  52. [root@localhostopenfire]#df-h
  53. FilesystemSizeUsedAvailUse%Mountedon
  54. /dev/mapper/VolGroup-lv_root356G48G308G14%/
  55. tmpfs1.9G72K1.9G1%/dev/shm
  56. /dev/sda1485M40M420M9%/boot
  57. /dev/mapper/VolGroup-lv_home99G19G75G20%/home

广告内容

linux 逻辑卷管理 调整分区大小例子 linux 逻辑卷管理 调整分区大小例子 linux 逻辑卷管理 调整分区大小例子

相关阅读

热门评论

小浪SEO博客 小浪SEO博客

专注SEO优化思维、SEO技术的实战分享类博客~

总篇数183

精选文章

RMAN中catalog和nocatalog区别介绍 小技巧:为Linux下的文件分配多个权限 zimbra8.5.1安装第三方签名ssl证书的步骤 解决mysql不能远程连接数据库方法 windows服务器mysql增量备份批处理数据库 mysql中slow query log慢日志查询分析 JavaScript跨域问题总结 Linux下负载均衡软件LVS配置(VS/DR)教程 mysql中权限参数说明 MYSQL(错误1053)无法正常启动

SEO最新算法