Root zfs mirror boot

Posted in software with tags , , on 2009.03.13 by ipv5

Status on booting opensolaris from a zfs redundant array:

  • the installation does not provide the option to do it
  • you cannot boot from a raidz (i.e.: raid5) zpool
  • you can boot from a zpool mirror, but you must create the mirror after the single-disk zpool installation

To get the / zpool up, her’s a very nice console howto, based on this other posting.

Breaking and fixing it:

To test the resilience of the system I created the mirror, booted from a livecd partitioner, erased the second disk, and finally rebooted from the installed system.

The mirror was recognized as degraded, and I was able to recover it without a hitch using the aforementioned howto.

admin@opensolaris:~$ zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
rpool 232G 4.49G 228G 1% DEGRADED –
admin@opensolaris:~$ zpool status
pool: rpool
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using ‘zpool online’.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool DEGRADED 0 0 0
mirror DEGRADED 0 0 0
c4d0s0 ONLINE 0 0 0
c4d1s0 UNAVAIL 9 1.91K 0 cannot open

errors: No known data errors
admin@opensolaris:~$

admin@opensolaris:~$ pfexec zpool detach rpool c4d1s0
admin@opensolaris:~$ zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:

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

errors: No known data errors

admin@opensolaris:~# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c4d0 <drive type unknown>
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c4d1 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
2. c5d0 <ST325062-         5QE3FBW-0001-232.83GB>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
3. c5d1 <ST325062-         5QE3FAA-0001-232.83GB>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@1,0
Specify disk (enter its number): 0

AVAILABLE DRIVE TYPES:
0. DEFAULT
1. other
Specify disk type (enter its number): 0
selecting c4d0
No current partition list
No defect list found
[disk formatted, no defect list found]

No fdisk solaris partition found.

FORMAT MENU:
disk       – select a disk
type       – select (define) a disk type
…..
volname    – set 8-character volume name
!<cmd>     – execute <cmd>, then return
quit
format> fdisk
No fdisk table exists. The default partition for the disk is:

a 100% “SOLARIS System” partition

Type “y” to accept the default partition,  otherwise type “n” to edit the
partition table.
y
format> quit
admin@opensolaris:~#

admin@opensolaris:~$ pfexec prtvtoc /dev/rdsk/c4d0s2 | fmthard -s- /dev/rdsk/c4d1s2
fmthard: Cannot open device /dev/rdsk/c4d1s2 – Permission denied
admin@opensolaris:~$ su
Password:
admin@opensolaris:~# prtvtoc /dev/rdsk/c4d0s2 | fmthard -s- /dev/rdsk/c4d1s2
fmthard: New volume table of contents now in place.

admin@opensolaris:~# zpool attach -f rpool c4d0s0 c4d1s0
Please be sure to invoke installgrub(1M) to make ‘c4d1s0’ bootable.
admin@opensolaris:~# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4d1s0
Updating master boot sector destroys existing boot managers (if any).
continue (y/n)?y
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 267 sectors starting at 50 (abs 16115)
stage1 written to master boot sector

admin@opensolaris:~# zpool status
pool: rpool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h2m, 50.72% done, 0h2m to go
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror ONLINE 0 0 0
c4d0s0 ONLINE 0 0 0 3.00M resilvered
c4d1s0 ONLINE 0 0 0 2.28G resilvered

errors: No known data errors

Unfortunatey, while zapping the second disk, rebooting, reconstructing et al worked perfectly, when I tried and zapped the first disk the machine hanged at boot showing only:

GRUB

Booting from the livecd, importing the zpool mirror and fixing it (with the same method) however worked just fine.

jack@opensolaris:~# zpool import
pool: rpool
id: 15289673696250060511
state: DEGRADED
status: The pool was last accessed by another system.
action: The pool can be imported despite missing or damaged devices.  The
fault tolerance of the pool may be compromised if imported.
see: http://www.sun.com/msg/ZFS-8000-EY
config:

rpool       DEGRADED
mirror    DEGRADED
c4d0s0  UNAVAIL  cannot open
c4d1s0  ONLINE
jack@opensolaris:~# zpool list
no pools available
jack@opensolaris:~# zpool import rpool
cannot import ‘rpool’: pool may be in use from other system, it was last accessed by opensolaris (hostid: 0xc75b92) on Fri Mar 13 02:59:45 2009
use ‘-f’ to import anyway
jack@opensolaris:~# zpool import -f rpool
jack@opensolaris:~# zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
rpool   232G  4,49G   228G     1%  DEGRADED  –

jack@opensolaris:~# zpool detach rpool c4d0s0
jack@opensolaris:~# zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:

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

errors: No known data errors

jack@opensolaris:~# format
Searching for disks…done

AVAILABLE DISK SELECTIONS:
0. c4d0 <drive type unknown>
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
1. c4d1 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
/pci@0,0/pci-ide@1f,2/ide@0/cmdk@1,0
2. c5d0 <ST325062-         5QE3FBW-0001-232.83GB>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@0,0
3. c5d1 <ST325062-         5QE3FAA-0001-232.83GB>
/pci@0,0/pci-ide@1f,2/ide@1/cmdk@1,0
Specify disk (enter its number): 0

AVAILABLE DRIVE TYPES:
0. DEFAULT
1. other
Specify disk type (enter its number): 0
selecting c4d0
No current partition list
No defect list found
[disk formatted, no defect list found]

No fdisk solaris partition found.

FORMAT MENU:
disk       – select a disk
type       – select (define) a disk type
…..
volname    – set 8-character volume name
!<cmd>     – execute <cmd>, then return
quit
format> fdisk
No fdisk table exists. The default partition for the disk is:

a 100% “SOLARIS System” partition

Type “y” to accept the default partition,  otherwise type “n” to edit the
partition table.
y
format> quit
jack@opensolaris:~#

jack@opensolaris:~# prtvtoc /dev/rdsk/c4d1s2 | fmthard -s- /dev/rdsk/c4d0s2
fmthard:  New volume table of contents now in place.

jack@opensolaris:~# zpool attach -f rpool c4d1s0 c4d0s0
Please be sure to invoke installgrub(1M) to make ‘c4d0s0’ bootable.

jack@opensolaris:~# zpool status
pool: rpool
state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 0,86% done, 0h44m to go
config:

NAME        STATE     READ WRITE CKSUM
rpool       ONLINE       0     0     0
mirror    ONLINE       0     0     0
c4d1s0  ONLINE       0     0     0  1,57M resilvered
c4d0s0  ONLINE       0     0     0  39,4M resilvered

errors: No known data errors

jack@opensolaris:~# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4d0s0
Updating master boot sector destroys existing boot managers (if any).
continue (y/n)?y
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 267 sectors starting at 50 (abs 16115)
stage1 written to master boot sector

not dead (yet)

Posted in wetware on 2008.07.26 by ipv5

just a little trip to the hospital, not anythin nice but hey, I’m still vertical and breathing

Opensolaris step by step guides

Posted in software with tags , , on 2008.05.14 by ipv5

Yes, yes, unix is user-friendly, we all know the pun. However non anyone is unix literate, so here’s a collection of all the step-by-step guides I found on opensolaris 2008.05 aka indiana.

Opensolaris install.

Opesolaris install into virtualbox.

Opensolaris install into parallels on a mac (yes, it’s in chinese, however auto translation is provided, and it’s almost all screenshots).

How to read opensolaris hard disks (or partitions) in windows and linux, it requires a bit of work, but it’s easily doable regardless of unix literacy.

Ironing out opensolaris 2008.05 issues

Posted in software with tags , , , , on 2008.05.12 by ipv5

(see also this post on how to install it on a Dell inspiron 2650 )

install flash player:

$ cd
$ mkdir .mozilla/plugins/
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/flash_player_9_solaris_x86.tar.bz2
$ tar xvjf flash_player_9_solaris_x86.tar.bz2
drwxr-xr-x leon.sha/other 0 2008-04-03 01:04 flash_player_9_solaris_r124_x86/
-rw-r--r-- leon.sha/other 856 2008-04-03 01:04 flash_player_9_solaris_r124_x86/flashplayer.xpt
-rwxr-xr-x leon.sha/other 6733684 2008-04-03 01:04 flash_player_9_solaris_r124_x86/libflashplayer.so
$ cp flash_player_9_solaris_r124_x86/* ~/.mozilla/plugins/

Pidgin does not start:

Invoke it via a shell script like this:
#!/bin/sh
LD_LIBRARY_PATH="/usr/lib/mps"
export LD_LIBRARY_PATH

/usr/bin/pidgin

Icons not showing up in the menu:

the gnome menu reads /usr/share/applications for application.desktop files, packages do provide them, but if they are not showing up they got installed somewhere else, just copy/symlink ’em.
more on the .desktop format at http://standards.freedesktop.org/desktop-entry-spec/latest/

Nautilus is dumb:

You’ll need to create a Documents folder in your home, for a start.

Quick OpenSolaris pkg howto

Posted in software with tags , , , on 2008.05.11 by ipv5

Well, time for me to learn YAPMSTM (Yet Another Package Management System).
Opensolaris 2008.05 ships with the IPS Image Packaging System, which, even if it’s got very few packages, has both command line and gui tools.

search for an installed package:

# pkg list -s | egrep or whatever you like
NAME (AUTHORITY) SUMMARY
FSWxorg-fonts X.Org Foundation X11 fonts
SUNW1394 Sun IEEE1394 Framework
SUNWDTraceToolkit SUNWDTraceToolkit
...

or

# pkg search -l zip
INDEX ACTION VALUE PACKAGE
basename file usr/bin/zip pkg:/SUNWzip@2.32-0.86
# pkg info -l pkg:/SUNWzip@2.32-0.86
Name: SUNWzip
Summary: The Info-Zip (zip) compression utility
State: Installed
Authority: opensolaris.org (preferred)
Version: 2.32
Build Release: 5.11
Branch: 0.86
Packaging Date: Sat Apr 26 18:12:56 2008
Size: 167 kB
FMRI: pkg:/SUNWzip@2.32,5.11-0.86:20080426T181256Z
# pkg contents pkg:/SUNWzip@2.32-0.86
PATH
usr
usr/bin
usr/bin/zip
usr/bin/zipcloak
usr/bin/zipnote
usr/bin/zipsplit

check for updated packages:

# pkg list -u
NAME (AUTHORITY) VERSION STATE UFIX
entire 0.5.11-0.86 installed u---
openoffice 2.4.0-0.86 installed u---

search for and install new packages:

# pkg search -r rdesktop
INDEX ACTION VALUE PACKAGE
basename file usr/bin/rdesktop pkg:/SUNWrdesktop@0.5.11-0.86
basename file usr/bin/rdesktop pkg:/SUNWrdesktop@0.5.11-0.86
# pkg install -n -v SUNWrdesktop
Before evaluation:
UNEVALUATED:
+pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z


After evaluation:
None -> pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z
None
# pkg install -v SUNWrdesktop
Before evaluation:
UNEVALUATED:
+pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z

After evaluation:
None -> pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z
None
DOWNLOAD PKGS FILES XFER (MB)
Completed 1/1 42/42 0.27/0.27

PHASE ACTIONS
Install Phase 55/55

add other repositories:

# pkg set-authority -O http://pkg.sunfreeware.com:9000 sunfreeware.com
# pkg set-authority -O http://blastwave.network.com:10000 blastwave.org
# pkg authority
AUTHORITY URL
opensolaris.org (preferred) http://pkg.opensolaris.org:80/
blastwave.org http://blastwave.network.com:10000/
sunfreeware.com http://pkg.sunfreeware.com:9000/
# pkg refresh --full

uh?:

# pkg info -l pkg:/openoffice@2.4.0-0.86
Name: openoffice
Summary: Base module for OpenOffice.org 2.4
State: Installed
Authority: opensolaris.org (preferred)
Version: 2.4.0
Build Release: 5.11
Branch: 0.86
Packaging Date: Thu Apr 24 10:48:39 2008
Size: 420.6 MB
FMRI: pkg:/openoffice@2.4.0,5.11-0.86:20080424T104839Z


# pkg info -r pkg:/openoffice@2.4.0-0.86
Name: openoffice
Summary: Base module for OpenOffice.org 2.4
State: Not installed
Authority: opensolaris.org (preferred)
Version: 2.4.0
Build Release: 5.11
Branch: 0.86
Packaging Date: Mon Apr 28 16:36:48 2008
Size: 420.6 MB
FMRI: pkg:/openoffice@2.4.0,5.11-0.86:20080428T163648Z

I wonder why the build release does not increment… oh, well, it does not do it even for entire it does seem…

updating the system:

# pkg image-update -n -v
Before evaluation:
UNEVALUATED:
+pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z

After evaluation:
pkg:/entire@0.5.11,5.11-0.86:20080426T182618Z -> pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z
None
# pkg image-update -v
Before evaluation:
UNEVALUATED:
+pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z

After evaluation:
pkg:/entire@0.5.11,5.11-0.86:20080426T182618Z -> pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z
None
PHASE ACTIONS
Update Phase 1/1
Install Phase 3/3
A clone of opensolaris exists and has been updated and activated. On next boot the Boot Environment opensolaris-1 will be mounted on '/'. Reboot when ready to switch to this updated BE.
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 3.18G 14.0G 56.5K /rpool
rpool@install 18.5K - 55K -
rpool/ROOT 2.95G 14.0G 18K /rpool/ROOT
rpool/ROOT@install 15K - 18K -
rpool/ROOT/opensolaris 233K 14.0G 2.12G legacy
rpool/ROOT/opensolaris-1 2.95G 14.0G 2.12G legacy
rpool/ROOT/opensolaris-1@install 352M - 2.22G -
rpool/ROOT/opensolaris-1@static:-:2008-05-10-22:50:27 44.0M - 2.12G -
rpool/ROOT/opensolaris-1/opt 450M 14.0G 450M /opt
rpool/ROOT/opensolaris-1/opt@install 121K - 3.61M -
rpool/ROOT/opensolaris-1/opt@static:-:2008-05-10-22:50:27 0 - 450M -
rpool/ROOT/opensolaris/opt 0 14.0G 450M /opt
rpool/export 233M 14.0G 19K /export
rpool/export@install 15K - 19K -
rpool/export/home 233M 14.0G 233M /export/home
rpool/export/home@install 19K - 21K -

interesting links:

how to create your own ips repository, some primers from the os people, either in plain old html, o as a screencast. And here there’s even more links.

Essential Firefox plugins

Posted in software with tags , on 2008.05.10 by ipv5

Well, not so essential maybe, but I cannot resist modding the hell out of this browser.

Screen Real estate

Browsing aids

Security

Search engines

If anyone passing by knows some must-have plugins I’ve not mentioned please do leave a comment

Opensolaris 2008.05 on a Dell inspiron 2650

Posted in software with tags , , on 2008.05.8 by ipv5

Got this laptop just in time for the opensolaris install, let’s find out if we can get an usable system.

The dvd drive is REALLY noisy, but the livecd booted without a hitch. You get a boot menu (standard, console and boot from hdd), then a keyboard/desktop language selection text menu, and you’re ready to go.

The livecd boots into a nice desktop (and a big window containing the various licenses it’s under) with The Usual StuffTM (but there’s nmapfe as well). One really nifty things is the “Device driver utility”, it prints out everything it’s found out on your hardware, what drivers it’s using for it, and if there’s any driver missing (in my case: acpi and the crappy winmodem, I can live without em). And there’s even a “submit” button to send your configuration to them, with any comments you choose to write. I hope the hardware database will increase a lot with this.

I’m trying it on a relatively low end machine, but even the livecd seems quite snappy (for a gnome desktop of course).

Well, time to install. And with a big “Install OpenSolaris” icon on the desktop you cannot go wrong.

(btw, you can find step-by-step instructions here)

Unfortunately it seems Opensolaris is as temperamental as any unix around about cd drives, and this laptop’s one is a bit crappy, so the install hangs at “Finding disks”. Well, replacing it was not difficult, here are the instructions if you need them. The installer took its own good time getting to the disk selection this time, but at least we got there.

After the installation, it (slowly) boots the new system, it seems the default install is on zfs.

The installation it’s pretty standard, with the usual bunch of apps, notable additions include:

  • disk analyzer (why in the blazes / is 100% full anyway?)
  • nmapfe
  • an nvidia control panel

The package manager is nice, but some vital tools (wireshark for example) are missing, I’ll try with blastwave later.

removed:

  • a bunch of drivers for stuff I do not have
  • firefox and thunderbird localizations
  • guides in languages I do not know
  • evolution (nice to know the exchange connector is included by default however)
  • the gnome a11y stuff (text2speech etc)
  • gnome i10 messages
  • the iiimf (an input method switcher daemon) (NB: except the a11y libs, see below why)
  • vnc server
  • compiz & associated stuff (this video card cannot really drive it)
  • ftp server
  • sun firmware flash update tools
  • gnome digital camera tools
  • gnome cd ripper
  • gnome remote desktop aka vino
  • gnome sound recorder
  • tftpd (wtf?)

installed:

  • openoffice (420 Mb, ouch), wich got added right away in the menu
  • the gnome hex editor
  • vnc client
  • rdp client
  • cd burning utilities
  • cvs
  • netcat
  • vscan (I’ll probably get clamav too)
  • pgadmin, the postgresql visual manager (and of course I cannot find the mysql one… right…)

I was not able to manually configure the network until the “Physical network interface autoconfiguration” daemon (and since I’m fiddling with service i’ll disable stuff I do not need too, like ipv6)

The network-admin gnome tool does not work correctly (I liked it, since you can define locations), but usual cli management did.

# ifconfig elxl0 plumb
# ifconfig elxl0 netmask 255.255.255.0 10.0.0.8
# ifconfig elxl0 up
# echo "nameserver 10.0.0.1" > resolv.conf
# cp /etc/nsswitch.dns /etc/nsswitch.conf
# route add default 10.0.0.1

I’ve installed inetmenu and it’s definitely better, even if I cannot find a way of entering multiple dns servers.
# wget http://www.opensolaris.org/os/community/laptop/downloads/inetmenu-2.3.2.pkg.gz
# gunzip inetmenu-2.3.2.pkg.gz
# pkgadd -d ./inetmenu-2.3.2.pkg
# cd /etc/inetmenu
# cp SAMPLE home
# vi home

And here we go, just add Ginetmenu to your profiles in /etc/user_attr if you want to use it as non-root (btw, the user created during setup got root privileges, go figure). It also spits out an error message at boot warning me to execute it in an x session, but I’ll ignore it for now.

Oh, nice, if I lock the screen from the menu, when I try to unlock xscreensaver complains it cannot find the libloginhelper, and just sits there screensavering. Umh, seems deleting all of a11y was not such a good idea after all. Reinstalled SUNWgome-a11y-libs

Then there’s the nvidia tool. It seems the default install does not use the nvidia driver, and a message instructs me to run nvidia-xconfig as root, lessee…

It seems this machine is a bit too old for this, And I need the 96.43.xx legacy drivers (instead of the 169.12 I’ve got installed), which can be found here. So…
# wget http://us.download.nvidia.com/solaris/96.43.05/NVIDIA-Solaris-x86-96.43.05.run
# sh NVIDIA-Solaris-x86-96.43.05.run

The installed drivers conflicts with the new ones, let’s fire up idm for the nth time today and nuke them. (the package name is NVDAgraphics btw)

Umh, x cannot find the glx module, even if it’s loading it, wtf?

# cd /usr/X11/lib/modules/extensions
# rm libglx.so
# ln -s ./NVIDIA/libglx.so

Well, this time it worked, even if I have a weird bug: starting the system my screen (after the nvidia logo) is all bunched up, after I ctrl-alt-backspace X11 it goes to normal… go figure.

And for now, that’s all folks

edit: no flashplayer, but you can get it from adobe and simply untar the two files in your ~/.mozilla/plugins/