调整分区大小的最简单方法

调整分区大小的最简单方法

我的磁盘分区如下:

df -h给出:

Filesystem      Size  Used Avail Use% Mounted on
/dev/md1         19G   18G     0 100% /
none            4,0K     0  4,0K   0% /sys/fs/cgroup
udev             16G  4,0K   16G   1% /dev
tmpfs           3,2G  636K  3,2G   1% /run
none            5,0M     0  5,0M   0% /run/lock
none             16G  156K   16G   1% /run/shm
none            100M     0  100M   0% /run/user
/dev/md0        268M   36M  214M  15% /boot
/dev/md2        1,7T   68M  1,7T   1% /data

fdisk -l给出

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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 identifier: 0x000e19c3

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      585727      291840   fd  Linux raid  autodetect
/dev/sda2          585728    39647231    19530752   fd  Linux raid  autodetect
/dev/sda3        39647232  3725023231  1842688000   fd  Linux raid autodetect
/dev/sda4      3725023232  3907028991    91002880   82  Linux swap /Solaris

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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 identifier: 0x00026078

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      585727      291840   fd  Linux raid autodetect
/dev/sdb2          585728    39647231    19530752   fd  Linux raid autodetect
/dev/sdb3        39647232  3725023231  1842688000   fd  Linux raid autodetect
/dev/sdb4      3725023232  3907028991    91002880   82  Linux swap / Solaris

Disk /dev/md0: 298 MB, 298516480 bytes
2 heads, 4 sectors/track, 72880 cylinders, total 583040 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 identifier: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md2: 1886.8 GB, 1886778097664 bytes
2 heads, 4 sectors/track, 460639184 cylinders, total 3685113472 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 identifier: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md1: 20.0 GB, 19982581760 bytes
2 heads, 4 sectors/track, 4878560 cylinders, total 39028480 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 identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

我正在寻找将 100GB 移动到已充分利用的最简单的/dev/md2方法 /dev/md1

答案1

最简单的方法是使用 gparted。Fdisk 不是首选工具,parted(或 gparted)更好,因为它们支持较新的 gpt/efi 磁盘布局。

在终端运行中

sudo apt-get install gparted

相关内容