linux恢复树莓派内存卡容量,树莓派4B扩展存储卡剩余空间操作记录

pi@raspbian:~$ sudo fdisk /dev/mmcblk0

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): p

Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 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

Disklabel type: dos

Disk identifier: 0x7134b5bb

Device         Boot  Start      End  Sectors  Size Id Type

/dev/mmcblk0p1 *      2048   526335   524288  256M  c W95 FAT32 (LBA)

/dev/mmcblk0p2      526336 16777215 16250880  7.8G 83 Linux

Command (m for help): d

Partition number (1,2, default 2): 2

Partition 2 has been deleted.

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 (526336-124735487, default 526336):

Last sector, +/-sectors or +/-size{K,M,G,T,P} (526336-124735487, default 124735487):

Created a new partition 2 of type 'Linux' and of size 59.2 GiB.

Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: n

Command (m for help): w

The partition table has been altered.

Syncing disks.

pi@raspbian:~$ sudo reboot

pi@raspbian:~$ sudo resize2fs /dev/mmcblk0p2

resize2fs 1.44.5 (15-Dec-2018)

Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required

old_desc_blocks = 1, new_desc_blocks = 4

The filesystem on /dev/mmcblk0p2 is now 15526144 (4k) blocks long.

pi@raspbian:~$ df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/root        59G  7.1G   49G  13% /

devtmpfs        1.9G     0  1.9G   0% /dev

tmpfs           1.9G   12K  1.9G   1% /dev/shm

tmpfs           1.9G   17M  1.9G   1% /run

tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup

/dev/mmcblk0p1  256M   69M  188M  27% /boot

tmpfs           386M     0  386M   0% /run/user/1000

OK,成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值