Hey All, Here is an interesting problem I am trying to solve. On one of my remote servers, I need to switch the root filesystem via pivot_root to a freshly mounted loop partition. The target partition has fully loaded debian lenny (with ssh). My expectation is , once I shift root, it should load init levels from fresh distro, such that even SSH should be restarted and run under context on new root.
So I go ahead and do this... $ modprobe loop $ mkdir /mnt/new_root $ mount -o loop /mnt/fs.img /mnt/new_root/ $ mkdir /mnt/new_root/old_root $ cd /mnt/new_root $ /sbin/pivot_root . old_root/ ... Every thing is fine till here $ exec chroot . "/sbin/init 5" ---> this fails chroot: cannot run command `/sbin/init 5': No such file or directory ----> while /sbin/init does exist leaving my machine in broken state, and only hard boot can bring it to the life, and as I only have an SSH access I have to rely on human who sits next to machine to reboot it :-). Any idea on whats going wrong here? Or point me a better approach to experiment with pivot_root where I dont have to rely on hard boot. 'Abhishek --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ILUG Bengaluru" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ilug-bengaluru?hl=en -~----------~----~----~----~------~----~------~--~---
