I'm running Ubuntu 10.04 and I would like to move /var to another partition using a python script. I found some directions that I thought were pretty good, but they call for switching to runlevel 1 (single-user mode) to prevent changes to /var while it is moved.
Is switching the runlevel necessary? Do I just call
os.system('init 1') directly in my script? Can I put the system back in its normal state just by calling
os.system('init 2') after the script is done?
When I'm connected over SSH I get booted out when I run
init 1 myself, even if I'm connected as root. If I'm at the keyboard when I do
init 1 I get the message:
Will now switch to single-user mode, Give root password for maintenance (or type Control-D to continue):. My root password does not work at that point so I've tried
Control-D and logging in as a user.
runlevel then says the system is back at runlevel 2, but I can't reconnect by SSH until I reboot the system.
Any help understanding what is going on is appreciated!