香橙派sd卡扩容

1. 香橙派sd卡扩容

最近购买了香橙派zero,发现烧写完程序后,sd卡的容量只有2G不到,可是我用的sd卡是16G,经过网上查阅资料,和测试,并把扩容过程记录下来。

2. orangepizero扩容

  • 环境烧写的是orangepizero的ubuntu系统
  • sd卡为16G

以下为扩容记录:

orangepi@orangepizero:~$ sudo fdisk /dev/mmcblk0
[sudo] password for orangepi:

Welcome to fdisk (util-linux 2.27.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: 14.4 GiB, 15502147584 bytes, 30277632 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: 0xdf942937

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1       40960  143359  102400   50M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      143360 2416639 2273280  1.1G 83 Linux

Command (m for help): d #删除
Partition number (1,2, default 2): 2 #/dev/mmcblk0p2

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): 2 #/dev/mmcblk0p2
First sector (2048-30277631, default 2048): 143360 #起始扇区 参考上面的start,是多少填多少
Last sector, +sectors or +size{K,M,G,T,P} (143360-30277631, default 30277631): 30277631 #结尾扇区,使用它给的default

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

Command (m for help): w #写入
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).


orangepi@orangepizero:~$ sudo reboot -f #重启
Rebooting.


orangepi@orangepizero:~$ sudo resize2fs /dev/mmcblk0p2 #释放空间,输入后需要等待一会儿
[sudo] password for orangepi:
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p2 is now 3766784 (4k) blocks long.

orangepi@orangepizero:~$ df -lh  #查看/dev/mmcblk0p2,果然扩容了
Filesystem      Size  Used Avail Use% Mounted on
udev            116M     0  116M   0% /dev
tmpfs            24M  2.5M   22M  11% /run
/dev/mmcblk0p2   15G  774M   13G   6% /
tmpfs           120M     0  120M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           120M     0  120M   0% /sys/fs/cgroup
/dev/mmcblk0p1   50M   18M   33M  35% /boot
tmpfs            24M     0   24M   0% /run/user/1000
orangepi@orangepizero:~$


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GeekFong

记录不易,坚持更新

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值