- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認(rèn)證網(wǎng)站身份V標(biāo)記
- 域名注冊服務(wù)機構(gòu)許可:滇D3-20230001
- 代理域名注冊服務(wù)機構(gòu):新網(wǎng)數(shù)碼
GPT分區(qū)擴容——以xfs文件系統(tǒng)為例
歡迎來到藍隊云技術(shù)小課堂,每天分享一個技術(shù)小知識。今天主要介紹gpt分區(qū)如何擴容
擴容已有GPT分區(qū)
parted命令主要用于 GPT分區(qū)表的操作
GPT:GPT 分區(qū)表支持更大的硬盤容量。它使用64位的邏輯塊地址,因此可以支持超過2 TB的硬盤容量
分區(qū)后擴容
以xfs文件系統(tǒng)為例
[root@localhost ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 1.9G 20M 1.9G 2% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 53G 3.2G 50G 6% /
/dev/sda1 xfs 797M 151M 647M 19% /boot
tmpfs tmpfs 378M 0 378M 0% /run/user/0
/dev/mapper/vgdata-lvdata ext4 689G 69M 658G 1% /data
/dev/sdf1 xfs 10G 33M 10G 1% /aaa
[root@localhost ~]# parted /dev/sdf
GNU Parted 3.1
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
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)?
Fix/Ignore/Cancel? fix
Warning: Not all of the space available to /dev/sdf appears to be used, you can fix the GPT to use all of the space (an extra 20971520
blocks) or continue with the current setting?
Fix/Ignore? fix
Model: VMware Virtual disk (scsi)
Disk /dev/sdf: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 10.7GB 10.7GB xfs primary
(parted) rm 1
(parted) mkpart primary 1049kB 100%
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdf: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 21.5GB 21.5GB xfs primary
(parted) quit
Information: You may need to update /etc/fstab.
[root@localhost ~]# mount /dev/sdf1 /aaa
[root@localhost ~]# xfs_growfs /aaa
meta-data=/dev/sdf1 isize=512 agcount=4, agsize=655232 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=2620928, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 2620928 to 5242368
[root@localhost ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 1.9G 20M 1.9G 2% /run
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 53G 3.2G 50G 6% /
/dev/sda1 xfs 797M 151M 647M 19% /boot
tmpfs tmpfs 378M 0 378M 0% /run/user/0
/dev/mapper/vgdata-lvdata ext4 689G 69M 658G 1% /data
/dev/sdf1 xfs 20G 33M 20G 1% /aaa
藍隊云官網(wǎng)上擁有完善的技術(shù)支持庫可供參考,大家可自行查閱,更多技術(shù)問題,可以直接咨詢。同時,藍隊云整理了運維必備的工具包免費分享給大家使用,需要的朋友可以直接咨詢。
更多技術(shù)知識,藍隊云期待與你一起探索。
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP