Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

树莓派4b系统备份与还原[0]

Posted on 2023年11月14日 by

每次设置树莓派都会有一堆的失误,但重启设置又较为麻烦,因此需要有备份。

因此避免在低端的操作上反复,采用备份和恢复是不错的选择。

常用方法如下:

  • 全卡备份——Win32DiskImager
    全卡备份是最简单的一种,首先在硬盘上创建一 img 后缀的空文件,打开 Win32DiskImager,选择刚刚创建的空img 文件和 SD 卡盘符,点击 read 既可。

等待几分钟后就得到了备份的 img 文件,用 Win32DiskImager 来制作镜像时因为无法读取到 Linux 分区,所以是全卡备份,该方法的缺点是备份文件会和 SD 卡的容量一致,而且在还原的时候采用树莓派的官方刻录pi imager即可。

  • 树莓派上直接复制dd系统

准备一张空白 SD 卡,格式化 SD 卡插入读卡器,然后插入树莓派上,使用 umount 卸载该挂载,使用命令dd bs=4M if=/dev/mmcblk0 of=/dev/sda 就可以把树莓派系统内容全部拷贝到 SD 卡上,mmcblk0 就是树莓派上系统 TF卡,sda 就是插入的 SD 卡(使用 lsblk 查看),等待完成后既可以关机插入新卡重启。

1.查看磁盘信息

lsblk -f

2.挂载磁盘

mkdir -p /mnt/udisk #创建挂载目录
mount   /dev/sda1 /mnt/udisk/ #挂载
lsblk -f #重新检查

3.检查磁盘空间

df -h

4.卸载sd卡

umount /dev/sda1

5.DD备份系统

dd bs=4M if=/dev/mmcblk0 of=/dev/sda

6.检查DD状态(需要另外开shell)

watch -n 5 pkill -USR1 ^dd$

7.检查容量

挂载sda1,检查空间

挂载sda3,检查空间

umount /mnt/udisk

8.关闭树莓派,更换SD卡即可

参考资料:

  1. https://post.smzdm.com/p/apzkgne7/
  2. https://www.cnblogs.com/jingzaixin/p/12750570.html

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT