orangepi扩展磁盘大小

最近在搞香橙派的开发板的时候,发现烧录进去的系统的磁盘空间很小,所以我们要开发的时候往往要扩展磁盘空间,所以想记录下来以后开发板的扩展也可以参考。具体过程如下:

root@orangepi:/home/orangepi# fdisk /dev/mmcblk0
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-31481855, default 2048): 124928
, +sectors or +size{K,M,G} (124928-31481855, default 31481855): 31481855

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 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)
Syncing disks.

到了此步之后千万记得要关机重启。

然后继续输入命令:

ororangepi@orangepi:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for orangepi: 
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 3873920 blocks long.

orangepi@orangepi:~$ df -h
df: ‘/media/orangepi/F875-EAED’: Permission denied
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  2.8G   12G  20% /
devtmpfs        168M  4.0K  168M   1% /dev
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none             50M  676K   49M   2% /run
none            5.0M     0  5.0M   0% /run/lock
none            248M   72K  248M   1% /run/shm
none            100M   24K  100M   1% /run/user

最后看到size那里变大了表示扩容成功。

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值