首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在/home 7中添加一个新的硬盘以扩展CentOS分区

在/home 7中添加一个新的硬盘以扩展CentOS分区
EN

Server Fault用户
提问于 2017-04-07 13:40:46
回答 1查看 3.7K关注 0票数 0

我的服务器上有一个新的硬盘(一个2TB驱动器)。我想将这2TB添加到我当前的/home分区中。

df -h输出

代码语言:javascript
复制
[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       193G  982M  182G   1% /
devtmpfs         16G     0   16G   0% /dev
tmpfs            16G     0   16G   0% /dev/shm
tmpfs            16G  9.7M   16G   1% /run
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/sda3       1.6T   69M  1.6T   1% /home
tmpfs           3.2G     0  3.2G   0% /run/user/0

fdisk -l的输出:

代码语言:javascript
复制
[root@localhost ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1           40         2048  1004.5K  BIOS boot parti bios_grub-sda
 2         4096    409602047  195.3G  Linux filesyste primary
 3    409602048   3890638847    1.6T  Linux filesyste primary
 4   3890638848   3907020799    7.8G  Linux swap      primary

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

请有人告诉我,如何将这个新的2TB添加到我当前的/home分区中,并使其成为3.6TB分区?谢谢

EN

回答 1

Server Fault用户

发布于 2017-04-07 13:51:19

非常简短的形式,因为这在SF和其他地方都有广泛的记录:

  • 将新磁盘作为物理卷添加到新的LVM卷组(pvcreatevgcreate)
  • 在此VG (lvcreate)上创建一个新的逻辑卷和文件系统
  • 将数据从当前/home复制到这个新卷
  • 将新卷挂载为新的/home (将当前卷放在前面)
  • 确保/etc/fstab引用/home挂载点的新设备。
  • /dev/sda3转换为LVM物理卷,
  • 将其添加到卷组中
  • 增长/home逻辑卷,然后是文件系统。

在执行上述任何操作之前,请确保您的系统具有最新的备份。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/843256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档