Quicklinks

EndUser

Test/Virtualisaton


Installieren

Kernel - Tuning

Network

Display / Pads

Bock Devices

Printer

USB-Devices

BenutzerSW

Server

Install Notes

General/Hints

anoyances.org

Collection of installation & troublshooting info related to my linux (debian/mint/ubuntu) installations

Init und Start Kernel

Der Linuxstart geschieht meist mehrstufig.
Zuerst wird ein Minimalsystem geladen, welches die noch gebrauchten Module lädt, und zum eigentlichen System abzweigt.
Ähnliches lässt sich auch aus einer installieten Installation machen.
Allerdings gibt es einen Unterschied zwischen dem initrd und einem normalen Filesystem, was z.T. andere Behandlung benötigt.

KSplice,Kpatch

Kernelpatches im laufenden Betrieb

kexec

Kernel aus einem bestehenden Linux-System starten. Ähnlich einem reboot.
Hardware wird aber nicht neu initialisiert, somit etwas schneller.

https://www.linux.com/blog/simple-kexec-example
apt-get install kexec-tools
kexec -l /boot/vmlinuz-2.6.18-194.11.4.el5 /* load */
--initrd=/boot/initrd-2.6.18-194.11.4.el5.img
--command-line="$( cat /proc/cmdline )"
kexec -e /* start */

switch_root

http://lists.busybox.net/pipermail/busybox/2007-August/062506.html

pivot_root

manuelles erstellen und freigeben der Resourcen nötig

mkdir /tmp/tmproot
mount -t tmpfs none /tmp/tmproot
mkdir /tmp/tmproot/{proc,sys,dev,run,usr,var,tmp,oldroot}
cp -ax /{bin,etc,mnt,sbin,lib,lib64} /tmp/tmproot/
cp -ax /usr/{bin,sbin,lib,lib64} /tmp/tmproot/usr/
cp -ax /var/{account,empty,lib,local,lock,nis,opt,preserve,run,spool,tmp,yp} /tmp/tmproot/var/
mount --make-rprivate / # necessary for pivot_root to work
pivot_root /tmp/tmproot /tmp/tmproot/oldroot
for i in dev proc sys run; do mount --move /oldroot/$i /$i; done

Aus busybox (initramfs)

Minimalsystem, um das gewünschte System zu starten

takeover.sh

https://www.reddit.com/r/linuxquestions/comments/5z934f/attempting_to_live_switch_linux_with_pivot_root/
I’ve read forbidden documents in Dewan, Dinasian, and Iccobar, about using mystical combinations of pivot_root, switch_root, and kexec to initialize full boot sequences by swapping over to a new root directory directory + starting the init process with a new kernel
Script um über ssh quasi ein neues System zu überladen

https://github.com/marcan/takeover.sh

Nutzen

mittels Pivot-Root kann das Root geändert werden.
Gleiches kann ev. auch aus busybox gemacht werden, falls Tools dort vorhanden.
So können Operationen auf das Root-File-System gmeacht werden, wie:
https://github.com/szepeviktor/debian-server-tools/blob/master/debian-convert-ext3-ext4.sh
https://github.com/szepeviktor/debian-server-tools/blob/master/debian-resizefs.sh

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on April 21, 2019, at 05:52 PM, visited:$PageCount