Ubuntu硬盘大小不正确

我正在运行ubuntu 12.04 64bit。 我使用dd命令将我的80gb驱动器(文件系统)克隆到干净的500gb。 它完美无缺。 之后,我取出了80gb,换成新的500gb。 它完美启动,整个文件系统就是这样。 但是,当我右键单击目录并单击属性或我tupe df -h时,它显示只有10gb可用空间。 但是,在磁盘实用程序中,它显示500gb作为文件系统,似乎没有任何错误。 我怎样才能让ubuntu看到新硬盘上有超过10GB的可用空间?

编辑:

这是我在gparted中得到的结果,然后是右键单击目录时的矛盾结果 在此处输入图像描述 并选择属性:

如果使用dd一个驱动器复制到另一个驱动器 ,则分区表将按原样从一个驱动器复制到另一个驱动器,因此所有分区的大小与旧驱动器上的分区大小完全相同。 新驱动器的其余部分是未分配的空间。

您需要从Ubuntu LiveCD / USB启动并使用gparted 调整分区大小 。

以下是gparted未分配空间的外观示例:

在此处输入图像描述

如果您将整个设备发送到另一个设备 ,例如dd if=/dev/sda of=/dev/sdb ,则上述情况属实。 如果您首先在目标驱动器上创建分区,然后将分区从一个驱动器复制到另一个驱动器(类似于dd if=/dev/sda1 of=/dev/sdb1 ),则目标驱动器上的分区表是正确的(即它有一个~500Gb的分区,但是,该分区上的文件系统与源驱动器上的文件系统大小相同。

要调整ext4分区的大小,您需要使用resize2fs命令。

  resize2fs [ -fFpPM ] [ -d debug-flags ] [ -S RAID-stride ] device [ size ] The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 and ext4.). The size parameter specifies the requested new size of the filesystem. If no units are specified, the units of the size parameter shall be the filesystem blocksize of the filesystem. Optionally, the size parameter may be suffixed by one of the following the units designators: 's', 'K', 'M', or 'G', for 512 byte sectors, kilobytes, megabytes, or gigabytes, respectively. The size of the filesystem may never be larger than the size of the partition. If size parameter is not specified, it will default to the size of the partition. 

有关详细信息,请参阅man resize2fs