How can I handle the fdisk command in RedHat system without using all partitions?

  
                

RedHat is a very popular Linux system. RedHat, including other Linux systems, can use the fdisk command to repartition the disk. In some cases, the fdisk command cannot use all partitions. What is going on?

Linux on RedHat7 original four primary partitions, respectively sda1, sda2, sda3, sda4, wherein sda1 primary partition, 200M, behind the three primary partitions co 40G, the three primary partitions For lvm, the current disk space is tight, because Linux can only be divided into four primary partitions, the current four primary partitions have all been occupied, if the direct deletion will lead to data loss, but fortunately the lvm done in the previous partition, in order to expand /dev/The space of the rhel/root root partition, /dev/sda3 is the smallest. Use the pvmove command to move all the data in /dev/sda3 to /dev/sda2 and then remove /dev/sda3:

Pvmove /dev/sda3 /dev/sda2

pvremove /dev/sda3

Device Boot Start End Blocks Id System

/dev/sda1 * 2048 411647 204800 83 Linux< Br>

/dev/sda2 411648 63916031 31752192 8e Linux LVM

/dev/sda4 64530432 68724735 2097152 8e Linux LVM

After the move is complete, the system is free of 300M space, in vmware Expand hard disk space to 100G, use partprobe /dev/sda, use fdisk -l to view hard disk space It has been shown to 107.4G.

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes /512 bytes

I/O size (minimum/optimal): 512 bytes /512 bytes

Disk label type: dos

Disk identifier: 0x000c5098

Then use fdisk /dev/sda to add the extended partition, use n, select the extended partition, the initial block directly returns, when you end the block, you can not enter the end sector of 209715200, you can only enter the 300M space provided by the previous system default. After the restart, the problem remains, and the added 60G space cannot be recognized. The problem is suspected because the partition is in the middle and cannot be contiguous with the subsequent lines.

Partition tool is used for partitioning

[root@ Server ~]# parted

GNU Parted 3.1

Using /dev/sda

Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) help

align-check TYPE N check partition N for TYPE(min

Copyright © Windows knowledge All Rights Reserved