Search This Blog

30 December 2008

Building Mozilla code from source

pfexec pkg install SUNWhea SUNWsvn SUNWmercurial SUNWsfwhea SUNWxwinc SUNWxorg-headers SUNWgm4 SUNWgnome-common-devel SUNWcvs SUNWgmake sunstudio SUNWcurl
 
add these to ~/.bashrc 
export CC=/opt/SunStudioExpress/bin/cc
export CXX=/opt/SunStudioExpress/bin/CC
export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"
export PKG_CONFIG_PATH=/usr/lib/pkgconfig

26 December 2008

Failed to get lock on destination repos, currently held by....

Recently, one of our work servers has been undergoing some hardware maintenance. I believe it was powered down during one of its svn mirror syncronizations.

The output from the log file showed this:
(sasvn-cm1)[csvn] cron> pwd
/opt/CollabNet_Subversion/cron
(sasvn-cm1)[csvn] cron> cat pipeline-mirror.out
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
Failed to get lock on destination repos, currently held by 'sasvn-cm1:211ba926-16bc-c94c-9718-a2e5bd4ef8e4'
svnsync: Couldn't get lock on destination repos after 10 attempts

So, looking around, it appeared that there was a lock on revision 0 but it took awhile to figure out how to remove it...

(sasvn-cm1)[csvn] cron> svn proplist -r 0 --revprop file:///repos/svn/pipeline-mirror
Unversioned properties on revision 0:
  svn:sync-from-uuid
  svn:sync-lock
  svn:sync-last-merged-rev
  svn:date
  svn:sync-from-url

(sasvn-cm1)[csvn] cron> svn propdel -r 0 --revprop file:///repos/svn/pipeline-mirror

Waiting for the next cron cycle to see if it will update, but it looks promising.

28 November 2008

Auto-starting domUs

Assuming domU is named... ummm... 'domU'
# vi `virsh dumpxml eoti | grep -i uuid | sed 's/\s*<uuid>/\/var\/lib\/xend\/domains\//g;' | sed 's/\s*<\/uuid>/\/config.sxp/g'`

change: (on_xend_start ignore)
to: (on_xend_start start)

27 November 2008

Webmin

After installing Webmin via the package manager, I ran 'webminsetup' and tried to access the new http://serveris:10000/ but it kept saying my password was wrong.

I found Jignesh's tip and got it working.

Specifically, I reran webminsetup and chose all the defaults
# su - root
# cd /etc/webmin
# vi miniserv.users
vi -- copied the first bit from the password file (ie: 'malachi:x:101') to the end of the file
# vi webmin.acl
vi> yyp
vi -- change the second 'root' to 'malachi'
# exit
# svcadm restart webmin

http://serveris:10000/ now works :)

Routing not working on boot

I have commented on this issue before....

not sure of a long term solution yet, but this appears to make it start working again...
# pfexec svcadm restart network/routing-setup

19 November 2008

SMB/CIFS

I had installed the packages but could not get a ZFS folder to share via SMB. The service was in maintenance mode, and it kept complaining about it not being loaded into the kernel. I tried add_drv, but that complained that it was already added.

Rebooting managed to enable the service.  Next, when I ran the cifs-chkcfg script, it said I need to run this (as root):
echo other password required pam_smb_passwd.so.1 nowarn >> /etc/pam.conf

Running it again, it said:
/var/smb/smbpasswd does not exist or it is empty
passwd must be used to create CIFS-style password for local users

Hmm, but I don't really want to be in workgroup mode anyways. Let's follow these instructions and change that and join the domain....

hmmmm
'failed to find any domain controllers for __insert_anything_I_tried_here__'

hmmm, will have to come back to this

17 November 2008

Setting up xVM....

It was a long and tedious process, but I got it working (on my work machine)... well, actually, it wasn't so bad once this was resolved [which took about 2-3 days to figure out]. While working on that, I also installed SUNWxvmhvm as it appeared to be the only xVM one not installed according to the Package Manager.
Link

The first step was to download the ISOs. I ended up downloading both sol-10-u6-companion-ga.iso and sol-10-u6-ga1-x86-dvd.iso, though I haven't gotten around to using (or even looking at) the companion cd.

I played around a few times until I figured out how I wanted this done. I decided the original domain was going to be used as a starting point to clone from, and not as a domain to run; so some of the names seem a little overboard early on. I used this page for a lot of the details of what to do.

The next step was to create a volume.
root@eris:/rpool/vm/iso# zfs create -V 16G rpool/vm/sol-10-u6-ga1-x86.zvol
This creates /dev/zvol/dsk/rpool/vm/sol-10-u6-ga1-x86.zvol.

Using virt-manager to create the domain:
name: sol_10_u6_ga1_x86
virtualization: full
iso: /rpool/vm/iso/sol-10-u6-ga1-x86-dvd.iso
os type: Solaris
os variant: Sun OpenSolaris
disk: /dev/zvol/dsk/rpool/vm/sol-10-u6-ga1-x86.zvol
nic: shared eg1000g0
mem (min): 1024
mem (max): 1024
VCPUs: 1

During the installation, Solaris and Option 4 (to allow for a ZFS root).
Once it was installed, I rebooted and verified that it worked. I shut it down.
root@eris# zfs snapshot rpool/vm/sol-10-u6-ga1-x86.zvol@FreshInstall
root@eris# zfs list -t snapshot -r rpool/vm/sol-10-u6-ga1-x86.zvol | grep -v auto-snap
(the second step was to verify that it worked)

Logged into the domain (using virt-manager)
root@sol_10_u6_ga1_x86# sys-unconfig
This halts it, but through trial and error I found that I need to hit a key to get it to start restarting THEN hit the shutdown button on xVM so that it is NOT running.
root@eris# zfs snapshot rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured
root@eris# zfs clone rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured rpool/vm/eris-vm1.zvol
root@eris#
zfs snapshot rpool/vm/eris-vm1.zvol@Unconfigured

root@eris# zfs list -t all -r rpool/vm/sol-10-u6-ga1-x86.zvol | grep -v auto-snap
NAME USED AVAIL REFER MOUNTPOINT
rpool/vm/sol-10-u6-ga1-x86.zvol 22.1G 51.1G 5.93G -
rpool/vm/sol-10-u6-ga1-x86.zvol@FreshInstall 0 - 5.89G -
rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured 0 - 5.93G -
root@eris# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 37.7G 35.1G 50K /rpool
rpool/ROOT 7.64G 35.1G 18K legacy
rpool/ROOT/opensolaris 5.85G 35.1G 5.52G /BE/opensolaris
rpool/ROOT/opensolaris-1 776M 35.1G 5.52G /BE/opensolaris-1
rpool/ROOT/opensolaris-2 1.03G 35.1G 5.77G /tmp/tmpFWvL5Q
rpool/dump 1.93G 35.1G 1.93G -
rpool/export 1.35G 35.1G 19K /export
rpool/export/home 1.35G 35.1G 19K /export/home
rpool/export/home/malachi 1.35G 35.1G 423M /export/home/malachi
rpool/swap 1.93G 37.0G 16K -
rpool/vm 24.9G 35.1G 2.78G /rpool/vm
rpool/vm/eris-vm1.zvol 0 35.1G 5.93G -
rpool/vm/sol-10-u6-ga1-x86.zvol 22.1G 51.1G 5.93G -

Then to create the domain configuration:
root@eris:/rpool/vm# virsh dumpxml sol_10_u6_ga1_x86 > sol_10_u6_ga1_x86.xml
root@eris:/rpool/vm# cp sol_10_u6_ga1_x86.xml eris_vm1.xml

Edit the new eris_vm1.xml:
1. replace the domain name
2. remove the UUID line
3. replace the zvol location (from sol_10_u6_ga1_x86.zvol to eris_vm1.zvol)
root@eris:/rpool/vm# virsh define eris_vm1.xml

Boot into the new domain and configure it. Reboot and make sure the internet works. Shut it down.

root@eris# zfs snapshot rpool/vm/eris-vm1.zvol@Configured

That's it. It's now bootable and the original one is still available to clone another from.

14 November 2008

hvm not available

The work machine is a Dell OptiPlex 755 with an E8400 cpu and BIOS A11. I couldn't figure out why both 'xm info' and 'virt-install' both showed as it not having virtualization support. I tried turning it off and back on (in the bios), etc.

Turns out (thx to this thread) it just required turning OFF 'Trusted Execution' in the BIOS.

13 November 2008

Printers won't Print

Doing 'svcs -xv' I saw that svc:/network/device-discovery/printers:snmp was in maintenance mode. I tried clearing/enabling it, but it just wasn't cooperating. Something about:

[ Nov 13 13:13:10 Executing start method ("/lib/svc/method/svc-network-discovery start snmp"). ]
/usr/bin/dbus-send --system --print-reply --dest=org.freedesktop.Hal --type=method_call /org/freedesktop/Hal/devices/network_attached org.freedesktop.Hal.Device.NetworkDiscovery.EnablePrinterScanningViaSNMP int32:60 string:public string:0.0.0.0
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

After searching around for awhile, I found that this bug had already been reported.

So first I installed 'SUNWsmmgr' via the package manager
root@eris:~# svcadm restart svc:/system/hal:default
root@eris:~# svcadm clear svc:/network/device-discovery/printers:snmp
root@eris:~# svcadm enable svc:/network/device-discovery/printers:snmp


That seemed to fix it.

As far as setting the printers up, it seemed to work much quicker setting it up using socket, the IP, default port (as opposed to my last attempt using samba and the name)....

zfs auto snapshot (and thus time-slider) going offline after upgrade

The error will look something like this:

Checking for non-recursive missed // snapshots
Checking for recursive missed // snapshots rpool
Last snapshot for svc:/system/filesystem/zfs/auto-snapshot:frequent taken on Thu Nov 13 11:30 2008
which was greater than the 15 minutes schedule. Taking snapshot now. cannot create snapshot 'rpool/ROOT/opensolaris@zfs-auto-snap:frequent-2008-11-13-12:51': dataset is busy
no snapshots were created

Error: Unable to take recursive snapshots of rpool@zfs-auto-snap:frequent-2008-11-13-12:51.

Moving service svc:/system/filesystem/zfs/auto-snapshot:frequent to maintenance mode.


This problem is being caused by the old (IE: read non-active) boot environments not being mounted and it is trying to snapshot them. You can't 'svcadm clear' or 'svcadm enable' them because they will still fail.

Based on suggestions I find everywhere (most recently this one), I did this:
# mkdir /BE
# zfs list
(shows rpool/ROOT/opensolaris, rpool/ROOT/opensolaris-1 and the current rpool/ROOT/opensolaris-2)
# zfs set mountpoint=/BE/opensolaris rpool/ROOT/opensolaris
# zfs mount rpool/ROOT/opensolaris
# zfs unmount rpool/ROOT/opensolaris
(repeat the 3 steps for opensolaris-1)

Now you can run 'svcs -xv' to get the list of services and restart them... In my case:
# svcadm clear svc:/system/filesystem/zfs/auto-snapshot:frequent
# svcadm enable svc:/system/filesystem/zfs/auto-snapshot:frequent
# svcadm clear svc:/system/filesystem/zfs/auto-snapshot:hourly
# svcadm enable svc:/system/filesystem/zfs/auto-snapshot:hourly

Still have to test whether it works post-reboot without doing this every time.

11 November 2008

Flash and Firefox

Let's say you go to Pandora and it says you have to install the Flash plugin. You click on install, and it says it wasn't found and tells you to install it manually.

You go to the website and download flash_player_9_solaris_x86.tar.bz2. Then what?

As root, extract libflashplayer.so from the archive and drop it into /usr/lib/firefox/plugins. Restart Firefox and you're done =)

04 November 2008

Increasing swap size

At work today, my OpenSolaris b101 in Virtual Box on a Windows machine ran out of swap space. It had 512 assigned, which was the default, so I thought it would be enough... oh well, what to do?

# df -h
this will show how much space it has versus how much is in use...
# zfs list
this will show where the swap space comes from (probably rpool/swap)
# zfs set volsize=2G rpool/swap
set the swap filesystem to 2G
# reboot now
I am not sure if I *had* to reboot for it to take effect, but it worked well

I was going to try it at home (since I doubled the physical memory in that box) but only 1% of the swap space was in use, so I left it.

23 September 2008

Xen and VNC

When reading through this blog entry, I noticed this bit and so did that:
set the xen vnc password ( http://blogs.sun.com/shalon/entry/virt_install_demo )
# Set the prop in xvm which is used to initialize the console password
soe-x4600m2-2:root> svccfg -s xvm/xend setprop config/vncpasswd=astring:\"bacon\"
# Restart xend
soe-x4600m2-2:root> svcadm refresh xvm/xend; svcadm restart xvm/xend
I am not sure whether it is really required. I am uncomfortable that ANY user can read whatever password root sets.

08 September 2008

virt-manager


I upgraded to svn_96 (see last post) in order to install virt-manager. In my previous build (svn_94) the Package Manager didn't work - but in svn_96 it is working again. I did a search for 'virt' and chose to install the one xVM package that appeared to be missing...

At the end of the install, it appeared to have hung at 100%. I went to the command line and did 'pkg info SUNWvirt-manager' and it said it was installed, so I just closed the installer window. I reopened the Package Manager and verified it was installed.

Now to try to figure out how to use it =)

Upgrading to svn_96

I was following these instructions [General instructions for updating to the latest OpenSolaris development build] and had a couple issues (which I just ignored)...


$ BUILD=`uname -v | sed s/snv_//`
$ pfexec pkg refresh
$ pfexec pkg install SUNWipkg@0.5.11-0.${BUILD}
$ pfexec pkg install entire@0.5.11-0.${BUILD}
$ echo ${BUILD}
$ pfexec pkg image-update
$ beadm list

malachi@serveris:~$ pfexec beadm create opensolaris-2
beadm: Unable to create opensolaris-2

$ mkdir /tmp/mnt$$
$ pfexec beadm mount opensolaris-2 /tmp/mnt$$
$ pfexec pkg -R /tmp/mnt$$ image-update

malachi@serveris:~$ pfexec /tmp/mnt$$/boot/solaris/bin/update_grub -R /tmp/mnt$$
Creating GRUB menu in /tmp/mnt696
bootadm: biosdev command failed for disk: /dev/dsk/c5t0d0s0.
bootadm: is_bootdisk(): cannot determine BIOS disk ID 'hd?' for disk: /dev/dsk/c5t0d0s0
bootadm: biosdev command failed for disk: /dev/dsk/c5t1d0s0.
bootadm: is_bootdisk(): cannot determine BIOS disk ID 'hd?' for disk: /dev/dsk/c5t1d0s0
bootadm: get_grubroot(): cannot get (hd?,?,?) for menu. menu not on bootdisk: /dev/rdsk/c5t0d0s0
Installing grub on /dev/rdsk/c5t0d0s0
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 266 sectors starting at 50 (abs 16115)
Creating GRUB menu in /tmp/mnt696
bootadm: biosdev command failed for disk: /dev/dsk/c5t0d0s0.
bootadm: is_bootdisk(): cannot determine BIOS disk ID 'hd?' for disk: /dev/dsk/c5t0d0s0
bootadm: biosdev command failed for disk: /dev/dsk/c5t1d0s0.
bootadm: is_bootdisk(): cannot determine BIOS disk ID 'hd?' for disk: /dev/dsk/c5t1d0s0
bootadm: get_grubroot(): cannot get (hd?,?,?) for menu. menu not on bootdisk: /dev/rdsk/c5t1d0s0
Installing grub on /dev/rdsk/c5t1d0s0
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 266 sectors starting at 50 (abs 16115)

$ pfexec beadm unmount opensolaris-2
$ pfexec beadm activate opensolaris-2

at this stage, I manually updated my /rpool/boot/grub/menu.lst to show the correct menu options...

$ pfexec reboot

28 August 2008

Memory Upgrade

I upgraded the memory on the server from 4G to 8G today. Next step is to see if I can increase the swap space to compensate. Then start creating some domUs ;)

15 August 2008

Installing xVM

I used this as a starting point to get Xen running.

1. Install the base xVM
pkg install SUNWxvmhvm
pkg install SUNWvirtinst
pkg install SUNWlibvirt
pkg install SUNWurlgrabber
 
2. Configure GRUB (I did this step completely different)
pfexec gedit /rpool/boot/grub/menu.lst
add:
title   ... xVM
 findroot (pool_rpool,0,a)
 kernel$ /boot/$ISADIR/xen.gz
 module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS
 module$ /platform/i86pc/$ISADIR/boot_archive
 bootfs rpool/ROOT/opensolaris-1
3. Reboot into new configuration
4. 'uname -a' should contain 'i86xpv'
 
5. Startup the services
svcadm enable store
svcadm enable xend
svcadm enable console
svcadm enable domains
svcadm enable virtd 
 
6. Make sure they are running
malachi@serveris:~# svcs | grep xvm
online         19:34:15 svc:/system/xvm/store:default
online         19:34:22 svc:/system/xvm/xend:default
online         19:34:24 svc:/system/xvm/console:default
online         19:34:29 svc:/system/xvm/domains:default
online         19:34:33 svc:/system/xvm/virtd:default
 
Now to figure out how to do the domU :)

Default Router being dropped

When setting up the static routes, we did this:
svcadm disable svc:/network/physical:default
svcadm enable svc:/network/physical:nwam

At first that worked. Once I upgraded to the snv_94 it seemed to start disabling the default route (like here).  I fixed this by just re-enabling the physical:default service, which then reads the /etc/defaultrouter
svcadm enable svc:/network/physical:default

On boot, it started working again...

08 August 2008

Useful Commands

* Note: It is intended that this list be regularly updated and just provide a common place to find these...

  • pfexec reboot
  • pfexec gedit FILENAME

07 August 2008

Upgrading to 2008.11 snv_94 X86

I followed those instructions to do the update. The only exception to the instructions was that 2008.05 already had SUNWipkg@0.5.11,5.11-0.86 but I went ahead and updated it to -0.94 via the gnome System|Administration|Package Manager before doing the steps below that.

One weird thing on boot though is that I now have:
OpenSolaris 2008.05 snv_86_rc3 X86
opensolaris-1
Solaris 2008.11 snv_94 X86

I booted into the last one... even though the 2nd one that shows as active with beadm list. Seems to be working OK, but I should figure out what exactly is supposed to be there.

Roles can only be assumed by authorized users

The other day I went to reboot the system and found out I no longer had root access. I was very confused since I could not even su.  It kept telling me 'Roles can only be assumed by authorized users'.  I eventually figured out where I thought the problem was, but unfortunately didn't have permissions to fix it. In fact, no users on the system were authorized to fix it.  I ended up posting a question on the OpenSolaris Forums asking for help.  When I was at work today, I printed out a response so that I could try it when I got home. Unfortunately, the reply is no longer there for some reason, I can't give credit to whomever it was. Roumen provided this link to fix the problem. For those of you having this problem, here's what I did to cause it and to resolve it.

The Cause
When I was playing around with the Users and Groups, I went ahead and checked every single box. I mean, why not, I want full access, right? Nevermind that looking back I realize that some specifically say not to add them to users.

The Symptoms
I had basic user rights, but no root rights. I could not login as root, su to root, pfexec as root, save files owned by root, reboot the system, anything.

The Clue
Looking at /etc/user_attr, I noticed that while I did have the role=root attached to my name, there was a lot of garbage (read: all those checkmarks listed as profiles) before it.  Maybe 256 characters, maybe 512, I didn't honestly count.

I logged into the 2008.05 livecd and saw that jack only had Primary Administrator. Ok, I'll duplicate that.  Unfortunately, I couldn't find the real /etc directory in order to just rewrite it as jack.

Since I didn't have root access, I couldn't change the file.

The Solution
  1. Reboot
  2. At the GRUB prompt, hit e for edit
  3. Arrow down to the kernel$ line
  4. Hit e to edit
  5. Append -s to the end of the line and hit enter
  6. Hit b to start booting
  7. When prompted, type in the root password
  8. vi /etc/user_attr and remove all profiles except Primary Administrator from my account
  9. save the file, exit to the prompt, hit ctrl-D to exit single-user mode
You now have your root access back.

05 August 2008

Mirroring resolved the correct way!

Thanks to Mike Ellis for helping get this resolved correctly...

malachi@serveris:~# zpool detach rpool c5t1d0s2
malachi@serveris:~# zpool status -v
  pool: rpool
 state: ONLINE
 scrub: resilver completed after 0h1m with 0 errors on Tue Aug  5 21:16:53 2008
config:

    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      c5t0d0s0  ONLINE       0     0     0

errors: No known data errors

malachi@serveris:~# prtvtoc /dev/rdsk/c5t0d0s2 | fmthard -s - /dev/rdsk/c5t1d0s2
fmthard:  New volume table of contents now in place.

malachi@serveris:~# prtvtoc /dev/rdsk/c5t0d0s2
* /dev/rdsk/c5t0d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*   30400 cylinders
*   30398 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00    4209030 484134840 488343869
       1      3    01      16065   4192965   4209029
       2      5    01          0 488343870 488343869
       8      1    01          0     16065     16064
malachi@serveris:~# prtvtoc /dev/rdsk/c5t1d0s2
* /dev/rdsk/c5t1d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*   30400 cylinders
*   30398 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00    4209030 484134840 488343869
       1      3    01      16065   4192965   4209029
       2      5    01          0 488343870 488343869
       8      1    01          0     16065     16064
malachi@serveris:~#

malachi@serveris:~# zpool status
  pool: rpool
 state: ONLINE
 scrub: resilver completed after 0h1m with 0 errors on Tue Aug  5 21:16:53 2008
config:

    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      c5t0d0s0  ONLINE       0     0     0

errors: No known data errors
malachi@serveris:~# zpool attach rpool c5t0d0s0 c5t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c5t1d0s0 overlaps with /dev/dsk/c5t1d0s2
malachi@serveris:~# zpool attach -f rpool c5t0d0s0 c5t1d0s0

malachi@serveris:~# zpool status
  pool: rpool
 state: ONLINE
 scrub: resilver completed after 0h1m with 0 errors on Tue Aug  5 21:40:29 2008
config:

    NAME          STATE     READ WRITE CKSUM
    rpool         ONLINE       0     0     0
      mirror      ONLINE       0     0     0
        c5t0d0s0  ONLINE       0     0     0
        c5t1d0s0  ONLINE       0     0     0

errors: No known data errors

malachi@serveris:~# prtvtoc /dev/rdsk/c5t0d0s0
* /dev/rdsk/c5t0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*   30400 cylinders
*   30398 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00    4209030 484134840 488343869
       1      3    01      16065   4192965   4209029
       2      5    01          0 488343870 488343869
       8      1    01          0     16065     16064
malachi@serveris:~# prtvtoc /dev/rdsk/c5t1d0s0
* /dev/rdsk/c5t1d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*     255 tracks/cylinder
*   16065 sectors/cylinder
*   30400 cylinders
*   30398 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00    4209030 484134840 488343869
       1      3    01      16065   4192965   4209029
       2      5    01          0 488343870 488343869
       8      1    01          0     16065     16064
malachi@serveris:~#

malachi@serveris:~# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5t1d0s0
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 260 sectors starting at 50 (abs 16115)

Mirroring resolved

This post is no longer valid. Please check out this one instead.

So it was a bit tricky, but I think I got it to work...

1. Save the source disk partition table:
  • format c5t0d0
  • save (to format.dat)
  • quit
2. Repartition the destination disk:
  • format c5t1d0
  • fdisk (delete partition 1, exit)
  • fdisk (use the default, exit)
  • label ( 0 - SMI, use format.dat)
  • quit
3. Mirror to the 2nd slice
  • zpool attach -f rpool c5t0d0s0 c5t1d0s2
4. Install grub
  • installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5t1d0s0
5. Verify partition table is still correct...
  • format c5t0d0 and format c5t1d0
  • partition
  • print
  • (they should match)

Importing the old data pool

malachi@serveris:~# zpool import
  pool: data
    id: 16202109509961920001
 state: ONLINE
status: The pool is formatted using an older on-disk version.
action: The pool can be imported using its name or numeric identifier, though
    some features will not be available without an explicit 'zpool upgrade'.
config:

    data        ONLINE
      raidz2    ONLINE
        c6t0d0  ONLINE
        c6t1d0  ONLINE
        c7t0d0  ONLINE
        c7t1d0  ONLINE
        c8t0d0  ONLINE
malachi@serveris:~# zpool import data
cannot import 'data': pool may be in use from other system
use '-f' to import anyway
malachi@serveris:~# zpool import -f data
malachi@serveris:~# zpool status
  pool: data
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
    still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
    pool will no longer be accessible on older software versions.
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    data        ONLINE       0     0     0
      raidz2    ONLINE       0     0     0
        c6t0d0  ONLINE       0     0     0
        c6t1d0  ONLINE       0     0     0
        c7t0d0  ONLINE       0     0     0
        c7t1d0  ONLINE       0     0     0
        c8t0d0  ONLINE       0     0     0

errors: No known data errors
malachi@serveris:~# zpool upgrade data
This system is currently running ZFS pool version 10.

Successfully upgraded 'data' from version 6 to version 10

malachi@serveris:~# zpool status
  pool: data
 state: ONLINE
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    data        ONLINE       0     0     0
      raidz2    ONLINE       0     0     0
        c6t0d0  ONLINE       0     0     0
        c6t1d0  ONLINE       0     0     0
        c7t0d0  ONLINE       0     0     0
        c7t1d0  ONLINE       0     0     0
        c8t0d0  ONLINE       0     0     0

errors: No known data errors
malachi@serveris:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
data                 713260393        55 713260339   1% /data
[trimmed...] 
malachi@serveris:~# cd /data

02 August 2008

Mirrored ZFS bootable root

This post is no longer valid. Please check out this one instead.
 
So the instructions say that you are supposed to select two disks during installation to have it auto-mirror them. Unfortunately, it didn't allow me to select more than one disk (tried CTRL, Shift, mouse, keyboard, etc etc)... So, we are going to try to do it manually...

First, let's check the initial setup...
malachi@serveris:~$ zpool status
  pool: rpool
 state: ONLINE
 scrub: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      c5t0d0s0  ONLINE       0     0     0

errors: No known data errors
malachi@serveris:~$ zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
rpool   230G  2.45G   228G     1%  ONLINE  -
malachi@serveris:~$ zfs list
NAME                                 USED  AVAIL  REFER  MOUNTPOINT
rpool                               2.44G   224G  55.5K  /rpool
rpool@install                         16K      -  55.5K  -
rpool/ROOT                          2.29G   224G    18K  /rpool/ROOT
rpool/ROOT@install                      0      -    18K  -
rpool/ROOT/opensolaris              2.29G   224G  2.23G  legacy
rpool/ROOT/opensolaris@install      58.4M      -  2.22G  -
rpool/ROOT/opensolaris/opt          3.60M   224G  3.60M  /opt
rpool/ROOT/opensolaris/opt@install      0      -  3.60M  -
rpool/export                         157M   224G    19K  /export
rpool/export@install                  15K      -    19K  -
rpool/export/home                    157M   224G   157M  /export/home
rpool/export/home@install             18K      -    21K  -

So how do we know which drives are available for mirroring? We know that c5t0d0s0 is the one we want mirrored, but....

su then format
malachi@serveris:~# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c5t0d0
          /pci@0,0/pci1043,81fb@5/disk@0,0
       1. c5t1d0
          /pci@0,0/pci1043,81fb@5/disk@1,0
       2. c6t0d0
          /pci@0,0/pci1043,81fb@5,1/disk@0,0
       3. c6t1d0
          /pci@0,0/pci1043,81fb@5,1/disk@1,0
       4. c7t0d0
          /pci@0,0/pci1043,81fb@5,2/disk@0,0
       5. c7t1d0
          /pci@0,0/pci1043,81fb@5,2/disk@1,0
       6. c8t0d0
          /pci@7b,0/pci1043,81fb@5/disk@0,0
Specify disk (enter its number):
Specify disk (enter its number): ^C


It looks like c5t1d0 is the best choice...
malachi@serveris:~# zpool create rpool mirror c5t0d0s0 c5t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c5t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).
malachi@serveris:~# 

hmmm.. yes, we knew it was... we wanted to make a copy... hmmm
malachi@serveris:~# zpool add rpool c5t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c5t1d0s0 is part of exported or potentially active ZFS pool rootpool. Please see zpool(1M).


hmmm... is that from the current install or the previous install?
malachi@serveris:~# zpool attach rpool c5t0d0s0 c5t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c5t1d0s0 is part of exported or potentially active ZFS pool rootpool. Please see zpool(1M).


hmmm....
malachi@serveris:~# zpool attach -f rpool c5t0d0s0 c5t1d0s0
cannot attach c5t1d0s0 to c5t0d0s0: device is too small


hmmm, I tried formatting c5t1d0s0, but it still won't attach
zpool import shows that the other drives are still set as a raidz, so this is definitely the right drive... how to get it to import?

I think I may have to start over and use the manual installer rather than the GUI installer :(

01 August 2008

Setting up a static network configuration with NWAM

Step 1: Figure out which network interface to use...

malachi@serveris:/etc/nwam# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
nge0: flags=201004843 mtu 1500 index 12
    inet 10.10.1.155 netmask ffffff00 broadcast 10.10.1.255
    ether 0:18:f3:d5:cd:9b
nge1: flags=201000802 mtu 1500 index 13
    inet 0.0.0.0 netmask 0
    ether 0:18:f3:d5:cd:9c
lo0: flags=2002000849 mtu 8252 index 1
    inet6 ::1/128


Step 2: Setup the nameservers....
gedit /etc/resolv.conf
add in the DNS servers...
EX:
nameserver 10.10.1.1
nameserver 66.93.87.2
nameserver 216.231.41.2


Step 3: Switch to using the DNS servers...
malachi@serveris:/etc# cp nsswitch.conf nsswitch.conf.original
malachi@serveris:/etc# cp nsswitch.dns nsswitch.conf
malachi@serveris:/etc# svcadm restart svc:/network/dns/client:default

Step 4: Switch to a static IP
gedit /etc/nwam/llp
change the 'nge0 dhcp' (or whatever device from Step 1) to 'nge0 static 10.10.1.10/24' (or whatever ip)

svcadm restart svc:/network/physical:nwam

Only video mode: 640x480

After a fresh install, the only video mode I had available was 640x480 @ 50 Hz. Well, that's definitely not right. It could be because of the KVM, but I noticed a lot of people using nVidia had the same problem. I used the notes I found here to fix it...

I changed quite a few things, saved, exited, came back in, ran the utility again and saved the config once I had it where I wanted it... That of course overwrote most of the changes (like the monitor name), so... here's the tidbit end result that matters...
Section "Monitor"
    # HorizSync source: xconfig, VertRefresh source: xconfig
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "CRT-0"
    HorizSync       30.0 - 81.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Fresh Install!

So I decided to start over... I just installed OpenSolaris 2008.05

Will be posting configuration notes as I go so that it is easy to find them again later =)