Using GNU parted to create a GPT for a device

本文介绍了如何使用GNUparted工具在CentOS v5虚拟机上为大于2TB的XFS文件系统创建GPT分区。由于MBR分区表无法支持超过2TB的分区,故采用GPT分区表来突破这一限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Using GNU parted to create a GPT for a device > 2TB

Howto create a partitioned device on a CentOS v5 VM for a XFS filesystem greater than 2TB in size

Using a MBR (master boot record) style partition table it is not possible to have a partition larger than 2TB. Use a GPT (Guid Partition table) to overcome this limitation.

# parted /dev/xvdc
(parted) mklabel gpt
(parted) mkpart primary xfs 0 ­-0
(parted) quit

And create the XFS filesystem with a label of '/files'.

# mkfs.xfs -L /files /dev/xvdc1

 

Links

Appendices

 

GPT label, parted output (no filesystem)

Once the filesystem was created, the 'File system' column shows XFS.

(parted) print

Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdc: 3588GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      17.4kB  3588GB  3588GB               primary

MBR partition table fdisk output

Note: The first partition is 2TB in size.

# fdisk /dev/xvdc

Command (m for help): p

Disk /dev/xvdc: 3588.4 GB, 3588491313152 bytes
255 heads, 63 sectors/track, 436275 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdc1               1      267349  2147480811   83  Linux
# parted /dev/xvdc
GNU Parted 1.8.1
Using /dev/xvdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print

Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdc: 3588GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  2199GB  2199GB  primary  xfs
Document Actions

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值