AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 560724
Accepted
garconcn
garconcn
Asked: 2013-12-12 09:27:17 +0800 CST2013-12-12 09:27:17 +0800 CST 2013-12-12 09:27:17 +0800 CST

扩展 Raid 后在 CentOS 上调整 XFS 的大小

  • 772

我在使用 xfs 文件系统的 Raid 6 阵列上有一个 16Tb 分区。

# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sdc1      xfs     15T  7.4T  7.2T  51% /backup

在添加了几个磁盘后,我使用 LSI Megaraid 工具重建了 Raid,在 Megaraid 中虚拟驱动器已从 16TB 扩展到 29TB。但是,当我尝试扩展 xfs 系统时,大小并没有改变。命令“xfs_growfs /backup”立即返回,没有任何变化。

# xfs_growfs /backup
meta-data=/dev/sdc1              isize=256    agcount=15, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=3906469376, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

我试过分开,它也无法检测到新尺寸。

(parted) print /dev/sdc
Model: LSI MR9271-4i (scsi)
Disk /dev/sdc: 16.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  16.0TB  16.0TB  xfs          primary

以前,我按照此说明创建 XFS 分区。我没有使用LVM。

https://unix.stackexchange.com/questions/29078/how-to-partition-22tb-disk

更新 我刚刚重新启动了服务器,现在我可以使用 parted 看到分区是 32TB,但是我无法使用 xfs_grow 调整文件系统的大小。Parted 工具不支持 xfs。

# parted /dev/sdc
GNU Parted 2.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print /dev/sdc
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)?
parted: invalid token: /dev/sdc
Fix/Ignore/Cancel?
Fix/Ignore/Cancel? fix
Warning: Not all of the space available to /dev/sdc appears to be used, you can fix the GPT to use all of the space (an extra 31251759104 blocks) or continue with the current setting?
Fix/Ignore? fix
Model: LSI MR9271-4i (scsi)
**Disk /dev/sdc: 32.0TB**
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
1      1049kB  16.0TB  16.0TB  xfs          primary

(分开)

centos
  • 2 2 个回答
  • 10963 Views

2 个回答

  • Voted
  1. Best Answer
    ewwhite
    2013-12-12T10:41:24+08:002013-12-12T10:41:24+08:00

    您需要修改分区表以利用 LUN 扩展提供的空间。使用fdisk,这通常是删除分区并使用相同的起点和新的终点重新创建它。侧面可能也是如此parted。

    完成此操作后,您可以重新启动或使用类似的工具partprobe(假设已安装的设备未在使用中),完成后,安装文件系统并运行xfs_growfs /mountpoint. XFS 增长工具仅适用于已挂载的文件系统。

    • 4
  2. c4f4t0r
    2013-12-12T11:03:22+08:002013-12-12T11:03:22+08:00

    如果您使用带有 lvm 且没有分区的 lun,您可以通过如下简单的方式进行操作:

    1. echo 1 > /sys/block/sdc/device/rescan
    2. pvresize /dev/sdc
    3. lvresize或者lvextend你的 lvm 卷
    4. xfs_growfs
    • 1

相关问题

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 使用 crontab 和 /etc/cron.hourly,daily,weekly 的区别

  • 持续监控许多服务器运行状况的简单方法?

  • Hudson 无法在 tomcat5 中启动

  • CentOS 的依赖挑战

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve