0

我是 OrangePI PC 的新手。我已经在我的 macOS 上通过 dd 安装了它,并且我尝试在 Windows 中安装从 orangepi.org 下载的 Raspbian 图像,安装后当我检查可用磁盘空间时它显示:

root@orangepi:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          3.4G  2.7G  474M  86% /
/dev/root       3.4G  2.7G  474M  86% /
devtmpfs        374M     0  374M   0% /dev
tmpfs           101M  188K  101M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           201M     0  201M   0% /run/shm
/dev/mmcblk0p1   41M  4.9M   37M  12% /boot

我已经将它安装在 32G 闪存驱动器上。但是当我通过fdisk命令检查它时,它显示 32G 作为磁盘大小:

root@orangepi:~# sudo fdisk -l

Disk /dev/mmcblk0: 32.0 GB, 32010928128 bytes
4 heads, 16 sectors/track, 976896 cylinders, total 62521344 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: 0x34605ba5

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1           40960      124927       41984   83  Linux
/dev/mmcblk0p2          124928     7170047     3522560   83  Linux
root@orangepi:~# 

如何解决这个问题?

4

1 回答 1

0

这解决了我的问题(解决方案取自这里):

root@orangepi:~# fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 15.8 GB, 15804137472 bytes
4 heads, 16 sectors/track, 482304 cylinders, total 30867456 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: 0x34605ba5

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1           40960      124927       41984   83  Linux
/dev/mmcblk0p2          124928     7170047     3522560   83  Linux

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-30867455, default 2048): 124928
Last sector, +sectors or +size{K,M,G} (124928-30867455, default 30867455): 
Using default value 30867455

Command (m for help): w

然后退出(命令 q),重新启动。然后,您将能够使用调整大小:

resize2fs /dev/root
于 2018-07-31T07:25:52.403 回答