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
