Recoving OpenSolaris root and grub
By user12625760 on May 20, 2008
Twenty years ago I fat fingered my workstation. Then it was using "newfs -n" rather than "newfs -N", shortly after the system paniced unable to find i-node 2. I had to restore. Restoring a diskless 3/50 running SunOS 3.5 was only less painful because I used to dump, when dump was dump not ufsdump, the network disk partitions of all the clients every night. Sorry I digress but it is still burned on my memory.
Today I fat fingered my laptop. I managed to type a script, at the command prompt, that ran with root priveleges and ended up doing "cd ../.. ; rm -r \*". That took it to /. I stopped it but the damage was already done. However since I am running OpenSolaris and had taken the precaution of taking a recursive snapshot of the pool after I last installed any software all I had to do was roll back the filesystems.
Specifically I had to roll back:
rpool - It contains the grub menu or at least it does once I recovered it.
rpool/ROOT - I'm not sure I had to roll this one back but it seemed wise.
rpool/ROOT/opensolaris - yes the real root file system. The lack of a kernel was certain to cause problems.
rpool/ROOT/opensolaris/opt - again I'm not sure I had to roll this one back but it seems best to keep the root file systems consistent.
I need to bring those auto snapshot scripts over.
I'll get to describe what I was doing later. It was very cool, well quite cool.