Code: Alles auswählen
pivot_root ./ /Verzeichnis/wo/das/alte/rootdateisystem/hin/soll
Code: Alles auswählen
pivot_root ./ /Verzeichnis/wo/das/alte/rootdateisystem/hin/soll
Code: Alles auswählen
localhost:~# pivot_root
usage: pivot_root new_root put_old
Code: Alles auswählen
Change the root file system to /dev/hda1 from an interactive shell:
mount /dev/hda1 /new-root
cd /new-root
pivot_root . old-root
exec chroot . sh <dev/console >dev/console 2>&1
umount /old-root
Code: Alles auswählen
exec chroot . /bin/sh <dev/console >dev/console 2>&1
Code: Alles auswählen
# 1
telinit 2
for SERVICE in \
chkconfig --list | grep 2:on | awk '{print $1}' | grep -v -e sshd -e network -e rawdevices`; do service $SERVICE stop; done
service nfs stop
service rpcidmapd stop
setenforce 0
#2
umount -a
#3
mkdir /tmp/tmproot
mount none /tmp/tmproot -t tmpfs
mkdir /tmp/tmproot/{proc,sys,usr,var,oldroot}
cp -ax /{bin,etc,mnt,sbin,lib} /tmp/tmproot/
cp -ax /usr/{bin,sbin,lib} /tmp/tmproot/usr/
cp -ax /var/{account,empty,lib,local,lock,nis,opt,preserve,run,spool,tmp,yp} /tmp/tmproot/var/
cp -a /dev /tmp/tmproot/dev
#3
pivot_root /tmp/tmproot/ /tmp/tmproot/oldroot
mount none /proc -t proc
mount none /sys -t sysfs (this may fail on 2.4 systems)
mount none /dev/pts -t devpts
#4
service sshd restart
#5 Close everything that's still using the old filesystem:
umount /oldroot/proc
umount /oldroot/dev/pts
umount /oldroot/selinux
umount /oldroot/sys
umount /oldroot/var/lib/nfs/rpc_pipefs
#6 Now try to find other things that are still holding on to the old filesystem, particularly /dev:
fuser -vm /oldroot/dev
#7 Common processes that will need killing:
killall udevd
killall gconfd-2
killall mingetty
killall minilogd
#8 Finally, you will need to re-execute init:
telinit u
#9 Unmount the old filesystem:
umount -l /oldroot/dev
umount /oldroot
Wenn du schon Fehlermeldungen erhältst wäre es nett diese zu verraten.sh ram.sh gibt aber Fehler zureuck und wird abgebrochen...
So mountet man ein tmpfs nach /tmp/tmprootmalteklein hat geschrieben: allerdings verstehe ich nicht ganz was "mount none /tmp/tmproot -t tmpfs" das bedeutet.
Nana, nicht so vorschnell.Ich glaube ich werde mit meinem Vorhaben aufgeben muessen.