Rescuing Linux: Difference between revisions

No edit summary
Line 64: Line 64:
echo b > /proc/sysrq-trigger</pre>
echo b > /proc/sysrq-trigger</pre>
Alt+SysRq+B will accomplish this at the terminal if sysrq reboot is enabled. Unlike <tt>reboot</tt>, there will be no syncing and unmounting of disks.
Alt+SysRq+B will accomplish this at the terminal if sysrq reboot is enabled. Unlike <tt>reboot</tt>, there will be no syncing and unmounting of disks.
==moving a root filesystem + bootloader==
Ideally, mount the source filesystem <tt>ro</tt>, so it's not being modified while you copy. Start assuming a clean destination filesystem (otherwise, wipe it). Using the <tt>-a</tt> flag, <tt>cp</tt> basic toplevel directories *but do not cross filesystem boundaries on the source* (i.e. if <tt>/home</tt> is on its own filesystem, do not include it below; this includes <tt>/boot/efi</tt>). Any that you skip in this fashion ought have their mountpoints created; add them to the <tt>mkdir</tt> below:
<pre>
cp -a SOURCE/{bin,boot,etc,home,lib*,root,sbin,usr} DEST/
mkdir -p DEST/{dev,proc,var/tmp,tmp}
ln -s /run DEST/var/run
ln -s /lock DEST/var/lock
chmod 1777 DEST/{var/tmp,tmp}
</pre>
<b>ESP, bootloader, initramfs...</b>


==External links==
==External links==
* Debian wiki page for [https://wiki.debian.org/initramfs initramfs]
* Debian wiki page for [https://wiki.debian.org/initramfs initramfs]
* Kernel documentation for [https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html Ramfs, Rootfs, and Initramfs]
* Kernel documentation for [https://www.kernel.org/doc/html/latest/filesystems/ramfs-rootfs-initramfs.html Ramfs, Rootfs, and Initramfs]