Opensolaris 2008.5: Boot recovery cookbook
Content:
1) Intro
2) Recovery
3) Annex
———————————————————————-
1) Intro:
Opensolaris 2008.5 installed on my Lenovo 3000 J205 (AMD 64X2).
Discovering the beadm, I have created a BE as a backup (Title my) and activate it.
Making updates on some packages via the IPS.
And … unable to boot into the system !
Sweating .
For a couple of days, I was browsing the forii, for a solution to get back into my installation (aka access to my files on zfs filesystem).
How to mount the zfs ? Well it’s quite different from what I am used to.
Hopefully, good guys are out there, on the net.
2) Recovery:
Threads:
1) http://opensolaris.org/jive/thread.jspa?messageID=250749&tstart=02) http://opensolaris.org/os/project/indiana/resources/rn3/
3) http://www.sun.com/bigadmin/content/submitted/zfs_root_clone.jsp
In sequence: Read the first thread and the fourth (to see the reasons why I can’t use beadm lightly).
2.1) Boot the 2008.5 LiveCD
2.2) Get into the console:
jack/jack ;
su/opensolaris ;
Can use pfexec ;
Execute:
#beadm list
Follow excerpt from the first thread:
—————————————-
1. pfexec mkdir /tmp/oldroot
2. pfexec zpool import -f -R /tmp/oldroot rpool
3. pfexec zfs rollback rpool/ROOT/opensolaris@install
(if you have clones or snapshots you will need to use -R)
pfexec zfs rollback -R rpool/ROOT/opensolaris@install
—————————————-
In my case, I have to do one more step:
Execute:
#zfs list
To see the path of the “pool” where the installation is “living”.
Find its boot/grub/menu.lst . It’s relative to the temporary mountpoint.
Delete the extra opensolaris menu item, the one which was created with beadm (Title my).
Excerpt from my old menu.lst:
—————————–Begin menu.lstKO————————————–
philippe@opensolaris:~# more /mnt/dsk/boot/grub/menu.lstKO
splashimage /boot/grub/splash.xpm.gz
timeout 30
default 2
#———- ADDED BY BOOTADM - DO NOT EDIT ———-
title OpenSolaris 2008.05 snv_86_rc3 X86
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
#———————END BOOTADM——————–
# Unknown partition of type 39 found on /dev/rdsk/c4d0p0 partition: 1
# It maps to the GRUB device: (hd1,0) .
title Windows
rootnoverify (hd1,1)
chainloader +1
title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=a060e25e-9c61-410a-951f-a3a89d1
bf0ec ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet
# Unknown partition of type 131 found on /dev/rdsk/c4d1p0 partition: 2
# It maps to the GRUB device: (hd0,1) .
title my
bootfs rpool/ROOT/my
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
#============ End of LIBBE entry =============
philippe@opensolaris:~#
———————– End of menu.lstKO —————————-
Execute:
#shutdwon -i6 -g0
or #reboot
3) Annex:
After rescuing the original opensolaris installation and succesfully rebooting, I make a clone BE.
I reuse the original menu.lst installation. That’s why the Ubuntu entry isn’t shown in it.
The state of the files is shown below.
3.1) zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 13.9G 80.1G 59.5K /mnt/dsk
rpool@install 19K - 55.5K -
rpool/ROOT 5.29G 80.1G 18K /mnt/dsk/ROOT
rpool/ROOT@install 17K - 18K -
rpool/ROOT/install-clone 1.95G 80.1G 4.11G legacy
rpool/ROOT/opensolaris 3.34G 80.1G 2.24G legacy
rpool/ROOT/opensolaris@install 59.3M - 2.22G -
rpool/ROOT/opensolaris/opt 1.04G 80.1G 1.04G /opt
rpool/ROOT/opensolaris/opt@install 73K - 3.60M -
rpool/ROOT/opensolaris/opt@beName1 94K - 1.04G -
rpool/ROOT/opensolaris/opt@beName 85K - 1.04G -
rpool/ROOT/opensolaris/opt@my 85K - 1.04G -
rpool/export 8.57G 80.1G 19K /export
rpool/export@install 15K - 19K -
rpool/export/home 8.57G 80.1G 8.57G /export/home
rpool/export/home@install 18K - 21K -
3.2) beadm list
BE Active Active on Mountpoint Space
Name reboot Used
—- —— ——— ———- —–
install-clone yes no legacy 1.95G
opensolaris no yes - 3.34G
3.3) menu.lst
File /mnt/dsk/boot/grub/menu.lst:
splashimage /boot/grub/splash.xpm.gz
timeout 30
default 0
#———- ADDED BY BOOTADM - DO NOT EDIT ———-
title OpenSolaris 2008.05 snv_86_rc3 X86
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
#———————END BOOTADM——————–
# In case something goes wrong, use this to
# boot the initial install image.
title OpenSolaris 2008.5 clone
bootfs rpool/ROOT/install-clone
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
title Windows
rootnoverify (hd1,1)
chainloader +1