'\" t .\" Title: pivot_root .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-05-14 .\" Manual: System-Administration .\" Source: util-linux 2.40.1 .\" Language: English .\" .TH "PIVOT_ROOT" "8" "2024-05-14" "util\-linux 2.40.1" "System\-Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "BEZEICHNUNG" pivot_root \- die Dateisystemwurzel ändern .SH "ÜBERSICHT" .sp \fBpivot_root\fP \fInew_root\fP \fIput_old\fP .SH "BESCHREIBUNG" .sp \fBpivot_root\fP moves the root file system of the current process to the directory \fIput_old\fP and makes \fInew_root\fP the new root file system. Since \fBpivot_root\fP(8) simply calls \fBpivot_root\fP(2), we refer to the man page of the latter for further details. .sp Ob Wurzel und aktuelles Arbeitsverzeichnis beim Aufruf geändert werden oder nicht, ist von der Implementation von \fBpivot_root\fP abhängig. Die folgende, in jedem Fall funktionierende Sequenz ruft \fBpivot_root\fP auf, wobei angenommen wird, dass sich \fBpivot_root\fP und \fBchroot\fP im aktuellen \fBPATH\fP befinden: .sp .if n .RS 4 .nf .fam C cd _neue_Wurzel_ pivot_root . _alte_Wurzel_ exec chroot . _Befehl_ .fam .fi .if n .RE .sp Beachten Sie, dass \fBchroot\fP sowohl in der alten als auch in der neuen Dateisystemwurzel verfügbar sein muss, da \fBpivot_root\fP das Wurzelverzeichnis der Shell entweder geändert haben kann oder nicht. .sp Beachten Sie, dass \fBexec chroot\fP die ausgeführte Datei ändert, was notwendig ist, falls das alte Wurzelverzeichnis danach ausgehängt werden soll. Auch die Standardeingabe, Standardausgabe und deren Fehlerkanal kann noch auf ein Gerät in der alten Dateisystemwurzel zeigen, wodurch dieses noch belegt ist. Dies kann beim Aufruf von \fBchroot\fP einfach geändert werden, siehe nachfolgendes Beispiel. Beachten Sie hierbei, dass keine führenden Schrägstriche gesetzt sind, damit \fBpivot_root\fP stets funktioniert, egal ob die Dateisystemwurzel der Shell geändert wurde oder nicht. .SH "OPTIONEN" .sp \fB\-h\fP, \fB\-\-help\fP .RS 4 zeigt einen Hilfetext an und beendet das Programm. .RE .sp \fB\-V\fP, \fB\-\-version\fP .RS 4 zeigt Versionsinformationen an und beendet das Programm. .RE .SH "BEISPIEL" .sp Ändern der Dateisystemwurzel in \fI/dev/hda1\fP aus einer interaktiven Shell: .sp .if n .RS 4 .nf .fam C mount /dev/hda1 /neue\-Wurzel cd /neue\-Wurzel pivot_root . alte\-Wurzel exec chroot . sh dev/console 2>&1 umount /alte\-Wurzel .fam .fi .if n .RE .sp Einhängen des neuen Wurzeldateisystems über NFS von 10.0.0.1:/my_root und \fBinit\fP ausführen: .sp .if n .RS 4 .nf .fam C ifconfig lo 127.0.0.1 up # für portmap # Ethernet konfigurieren portmap # für lockd (implizit von mount gestartet) mount \-o ro 10.0.0.1:/my_root /mnt killall portmap # portmap belegt noch die alte Wurzel cd /mnt pivot_root . old_root exec chroot . sh \-c \*(Aqumount /old_root; exec /sbin/init\*(Aq \(rs dev/console 2>&1 .fam .fi .if n .RE .SH "SIEHE AUCH" .sp \fBchroot\fP(1), \fBpivot_root\fP(2), \fBmount\fP(8), \fBswitch_root\fP(8), \fBumount\fP(8) .SH "FEHLER MELDEN" .sp Nutzen Sie zum Melden von Fehlern das Fehlererfassungssystem auf \c .URL "https://github.com/util\-linux/util\-linux/issues" "" "." .SH "VERFÜGBARKEIT" .sp Der Befehl \fBpivot_root\fP ist Teil des Pakets util\-linux, welches aus dem \c .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux\-Kernel\-Archiv" "" heruntergeladen werden kann.