Monday, November 19, 2007

Using Live Upgrade to move disks on x86 with a difficult bios

I'm attempting to move my disks around in my OpenSolaris Box - I have a pair of IDE 120Gb which at one point where mirrored using SVM - but I want to use them in another side project so I need to migrate my install from one IDE disk to the space I have left on the pair of SATA drives where my ZFS pool is (there is space left as I did at one point boot from the SATAs before I reinstalled to the IDEs)

First lucreate for a new BE
root@frank / $ lucreate -c b76a-ide -m /:/dev/dsk/c1d0s3:ufs -n b76a-sata

The lustatus to check whats going on:

root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes yes yes Yes -
b76a-sata yes no no no -
root@frank / $

Excellent so I have a identical but relocated boot environment I can use - let luactivate it.

root@frank / $ luactivate b76a-sata



Saving latest GRUB loader.

Setting failsafe console to .

ERROR: No matching BIOS id found for:


ERROR: Cannot determine GRUB id for ABE disk

ERROR: Unable to determine the configuration of the target boot environment .

root@frank / $

Dam - I've hit this problem again. It seems to resolve around the way /sbin/biosdev reports my disks:

root@frank / $ sbin/biosdev

0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0

0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0

root@frank / $


These two disks are my IDEs - but I want to boot off the first SATA disk.

I'm not sure if this is a limitation of my BIOS or a problem with biosdev but what I have done is: (Ugly Hack time).
To get luactivate to work I need to cludge /sbin/biosdev to output something that will work.

I used the output of /sbin/biosdev -d to produce this

root@frank / $ cat /sbin/biosdev
#!/bin/sh
echo "0x80 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0"
echo "0x81 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0"
echo "0x82 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
echo "0x83 /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0"
exit 0
root@frank / $

I installed grub on the other disk manually, specifying the slice solaris is on

root@frank / $ installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s3
Solaris boot partition inactive.
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 260 sectors starting at 50 (abs 16115)
root@frank / $

Then I mounted the new BE and copied menu.lst from my active boot enviorment on the IDE disk to the new SATA disk.
root@frank / $ lumount b76a-sata
/.
alt.b76a-sata
root@frank / cp /boot/grub/menu.lst /.alt.b76a-sata/boot/grub/menu.lst

Unmount the new BE and activate
root@frank / $ luumount b76a-sata
root@frank / $ luactivate b76a-sata

reboot and catch the bios and change the disk order to boot from the SATA disk.

Because the system is now hopelessly confused (a bit like me) about which disk is where so my /boot/grub/menu.lst was quite wrong it was attempting to use (hd3,0,d) as my boot slice for the sata dissk so I had to edit it manually at boot to point to (hd0,0,d) - and then once again edit the /boot/grub/menu.lst to match.

The reason for this editing is that I changed the order the disks are chosen from within the bios as otherwise it will continue to boot from the first IDE disk. Basically once the system comes up from the sata disk if I run the original biosdev i get this:

root@frank / $ /sbin/biosdev
0x82 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@1,0
0x83 /pci@0,0/pci-ide@1f,1/ide@0/cmdk@0,0
root@frank / $

Which are the SATA disks. lustatus shows the correct information as well now.
root@frank / $ lustatus
Boot Environment Is Active Active Can Copy
Name Complete Now On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
b76a-ide yes no no yes -
b76a-sata yes yes yes no -

At this point I pulled the IDE disks from the machine (ludelete is also confused because of incorrect biosdev info so wont delete them.) Though I forgot to fix my swap partition and the system failed to boot until I sorted that out. A quick vi session in /etc/vfstab to change the swap partition and the clear the error using svcadm:

root@frank / $ svcadm clear svc:/system/filesystem/local:default

There is some more fiddling to do in /boot/grub/menu.lst to fix the xVM entries and some nasty undocumented mucking around in /etc/lutab to remove the old ide entries but finally I'm back where I started but with a couple of IDE disks to play with ZFS on my mac. (now I need to find some IDE USB caddies)

As I side note I've finally found a use for the PIP (picture in picture) function on my Dell 24 Pannel - I attach a S-Video cable to the output of my graphics card so that I can fiddle with the bios on the server without swapping inputs - though serial redirection in the BIOS would be nicer.

I really miss OBP.

No comments: