樹莓派4 U盤加載系統(tǒng)

樹莓派4 U盤引導(dǎo)啟動

一、硬件鏡像準(zhǔn)備

1、準(zhǔn)備Micro SD卡(8 or 16GB) 和 USB3.0 U盤1個(大于8G)
2、準(zhǔn)備鏡像
樹莓派官方Raspbian系統(tǒng)眉踱,官網(wǎng)免費下載:點這里

樹莓派鏡像

3、準(zhǔn)備燒錄工具
目前balenaEtcher支持各個平臺霜威,推薦使用給這個燒錄(下載地址:點這里)

燒錄工具

4谈喳、燒錄
解壓樹莓派鏡像得到2020-02-13-raspbian-buster.img文件,打開燒錄工具選擇image戈泼、分別選擇2個存儲設(shè)備進(jìn)行2次燒錄婿禽,完成后得到2個啟動盤。

二大猛、樹莓派4設(shè)置

1扭倾、將sd卡和U盤分別接到設(shè)備上如圖


15882969324743.jpg
15882969256677.jpg

2、用SSH連接 或者 樹莓派終端登陸
3挽绩、運行blkid查看設(shè)備信息膛壹,如下面,可以看到新版樹莓派4 SD卡和外置存儲器PARTUUID相同琼牧,所以不需要修改cmdline.txt文件

pi@raspberrypi:~ $ sudo lsblk -o name,label,partuuid
NAME        LABEL  PARTUUID
sda
├─sda1      boot   ea7d04d6-01
└─sda2      rootfs ea7d04d6-02
mmcblk0
├─mmcblk0p1 boot   ea7d04d6-01
└─mmcblk0p2 rootfs ea7d04d6-02

4恢筝、運行如下命令刪除sd卡中rootfs分區(qū)

pi@raspberrypi:~ $ 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): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): w
The partition table has been altered.
Failed to remove partition 2 from system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot.
Syncing disks.

pi@raspberrypi:~ $ sudo reboot

然后輸入‘d’,再選擇2巨坊,刪除第二分區(qū)之后撬槽,輸入‘w’。保存退出之后重啟樹莓派趾撵。
5侄柔、刪除U盤中boot分區(qū)(也可以調(diào)過
當(dāng)系統(tǒng)啟動之后執(zhí)行以下命令:

pi@raspberrypi:~ $ sudo fdisk /dev/sda

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): d
Partition number (1,2, default 2): 1

Partition 1 has been deleted.

Command (m for help): w
The partition table has been altered.
Failed to remove partition 1 from system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot.
Syncing disks.

pi@raspberrypi:~ $ sudo reboot

然后輸入‘d’,再選擇1占调,刪除第一分區(qū)之后暂题,輸入‘w’。保存退出之后重啟樹莓派究珊。

pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="6341-C9E5" TYPE="vfat" PARTUUID="ea7d04d6-01"
/dev/sda2: LABEL="rootfs" UUID="80571af6-21c9-48a0-9df5-cffb60cf79af" TYPE="ext4" PARTUUID="ea7d04d6-02"
/dev/mmcblk0: PTUUID="ea7d04d6" PTTYPE="dos"

此時內(nèi)存卡中只有個啟動分區(qū)薪者,外置儲存設(shè)備中只有rootfs系統(tǒng)分區(qū)了。

6剿涮、調(diào)整文件系統(tǒng)大小

pi@raspberrypi:~ $ sudo fdisk /dev/sda

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/sda: 28.7 GiB, 30765219840 bytes, 60088320 sectors
Disk model: Ultra Fit
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: 0xea7d04d6

Device     Boot  Start     End Sectors  Size Id Type
/dev/sda2       532480 7397375 6864896  3.3G 83 Linux

Command (m for help): q

記錄下 532480 起始 sector 后面resize時候使用言津。
接下來調(diào)整分區(qū)大小,步驟如下:

pi@raspberrypi:~ $ sudo fdisk /dev/sda

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): d
Selected partition 2
Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 2
First sector (2048-60088319, default 2048): 532480
Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-60088319, default 60088319):

Created a new partition 2 of type 'Linux' and of size 28.4 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@raspberrypi:~ $ sudo reboot

重啟后連接設(shè)備取试,查看分區(qū)大小

pi@raspberrypi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.2G  2.9G   98M  97% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  8.6M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   54M  199M  22% /boot
tmpfs           391M     0  391M   0% /run/user/1000

看到/dev/root分區(qū)大小還沒有重新調(diào)整悬槽,接下來使用resize2fs 命令來調(diào)整

pi@raspberrypi:~ $ sudo resize2fs /dev/sda2
resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/sda2 is now 7444480 (4k) blocks long.

pi@raspberrypi:~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        28G  2.9G   24G  11% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  8.6M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   54M  199M  22% /boot
tmpfs           391M     0  391M   0% /run/user/1000

經(jīng)過上面的步驟 可以看到/dev/root分區(qū)大小已經(jīng)調(diào)整過來了。
到此樹莓派4可以通過usb的rootfs啟動瞬浓,速度大大提升初婆!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子磅叛,更是在濱河造成了極大的恐慌屑咳,老刑警劉巖,帶你破解...
    沈念sama閱讀 221,888評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件弊琴,死亡現(xiàn)場離奇詭異乔宿,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)访雪,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,677評論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來掂林,“玉大人臣缀,你說我怎么就攤上這事⌒喊铮” “怎么了精置?”我有些...
    開封第一講書人閱讀 168,386評論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長锣杂。 經(jīng)常有香客問我脂倦,道長,這世上最難降的妖魔是什么元莫? 我笑而不...
    開封第一講書人閱讀 59,726評論 1 297
  • 正文 為了忘掉前任赖阻,我火速辦了婚禮,結(jié)果婚禮上踱蠢,老公的妹妹穿的比我還像新娘火欧。我一直安慰自己,他們只是感情好茎截,可當(dāng)我...
    茶點故事閱讀 68,729評論 6 397
  • 文/花漫 我一把揭開白布苇侵。 她就那樣靜靜地躺著,像睡著了一般企锌。 火紅的嫁衣襯著肌膚如雪榆浓。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,337評論 1 310
  • 那天撕攒,我揣著相機(jī)與錄音陡鹃,去河邊找鬼。 笑死打却,一個胖子當(dāng)著我的面吹牛杉适,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播柳击,決...
    沈念sama閱讀 40,902評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼猿推,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起蹬叭,我...
    開封第一講書人閱讀 39,807評論 0 276
  • 序言:老撾萬榮一對情侶失蹤藕咏,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后秽五,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體孽查,經(jīng)...
    沈念sama閱讀 46,349評論 1 318
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,439評論 3 340
  • 正文 我和宋清朗相戀三年坦喘,在試婚紗的時候發(fā)現(xiàn)自己被綠了盲再。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,567評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡瓣铣,死狀恐怖答朋,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情棠笑,我是刑警寧澤梦碗,帶...
    沈念sama閱讀 36,242評論 5 350
  • 正文 年R本政府宣布,位于F島的核電站蓖救,受9級特大地震影響洪规,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜循捺,卻給世界環(huán)境...
    茶點故事閱讀 41,933評論 3 334
  • 文/蒙蒙 一斩例、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧巨柒,春花似錦樱拴、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,420評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至牺勾,卻和暖如春正罢,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背驻民。 一陣腳步聲響...
    開封第一講書人閱讀 33,531評論 1 272
  • 我被黑心中介騙來泰國打工翻具, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人回还。 一個月前我還...
    沈念sama閱讀 48,995評論 3 377
  • 正文 我出身青樓裆泳,卻偏偏與公主長得像,于是被迫代替她去往敵國和親柠硕。 傳聞我的和親對象是個殘疾皇子工禾,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,585評論 2 359