安裝好Lubuntu後,預設只會有4G大小

所以我們進入系統後,要先resize一下

先用fdisk指令來看pardition(很重要,一定要先查,等等會用到)

以下都是直接使用root

fdisk -l

出現下方資訊(這邊是已經resize好的)

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders, total 31116288 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: 0x2b1c25d6

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

接著我們就進入/dev/mmcblk0

fdisk -c /dev/mmcblk0

進入之後先使用p來看分割區

Command (m for help): p

Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes
4 heads, 16 sectors/track, 486192 cylinders, total 31116288 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: 0x2b1c25d6

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

然後按d去刪除本來的/dev/mmcblk0p2(這邊就不描述,這邊只有兩個分區,所以一定是2)

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

然後使用n來重新分割,再依序往下做,除了sector的數字要注意是一開始查詢的/dev/mmcblk0p2之外,其他幾乎都是預設

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

最後一步是用w來將結果寫入磁碟,這邊就不動作了。

跳出來後,重新開機一次。

然後再用root去下

resize2fs /dev/mmcblk0p2

這樣就會將完整個空間都使用了。