美文网首页
centos根目录扩容

centos根目录扩容

作者: carey_ff72 | 来源:发表于2017-11-24 18:37 被阅读0次

准备工作

添加一块新硬盘/dev/sdb

$ fdisk -l

Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

查看当前更分区大小

$ df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                       50G  3.6G   44G   8% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/sda1             477M   33M  419M   8% /boot
/dev/mapper/VolGroup-lv_home
                      5.5G   12M  5.2G   1% /home

格式化新硬盘

$ fdisk /dev/sdb 

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x070d6722.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n //创建新分区
Command action
   e   extended
   p   primary partition (1-4)
p  //创建为主分区
Partition number (1-4): 1 //分区号
First cylinder (1-133674, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-133674, default 133674): 
Using default value 133674

Command (m for help): t //设置分区为lvm, 因为根分区为lvm
Selected partition 1
Hex code (type L to list codes): 8e //lvm类型
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w //保存退出
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

创建物理卷

$ pvcreate /dev/sdb1 

  Physical volume "/dev/sdb1" successfully created

查看当前卷组vgdisplay

$ vgdisplay 

  --- Volume group ---
  VG Name               VolGroup
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  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               59.51 GiB
  PE Size               4.00 MiB
  Total PE              15234
  Alloc PE / Size       15234 / 59.51 GiB
  Free  PE / Size       0 / 0   
  VG UUID               dUUORQ-j5l9-Jd4N-EFNl-N6Qc-rGWq-12QmMA

扩展卷组

$ lvextend -L +1023G /dev/VolGroup/lv_root 

  Size of logical volume VolGroup/lv_root changed from 50.00 GiB (12800 extents) to 1.05 TiB (274688 extents).
  Logical volume lv_root successfully resized

重置根分区容量

$ resize2fs /dev/VolGroup/lv_root 

resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/VolGroup/lv_root is mounted on /; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 68
Performing an on-line resize of /dev/VolGroup/lv_root to 281280512 (4k) blocks.

原文链接

相关文章

  • centos根目录扩容

    准备工作 添加一块新硬盘/dev/sdb 查看当前更分区大小 格式化新硬盘 创建物理卷 查看当前卷组vgdispl...

  • centos 根目录扩容

    添加一块磁盘参考上一篇博文VMware Workstation 添加磁盘 挂载目录(centos) 查看当前磁盘挂...

  • CentOS根目录扩容

    根目录扩容 查看目前磁盘空间使用情况 可以看到此时虽然根目录下的空间已经将近耗尽,但是home目录下依然有很大的空...

  • centos7 根目录扩容

    0, fdisk /dev/sdb [n, p, 1, size, t, 8e, w] 1, pvcreate /...

  • Centos7下扩容根目录空间

    前提:已经加了一块新的磁盘或者已经对linx原有磁盘进行了扩容但未把磁盘空间加载到linux根目录 1.fdisk...

  • centos7根目录空间扩容

    1 查看目前分区状况 2 新增分区,选择primary分区 3 刷新分区 4 将新分区加入vg中 5 扩展根卷lv...

  • centos7 下根目录扩容操作

    root目录默认35G扩容到120G 1、查看本机磁盘环境 可以看到根目录总容量为35G, 设备sda 的总容量为...

  • 2019-01-17 Centos7 LVM XFS 分区大小调

    我有一台 CentOS7 使用了默认分区大小, 现在由于业务需要, 根目录50G空间明显不够了需要扩容 目标: 先...

  • Centos7 一些配置

    基于LVM的根目录扩容Firewall 防火墙配置-指定IP终端访问服务器和开通PING功能Centos7通过re...

  • ubuntu 扩容 根目录

    windows 下面进行扩容,是件很难的事情。如果想要扩容C盘,必须先要清空一个盘,格式化,等等操作。ubuntu...

网友评论

      本文标题:centos根目录扩容

      本文链接:https://www.haomeiwen.com/subject/atbfbxtx.html