谷动谷力

 找回密码
 立即注册
查看: 2383|回复: 0
打印 上一主题 下一主题
收起左侧

【平头哥Sipeed LicheeRV 86开发板试用】SD卡中Linux系统根分区扩

[复制链接]
跳转到指定楼层
楼主
发表于 2022-3-15 12:02:54 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
【平头哥Sipeed LicheeRV 86开发板试用】SD卡中Linux系统根root分区扩容


平头哥Sipeed LicheeRV 86开发板分配root分区非常小,使用起来不方便,


最近在网上看到一篇关于《SD卡中Linux系统扩容》的文章,想想给我们的“平头哥Sipeed LicheeRV 86开发板”也分配一下空间,让使用起来方便一下(当然要编译文件系统时,可以设置,但重新编译系统,非常慢 )


1 SD卡中Linux系统扩容


SD中的Linux系统扩容,参考https://www.lxx1.com/4744


1.1 确定SD卡的盘符


将SD卡插到读卡器中,借助ubuntu虚拟机来进行系统的扩容。

首先确认下sd卡的盘符:

未插入SD卡, 查看一下ls /dev/sd*

  1. sun@sun-ubuntu:~$ ls /dev/sd*
  2. /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda5
复制代码

插SD卡后, 用df -h


发现SD增加设备是/dev/sdb,/dev/sdbn是SD卡的分区, 我们要扩容的/dev/sdb7分区就是tina(licheeRV86 带Linux系统)的根root分区。


1.2 卸载分区并重新分区


使用如下指令卸载磁盘并使用fdisk重新分区:

  1. umount /dev/sdb7
  2. sudo fdisk /dev/sdb
复制代码


不会用工具,首先要 查看帮助, 输入m

  1. Command (m for help): m

  2. Help:

  3.   DOS (MBR)
  4.    a   toggle a bootable flag
  5.    b   edit nested BSD disklabel
  6.    c   toggle the dos compatibility flag

  7.   Generic
  8.    d   delete a partition
  9.    F   list free unpartitioned space
  10.    l   list known partition types
  11.    n   add a new partition
  12.    p   print the partition table
  13.    t   change a partition type
  14.    v   verify the partition table
  15.    i   print information about a partition

  16.   Misc
  17.    m   print this menu
  18.    u   change display/entry units
  19.    x   extra functionality (experts only)

  20.   Script
  21.    I   load disk layout from sfdisk script file
  22.    O   dump disk layout to sfdisk script file

  23.   Save & Exit
  24.    w   write table to disk and exit
  25.    q   quit without saving changes

  26.   Create a new label
  27.    g   create a new empty GPT partition table
  28.    G   create a new empty SGI (IRIX) partition table
  29.    o   create a new empty DOS partition table
  30.    s   create a new empty Sun partition table

复制代码


然后输入p(p   print the partition table)来查看当前分区情况:


记住/dev/sdb7分区的起点(我的是100432,等会要用到)


1.3 删除分区并重建分区


删除分区:

  • d

选择删除分区7:

  • 7

然后新建分区:



起始扇区选择原来的点:

  • 100432

最后一个扇区选择默认:

  • enter

接着提示是否移除分区的签名“,选择否:

  • N

存刚才的分区:

  • w


1.4 使分区修改生效

  1. sudo e2fsck /dev/sdb7
复制代码


  1. sudo resize2fs /dev/sdb7
复制代码





1.5 查看分区后的效果


以上就完成了Linux的分区扩容,将SD卡重新插回到板子中查看:


可以看到扩容成功了。


扩容隐藏分区,另多空间回来,请参考: 【平头哥Sipeed LicheeRV 86开发板试用】扩展外部sd卡存
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-4-25 08:41 , Processed in 0.078755 second(s), 38 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表