這是我的作法 |
1. 關掉pi,回到virtualbox guest主機裡 |
下指令resize raspbian lite image |
qemu-img resize 2020-02-13-raspbian-buster-lite.img +20G |
再執行boot.sh啟動pi |
|
2.登入pi 砍掉partition2 後,再重建出來 |
root@raspberrypi:/usr/local/freetds/bin# fdisk /dev/sda |
|
Welcome to fdisk (util-linux 2.33.1). |
Changes will remain in memory only, until you decide to write them. |
Be careful before using the write command. |
|
|
Command (m for help): d |
Partition number (1,2, default 2): 2 |
|
Partition 2 has been deleted. |
|
Command (m for help): p |
Disk /dev/sda: 21.7 GiB, 23324524544 bytes, 45555712 sectors |
Disk model: QEMU HARDDISK |
Units: sectors of 1 * 512 = 512 bytes |
Sector size (logical/physical): 512 bytes / 512 bytes |
I/O size (minimum/optimal): 512 bytes / 512 bytes |
Disklabel type: dos |
Disk identifier: 0x738a4d67 |
|
Device Boot Start End Sectors Size Id Type |
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA) |
|
Command (m for help): n |
Partition type |
p primary (1 primary, 0 extended, 3 free) |
e extended (container for logical partitions) |
Select (default p): p |
Partition number (2-4, default 2): |
First sector (2048-45555711, default 2048): 524288 |
|
Sector 524288 is already allocated. |
First sector (532480-45555711, default 532480): |
Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-45555711, default 45555711): |
|
Created a new partition 2 of type 'Linux' and of size 21.5 GiB. |
Partition #2 contains a ext4 signature. |
|
Do you want to remove the signature? [Y]es/[N]o: N |
|
Command (m for help): p |
|
Disk /dev/sda: 21.7 GiB, 23324524544 bytes, 45555712 sectors |
Disk model: QEMU HARDDISK |
Units: sectors of 1 * 512 = 512 bytes |
Sector size (logical/physical): 512 bytes / 512 bytes |
I/O size (minimum/optimal): 512 bytes / 512 bytes |
Disklabel type: dos |
Disk identifier: 0x738a4d67 |
|
Device Boot Start End Sectors Size Id Type |
/dev/sda1 8192 532479 524288 256M c W95 FAT32 (LBA) |
/dev/sda2 532480 45555711 45023232 21.5G 83 Linux |
|
Command (m for help): w |
The partition table has been altered. |
Failed to remove partition 2 from system: Device or resource busy |
Failed to add partition 2 to system: Device or resource busy |
|
The kernel still uses the old partitions. The new table will be used at the next reboot. |
Syncing disks. |