关于 GPT 下使用了 fdisk

2016-06-29 19:24:44 +08:00
 Uni9k

之前不小心用 fdisk 把 sda 中加了一个分区

Device Boot Start End Blocks Id System /dev/sda1 1 6528 52428799+ ee GPT /dev/sda2 6528 65270 471852475 83 Linux

然后 df -h 的话

Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-Vol_root 45G 4.0G 39G 10% / tmpfs 1.9G 228K 1.9G 1% /dev/shm /dev/sda2 190M 79M 101M 44% /boot /dev/sda1 200M 264K 200M 1% /boot/efi

我在 fdisk 中删除 sda2 会不会把 df -h 中的 sda2 给删除了啊

[root@localhost ~]# vgs VG #PV #LV #SN Attr VSize VFree VolGroup 1 2 0 wz--n- 49.61g 0 [root@localhost ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda3 VolGroup lvm2 a-- 49.61g 0

如果是 应该怎么操作啊,把这 500G 还原出来

2922 次点击
所在节点    Linux
6 条回复
fcicq
2016-06-29 19:42:07 +08:00
use testdisk or gdisk
Tink
2016-06-29 21:40:03 +08:00
你为啥不用 gdisk 呢
Uni9k
2016-06-30 10:14:11 +08:00
@fcicq
Disk /dev/sda: 1048576000 sectors, 500.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7C732A22-1471-4543-B522-6EFC1F318607
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1048575966
Partitions will be aligned on 2048-sector boundaries
Total free space is 943722429 sectors (450.0 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 411647 200.0 MiB EF00
2 411648 821247 200.0 MiB 0700
3 821248 104855551 49.6 GiB 8E00

现在还有 450G 空余的空间 怎么扩大到 3 中啊
Uni9k
2016-06-30 10:14:26 +08:00
@Tink

Disk /dev/sda: 1048576000 sectors, 500.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7C732A22-1471-4543-B522-6EFC1F318607
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1048575966
Partitions will be aligned on 2048-sector boundaries
Total free space is 943722429 sectors (450.0 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 411647 200.0 MiB EF00
2 411648 821247 200.0 MiB 0700
3 821248 104855551 49.6 GiB 8E00

现在还有 450G 空余的空间 怎么扩大到 3 中啊
fcicq
2016-06-30 14:13:30 +08:00
楼主你建的 LVM 想扩大的话再建一个 450G 的分区, 加入 VG, 最后 resize2fs 就行了. LVM 底层分区感觉上没法扩大
fcicq
2016-06-30 14:16:29 +08:00
啊. 忘了. 用 pvresize 确实可以.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/289190

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX