搞得好
gpt威武
【 在 cppbuilder 的大作中提到: 】
: 标 题: Re: [求助]linux是否可以在不重启的情况下更换系统盘?
: 发信站: 水木社区 (Sat May 24 15:03:12 2025), 站内
:
: 问gpt搞定了。ssh进到我的树莓5播放器,pivot到其他分区,chroot到openrc里,之前的服务可以用,也可以用openrc重启到新分区上的软件版本。Gentoo日常使用就需要会这个
:
: mount --bind /new_root /new_root
: unshare -m -f
: mount /dev/mmcblk0p2 /new_root
: mount --bind /new_root /new_root
:
: mount --types proc /proc /new_root/proc
: mount --rbind /sys /new_root/sys
: mount --make-rslave /new_root/sys
: mount --rbind /dev /new_root/dev
: mount --make-rslave /new_root/dev
: mount --bind /run /new_root/run
: mount --make-slave /new_root/run
:
: cd /new_root
: pivot_root . old_root
:
: exec chroot . /sbin/init <dev/console >dev/console 2>&1
: /etc/init.d/diretta-alsa-target status
: /etc/init.d/diretta-alsa-target restart
:
: 附chatgpt流程,一共三个问题就过了,之前两次尝试都报错了不过机器没崩
:
: 1. hi, can you help me find a pivot_root tutorial
: 2. after step 6, the /proc is not mounted. should I do that before chroot?
: 3. If i want to use init such as openrc or systemd, should i chage step4 to chroot . /init?
:
:
: 【 在 DreamDreams 的大作中提到: 】
: : 你可以试试, 成功了再说
:
: --
:
: ※ 修改:·cppbuilder 于 May 24 18:42:07 2025 修改本文·[FROM: 1.202.11.*]
: ※ 来源:·水木社区 mysmth.net·[FROM: 1.202.11.*]
--
修改:cppbuilder FROM 1.202.11.*
FROM 61.51.75.91