fdisk -l 找不到分区怎么办?想办法找到隐藏分区。

centos6.6 装系统的时候,选取系统默认分区。装好后发现少了一大部分空间,通过fdisk -l 找不到分区,另外使用 parted -l 同样找不到消失的柱面。

如:

[root@mysql]# fdisk -l



Disk /dev/sda: 1198.0 GB, 1197998080000 bytes

255 heads, 63 sectors/track, 145648 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

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

Disk identifier: 0x0009600c



   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26       15324   122880000   83  Linux

/dev/sda3           15324       15961     5120000   82  Linux swap / Solaris



[root@mysql]# parted -l

Model: LSI Logical Volume (scsi)

Disk /dev/sda: 1198GB

Sector size (logical/physical): 512B/4096B

Partition Table: msdos



Number  Start   End     Size    Type     File system     Flags

 1      1049kB  211MB   210MB   primary  ext4            boot

 2      211MB   126GB   126GB   primary  ext4

 3      126GB   131GB   5243MB  primary  linux-swap(v1)

既然找不到剩余的空间,那么我们就来重新创建分区吧!

parted /dev/sda

GNU Parted 2.1

Using /dev/sda

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

(parted)  mkpart 

Partition type?  primary/logical? p                                    

File system type?  [ext2]? ext4                                          

Start? 5244MB # 这里通过 parted -l 查看最后一个分区的end在哪里

End?    -1s        # 硬盘最后一个扇区,硬盘的最末尾处                                                                

Warning: You requested a partition from 5244MB to 1198GB.                 

The closest location we can manage is 131GB to 1198GB.

Is this still acceptable to you?

Yes/No? y                                                                 

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a

result, it may not reflect all of your changes until after reboot.

(parted) q                                                                

Information: You may need to update /etc/fstab.

然后 fdisk -l 已经发现了新的分区。新分区如果不能挂载请先格式化:mkfs.ext4 /dev/sda4 

 

你可能感兴趣的:(fdisk)