All entries for Monday 14 July 2008

July 14, 2008

Opensolaris adventure part 2: network and mirroring

Follow-up to Opensolaris adventure, part 1 from Secret Plans and Clever Tricks

OK; this bit wasn’t quite as smooth…

first off, networking. I used this blog post for guidance here. It doesn’t seem like NWAM is really aimed at static-IP server configuration, so the ‘traditional’ approach looks most appropriate

pfexec bash # cheat
svcadm disable nwam
svcadm enable network/physical:default

cat {hostname} > /etc/hostname.bge0
vi /etc/inet/resolv.conf # add in dns stuff
vi /etc/nsswitch.conf # change 'hosts' entry to 'files dns'
vi /etc/hosts # add IP address for my hostname
vi /etc/defaultrouter #add default router
vi /etc/netmasks #add netmasks

err.. ok.. what now? I tried ifconfig nge0 down;ifconfig nge0 up, but nge0 was stuck resolutely at 0.0.0.0 . I probably should have tried svcadm restart network/physical:default , but that thought didn’t occur to me until too late. I needed to reboot anyway, so I figured that would probably fix it.

Wrong! On a reboot, only the lo0 interface was present. I was about to try ‘ifconfig plumb nge0’, when it occurred to me to check svcadm. Sure enough, svcs showed me that the network milestone was offline because neither the nwam nor default physical network service was running. A quick look back through my command history showed that when I meant to run svcadm enable network/physical:default I had in fact run disable instead (lazy use of bash command history!). Enabling the service bought nge0 magically into existence, and I had a network.

Phew. Now I can work over ssh rather than over the ilom console…

So, next job; mirror the root partition.

Again using Denis Clarke’s blog entry as a guide, I started off by using format to list the disks for me.

# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c5t0d0 <DEFAULT cyl 17830 alt 2 hd 255 sec 63>
          /pci@0,0/pci10de,375@f/pci108e,286@0/sd@0,0
       1. c5t1d0 <Sun-STK RAID INT-V1.0-136.61GB>
          /pci@0,0/pci10de,375@f/pci108e,286@0/sd@1,0
      ... continue for 14 more disks...  
I used fdisk /dev/rdsk/c5t1d0p0 to delete the existing partition, and create a new one of type ‘solaris’. I then used this piece of trickery to copy the disk layout from the root disk onto the new mirror:
 prtvtoc /dev/rdsk/c5t0d0s0 | fmthard -s - /dev/rdsk/c5t1d0s0

c5t0d0s0 was the current root disk, so c5t1d0 seemed like the logical disk to use as a mirror.

I have to confess I have very little idea what that just did. Solaris disk partitioning is something I’ve never really been involved with. As we’ll see in a moment, this may turn out to have unexpected consequences…

# zpool attach  rpool c5t0d0s0 c5t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c5t1d0s0 overlaps with /dev/dsk/c5t1d0s2

hmmm… does that matter? I didn’t make a c5t1d0s2; I guess it got copied over from the vtoc on c5t0. Might I end up doing nasty things to my ZFS mirror? gah. Confusing. Let’s just try it with ‘-f’ and see what happens…

...What happens is that it appears to just work. Whether it will subsequently come back to bite me remains to be seen, but after a couple of minutes the mirror is in sync, and all looks good. A reboot comes back fine, with swap working as expected (still only on the one disk) and the ZFS mirror intact.

Next jobs: try out pkg, get the grub config mirrored, find out what the hell I did with fmthard.


Opensolaris adventure, part 1

I have a shiny new Sun X4240 to play with, and I decided that this would be a good candidate for our first OpenSolaris test box. So, I’m going to try setting it up, and blog how I get on here:

Step 0: Racking the box has got marginally easier; it came with a nice screwless rack that installed with much less tearing of flesh than the usual fiddly little bolt thingies.

Step 1: Ilom. Never actually tried configuring one of these before, but it turns out to be pretty simple if you’ve got the right hardware. A laptop with a USB-to-serial connector plugged into the serial port on the back of the server, a copy of TerraTerm, and we’re in. I’ve got an IP address allocated for the ilom, so I just need to configure it.

cd /SP/network
set pendingipaddress={ip}
set pendingipdiscovery=static
set pendingipgateway={gateway ip}
set pendingipnetmask={netmask}
set commitpending=true
cd ../console
start

hey presto, I can now log into the ilom over ssh, and better still, I can access the GUI console via the ilom’s java console applet thingy.

Step 2: install OpenSolaris

I downloaded the OpenSolaris 05.08 CD image, burned it, and stuck the resulting CD into the X4240. (actually, I did this before configuring the ilom). When I connected to the GUI console, the LiveCD was already booting. I clicked on ‘install’ and answered a few basic questions about timezones, and a default user, and the install started. The only thing I couldn’t see how to do was created a mirrored boot disk; hopefully that’s something I’ll be able to do post-install

I then let the box reboot. Unfortunately this turned out to be a mistake, as it booted back into the LiveCD (guess I wasn’t paying attention enough to switch it at the grub prompt). I ejected the CD and tried to reboot, but the LiveCD doesn’t seem to be able to run reboot once the CD is ejected (maybe it needs to load a binary off the LiveCD!). A swift power cycle from the ILOM fixed that though. The fans whizzed, and in a remarkably short space of time (compared with Solaris 10) I had a login prompt. Enter the user details from the install screen, and I’m in :-)

So, I have a working system. Now I need to configure TCP/IP, fix the unmirrored root disk, and do something with the remaining 10 disks. Then I’ll be finding out how the new pkg system works for installing stuff, and trying out LU to bring the kernel up-to-date with the latest OpenSolaris build.


Most recent entries

Loading…

Search this blog

on twitter...


    Tags

    Not signed in
    Sign in

    Powered by BlogBuilder
    © MMXIX