![GPT根分区无法增长;选项?](https://linux22.com/image/219604/GPT%E6%A0%B9%E5%88%86%E5%8C%BA%E6%97%A0%E6%B3%95%E5%A2%9E%E9%95%BF%EF%BC%9B%E9%80%89%E9%A1%B9%EF%BC%9F.png)
我的磁盘上有以下分区,并且磁盘末尾有大量可用空间。我需要扩大根分区以占据大部分空间(一些用于交换)而不丢失分区内容。鉴于GPT分区表,无法增长根分区(sda5)。我有哪些选择?是否可以将其转换为 LVM 或移动其他分区等。我们将非常感谢您的帮助。
[root@abcd]# df -kh
Filesystem Size Used Avail Use% Mounted on
devtmpfs 12G 0 12G 0% /dev
tmpfs 12G 0 12G 0% /dev/shm
tmpfs 12G 656K 12G 1% /run
tmpfs 12G 0 12G 0% /sys/fs/cgroup
/dev/sda5 3.8G 2.2G 1.5G 60% /
/dev/sda6 966M 120K 900M 1% /tmp
/dev/sda7 22G 378M 20G 2% /var
/dev/sda4 6.7G 54M 6.3G 1% /opt
/dev/sda2 474M 141M 305M 32% /boot
/dev/sda1 2.0G 6.8M 2.0G 1% /boot/efi
tmpfs 2.4G 0 2.4G 0% /run/user/1000
[root@abcd]# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 644GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2098MB 2097MB fat32 EFI System Partition boot, esp
2 2098MB 2622MB 524MB ext4
3 2622MB 11.0GB 8389MB linux-swap(v1) swap
4 11.0GB 18.4GB 7340MB ext4
5 18.4GB 22.5GB 4194MB ext4
6 22.5GB 23.6GB 1049MB ext4
7 23.6GB 47.2GB 23.6GB ext4
(parted) p free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 644GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 2098MB 2097MB fat32 EFI System Partition boot, esp
2 2098MB 2622MB 524MB ext4
3 2622MB 11.0GB 8389MB linux-swap(v1) swap
4 11.0GB 18.4GB 7340MB ext4
5 18.4GB 22.5GB 4194MB ext4
6 22.5GB 23.6GB 1049MB ext4
7 23.6GB 47.2GB 23.6GB ext4
47.2GB 644GB 597GB Free Space
[root@abcd]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 600G 0 disk
|--sda1 8:1 0 2G 0 part /boot/efi
|--sda2 8:2 0 500M 0 part /boot
|--sda3 8:3 0 7.8G 0 part [SWAP]
|--sda4 8:4 0 6.9G 0 part /opt
|--sda5 8:5 0 3.9G 0 part /
|--sda6 8:6 0 1000M 0 part /tmp
|--sda7 8:7 0 22G 0 part /var
sr0 11:0 1 1024M 0 rom