日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

树莓派一键备份脚本 备份为img镜像 可用于量产 可选备份位置 适配Debian/Ubuntu

發布時間:2025/3/21 Ubuntu 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 树莓派一键备份脚本 备份为img镜像 可用于量产 可选备份位置 适配Debian/Ubuntu 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019-02-24 by 崔斐然

2019-02-28補充:

鑒于備份過程可能花費大量時間,建議使用ssh操作的同學安裝screen管理會話,避免因網絡波動造成ssh掉線任務失敗。參考我的另一篇博文: 樹莓派安裝screen保證SSH斷開 任務不中斷

? README IN English

樹莓派備份腳本

一個幫助我們備份樹莓派系統的小腳本,適配Ubuntu/Debian

GitHub:https://github.com/cuifeiran/pi_backup

測試

  • 2019-02-21 Debian9 Stretch 備份至 NTFS u盤 通過

如果你在使用腳本中成功備份或者失敗,請在issues中提出來,方便改進,謝謝

使用方法

git clone https://github.com/cuifeiran/pi_bakup.git cd pi_bakupsh bak.sh

然后請選擇備份情況,1:從SD卡備份到u盤(默認為第一個u盤:/dev/sda1)2:從u盤啟動的備份到另一張u盤(默認為第二個u盤:/dev/sda2)

其他需求請自行修改代碼

注意

由于備份時間過長,若使用SSH,其默認超時配置項可能導致備份中斷,建議修改ssh默認超時時間或者安裝screen,參考:崔斐然的CSDN screen不掉線 或者崔斐然的CSDN ssh配置

備份過程一般需要20分鐘以上,執行到part1時不會顯示進度,請耐心等待。

改動

2019-02-21 改動:新增part1創建映像顯示進度

2019-02-21 改動:創建的映像大小從1.3

參考:

conanwhf/RaspberryPi-script

  • 感謝前輩付出!(沒有forked的原因是這個腳本可能被我改糟,不想污染master所以新建了一個倉。)

RASPBERRY_BACKUP

help us to backup our piSD or piUSB to UsbSrotage Adaptation Ubuntu/Debian https://github.com/cuifeiran/pi_backup

TEST

  • 2019-02-21 Debian9 Stretch backup to NTFS usb storage pass

If you have any trouble with backup success or failure, please submit result in Issues to help me improve script. Thanks.

HOW TO USE IT

git clone https://github.com/cuifeiran/pi_bakup.git cp pi_bakup sh bak.sh

And then,choose1:backup piSD>first USB storage(Default :/dev/sda1). if your pi system in USB storage,choose2:backup piUSB >second USB storage(Default:/dev/sda2)

other demand please revise the code by yourself

NOTES

Because backup time is too long, if SSH is used, its default timeout configuration item may cause backup interruption. It is recommended to modify the default timeout time of SSH or install screen.Reference resources: CSDNDave’s CSDN screen_noOffline orDave’s CSDN ssh_config

The backup process usually takes more than 20 minutes. The progress will not be displayed when the backup process is executed to part1. Please wait patiently.

UPDATE

2019-02-21 update:part1 createing img shows progress

2019-02-21 change:create img size 1.3 multiple to 1.5 multiple

REFERENCE RESOURCES:

conanwhf/RaspberryPi-script

  • Thank your predecessors for giving! (The reason why there is no forked is that the script may have been worsened by me. I didn’t want to pollute the master, so I built a new warehouse. )

總結

以上是生活随笔為你收集整理的树莓派一键备份脚本 备份为img镜像 可用于量产 可选备份位置 适配Debian/Ubuntu的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。