Solaris-Express

nsswitch.conf SMF config

# svccfg svc:> select dns/client svc:/network/dns/client> setprop config/search = astring: \ (“us.company.com” “eu.company.com” “companya.com” “companyb.com” “company.com” ) svc:/network/dns/client> setprop config/nameserver = net_address: \ ( 138.2.202.15 138.2.202.25 ) svc:/network/dns/client> select dns/client:default svc:/network/dns/client:default> refresh svc:/network/dns/client:default> validate svc:/network/dns/client:default> select name-service/switch svc:/system/name-service/switch> setprop config/host = astring: “files dns” svc:/system/name-service/switch> select system/name-service/switch:default svc:/system/name-service/switch:default> refresh svc:/system/name-service/switch:default> validate svc:/system/name-service/switch:default> # svcadm enable dns/client # svcadm refresh name-service/switch # grep host /etc/nsswitch.conf hosts: files dns # cat /etc/resolv.conf # # opyright (c) 2011, Oracle and/or its affiliates. All rights reserved. #

zfs share for Time machine backups

I’ve tried using a share for time machine before, but due to the nature of how time machine works it eventually consumed all the spare space that is available on that particular share.

bring on zfs quotas… (my drive on my mini mac is 100GB, so 200GB should be enough for a few variations)

zfs set quota=200G unprotected/timemachine

This adds a artificial limit to your zfs filesystem, making sure that time machine does not consume more than 200 gigabytes of space.

opensolaris - setting up dhcp

You’ll need these two packages installed;

SUNWdhcs, SUNWdhcm

First ensure that the DHCP service is running. Go into the “services” gui and tick the box to enable the DHCP server.

now from commandline run…

dhcpmgr
  1. From edit menu choose “network wizard”, step through the wizard (defautls are o.k i you have a fixed IP already assigned to your opensolaris box)
  2. From edit menu choose “address wizard”

If you step through the wizard (the following is an example of what i have choosen)

solaris - storage server

http://p2v.it/2010/04/15/a-next-generation-multiprotocol-storage-for-your-homelab-on-a-budget-part-1/

Setup iSCSI target using comstar – pkg install -v storage-server pkg install pkg:/SUNWiscsit svcadm enable stmf svcadm enable svc:/network/iscsi/target:default itadm create-target reboot – -r

Create the iSCSI store — zfs create -V 100G DataPool/TestDatastore1 sbdadm create-lu /dev/zvol/rdsk/DataPool/TestDatastore1 stmfadm create-hg ESX4-group stmfadm add-hg-member -g ESX4-group wwn.2100001b329711bd wwn.2101001b32b711bd stmfadm add-view -h ESX4-group -n 0 600144F03EBEC50000004BA86E460001 stmfadm list-lu -v

install crashplan on solaris

http://support.crashplan.com/doku.php/getting_started/installing_crashplan

Move the downloaded tar.gz file into /var/spool/pkg/

mv CrashPlan_2010-03-08_Solaris.tar.gz /var/spool/pkg/

Unpack the archive.

tar -xzvf CrashPlan_2010-03-08_Solaris.tar.gz

Install the CrashPlan package:

sudo /usr/sbin/pkgadd

Start CrashPlan Engine:

sudo /opt/sfw/crashplan/bin/CrashPlanEngine start

Start CrashPlan Desktop:

sudo /opt/sfw/crashplan/bin/CrashPlanDesktop

To enable CrashPlan PRO as a service (as root):

svccfg import /opt/sfw/crashplan/bin/crashplan.xml

svcadm enable crashplan

check that the service has come online proplery (then load client)

svcs -a | grep crashplan

online         21:18:43 svc:/crashplan:default

zfs : accidentally adding cache drive to raidz zpool

http://forums.freebsd.org/showthread.php?t=23127

Unfortunately if you have accidentally added a single drive into your raidz pool at the top-level there is no way to just remove the non redundant disk. Your pool is now dependant on this disk.

If you want your pool to be just raidz vdevs, then you will need to backup your data, destroy your pool, create a new pool, and restore your data.

There is no current way to remove a top-level vdev from a pool.

OpenSolaris is Dead

http://sstallion.blogspot.com/2010/08/opensolaris-is-dead.html

OpenSolaris is Dead.

What follows is an email sent internally to Oracle Solaris Engineers which describes Oracle’s true intentions toward the OpenSolaris project and the future of Oracle Solaris.

This concludes over four years that I (and many other external contributors) have worked on the OpenSolaris project. This is a terrible sendoff for countless hours of work - for quality software which will now ship as an Oracle product that we (the original authors) can no longer obtain on an unrestricted basis.

I can only maintain that the software we worked on was for the betterment of all, not for any one company’s bottom line. This is truly a perversion of the open source spirit.

opensolaris - increase swap

I found this on opensolaris forums…. A nice way to increase your swap without the need for a reboot.

First check your current swap size and details;

swap -lh

or

zfs list

Then create a temp swap zfs store and delete and increase swap

zfs create -V rpool/swp

swap -a /dev/zvol/dsk/rpool/swp

swap -d /dev/zvol/dsk/rpool/swap

zfs destroy rpool/swap

zfs create -V rpool/swap

swap -a /dev/zvol/dsk/rpool/swap

swap -d /dev/zvol/dsk/rpool/swp

zfs destroy rpool/swp

4k sector hard drives and zfs

I hit this as a problem recently. One of my disks died in my raidz so i ran down to the store and grabbed me a replacement WD10EARS (Western Digital 1Tb Green) drive.

BUT…

The one thing the store didn’t mention to me is the new 4K cluster sizing on the drive. I guess they assume most people run windows (though the issues are also present in XP). See these posts…

opensolaris - pkg verify

I ran through a pkg verify the other day and came across a lot of errors. Running the subsequent pkg fix command presented me with this…

pkg: Requested “install” operation would affect files that cannot be modified in live image.

Please retry this operation on an alternate boot environment.

This is the fix….

mkdir /mnt/osol-134fix beadm create osol-134fix beadm mount osol-134fix /mnt/osol-134fix pkg -R /mnt/osol-134fix fix –accept beadm activate osol-134fix

opensolaris v134 - CIFS has gone walkies

Errr, I cant find the CIFS service in the 134 build.

I know it was renamed to as per below but still cant see it anywhere?

> system/file-system/smb (was SUNWsmbfs*) > service/file-system/smb (was SUNWsmbs*)

Anyone have any ideas?

pkg search *smb gets me these… but i cant install them.

require depend service/file-system/[email protected] pkg:/[email protected] require depend service/file-system/[email protected] pkg:/storage/[email protected] require depend service/file-system/[email protected] pkg:/system/security/[email protected] require depend service/file-system/[email protected] pkg:/storage/[email protected] require depend system/file-system/[email protected] pkg:/[email protected] require depend system/file-system/[email protected] pkg:/storage/[email protected] require depend system/file-system/[email protected] pkg:/[email protected]

zfs - now has dedup!

Cool. zfs as of version 21 has deduplication built in. And thats the good dedup - synchronous dedup. i.e. deduped on the fly!

How easy is it to turn on? - very!

Once you have upgraded your zpool to 21 or above you can run the following command at the pool level and deduplication will be over all your data from that point onwards.

zpool set dedup=on tank

Done

Note : Watch your performance, it will drop like a rock if you do not have enough ram for your dedup tables. Do some tests after enabling this feature.

OpenSolaris - iSCSI

Want iSCSI in opensolaris?

Grab SUNWiscsitgt via package manager.

enable the server via svcadm;

svcadm enable iscsitgt

create your zfs iscsi pool;  (this command will limit iscsi drive to 500GB in size)

zfs create -V 500G tank/iscsi

set isci on via zfs command;

zfs set shareiscsi=on tank/iscsi

check that target is up and running;

iscsitadm list target -v

Done. Should be able to connect via ip from another machine. I have not covered CHAP or any client side configuration. Assumed isolated LAN.

Opensolaris - ZFS recovery after kernel panic

Recently i hit what i thought was a huge disaster with my ZFS array. Essentially i was unable to import my zpool without causing the kernel to panic and reboot. Still unsure of the exact reason, but it didn’t seem to be due to a hardware fault. (zpool import showed all disks as ONLINE)

When i tried to import with zpool import -f tank the machine would lockup and reboot (panic).

Opensolaris - white screen on logon

I had this problem when i enabled 3d effects on my server. The screen just goes white and you cannot see anything. Even after a reboot as soon as you logon to gnome the screen goes white.

To fix you’ll need to logon using a “failsafe terminal” session, then run gnome-cleanup from the command line. This will blow away any of your gnome settings (although they are actually backed up to a file), but it’ll mean you’ll be able to logon again without issue.

Opensolaris - Samba and Network browsing

If you’ve setup samba (rather than the builtin cifs/smb) chances are that you can only browse to your samba shares directly on IP only.

If you want your box “network browseable” you’ll need to load nmbd.

You can find a really good write up on modifiying the SMF for samba to autostart the required service here : http://wikis.sun.com/display/BigAdmin/Enabling+Browsing+with+Samba+in+Solaris+10+Update+4

import this file samba.xml

run these commands;

# svcadm disable samba
# svccfg import samba.xml
# svccfg delete svc:/network/samba:default
# svcadm refresh samba:smbd
# svcadm refresh samba:nmbd
# svcadm enable samba:smbd
# svcadm enable samba:nmbd