平頭哥Sipeed LicheeRV 86開發(fā)板分配root分區(qū)非常小,使用起來不方便,
最近在網(wǎng)上看到一篇關(guān)于《SD卡中Linux系統(tǒng)擴(kuò)容》的文章,想想給我們的“平頭哥Sipeed LicheeRV 86開發(fā)板”也分配一下空間,讓使用起來方便一下(當(dāng)然要編譯文件系統(tǒng)時(shí),可以設(shè)置,但重新編譯系統(tǒng),非常慢 )
1 SD卡中Linux系統(tǒng)擴(kuò)容
SD中的Linux系統(tǒng)擴(kuò)容,參考https://www.lxx1.com/4744
1.1 確定SD卡的盤符
將SD卡插到讀卡器中,借助ubuntu開發(fā)電腦來進(jìn)行系統(tǒng)的擴(kuò)容。
首先確認(rèn)下sd卡的盤符:
未插入SD卡, 查看一下ls /dev/sd*
sun@sun-ubuntu:~$ ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda5
插SD卡后, 用df -h
發(fā)現(xiàn)SD增加設(shè)備是/dev/sdb,/dev/sdbn是SD卡的分區(qū), 我們要擴(kuò)容的/dev/sdb7分區(qū)就是tina(licheeRV86 帶Linux系統(tǒng))的根root分區(qū)。
1.2 卸載分區(qū)并重新分區(qū)
使用如下指令卸載磁盤并使用fdisk重新分區(qū):
umount?/dev/sdb7
sudo fdisk /dev/sdb
不會用工具,首先要 查看幫助, 輸入m
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
然后輸入p(p ? print the partition table)來查看當(dāng)前分區(qū)情況:
記住/dev/sdb7分區(qū)的開始扇區(qū)(我的是100432,等會要用到)
1.3 刪除分區(qū)并重建分區(qū)
刪除分區(qū):
- d
選擇刪除分區(qū)7:
- 7
然后新建分區(qū):
- n
起始扇區(qū)選擇原來的點(diǎn):
- 100432
最后一個(gè)扇區(qū)選擇默認(rèn):
- enter
接著提示是否移除分區(qū)的簽名“,選擇否:
- N
存剛才的分區(qū):
- w
1.4 使分區(qū)修改生效
sudo?e2fsck?/dev/sdb7
sudo resize2fs /dev/sdb7
1.5 查看分區(qū)后的效果
以上就完成了SD卡口Linux的根(root)分區(qū)擴(kuò)容,將SD卡重新插回到板子中查看:
可以看到擴(kuò)容成功了。