1) Boot ZFS root partition and get access to root
2) gunzip your miniroot image into /tmp
gzcat /grub/boot/x86.miniroot-safe > /tmp/miniroot.img
3) Using the loopback filesystem to mount the image on /mnt - replace the /dev/lofi/1 with appropriate returned device
lofiadm -a /tmp/miniroot.img
mount /dev/lofi/1 /mnt
4) Copy the file /etc/zfs/zpool.cache into /mnt/etc/zfs
cp -p /etc/zfs/zpool.cache /mnt/etc/zfs
5) unmount the filesystem
umount /mnt
lofiadm -d /tmp/miniroot.img
6) gzip the image back to grub.
gzip -c /tmp/miniroot.img > /grub/boot/x86.miniroot-safe
7) Edit the /grub/boot/grub/menu.lst and make sure that there is an identical "root" entry for failsafe and ZFS. Below are the entries for my machine.
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
root (hd0,0,a)
kernel /boot/multiboot kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------
title Solaris ZFS
root (hd0,0,a)
kernel /boot/multiboot
module /boot/boot_archive
8) You should now be able to reboot into failsafe and see your zfs pool with the "zpool list" command. Also you should be able to see your root filesystem with the "zfs list" command. When you booted, it would have asked you if you want to mount a filesystem on /a. If you answered yes, then unmount it with "umount /a". Now you can use the mount command to mount your ZFS root filesystem on to /a. Note, I previously named my root filesystem "intdisk/snv42_root". Change the command to suite your setup. Also don't forget to add the option "-F zfs". If you dont, mount will try NFS....
mount -F zfs intdisk/snv42_root /a
Finally you can now cd into /a and fix your system. Enjoy!!!
1 comment:
Does the 'zpool import -f can hang your next reboot' issue still apply?
Post a Comment