Posts

OpenSolaris cifs/smb server - configuring ACL's on shares

O.k. from this  point I’m assuming you have created your zfs shares via the zfs command and renamed appropriately like so…..   (if you havent setup cifs yet then check read this)

zfs set sharesmb=on protected/backup

zfs set sharesmb=name=backup protected/backup

Now to check your current shares type…

sharemgr show

zfs

zfs/protected/backup backup=/protected/backup

zfs/protected/photos photos=/protected/photos

Now its time to look at NFSv4 ACL’s. This page has a great explanation of ACL’s and how to set things up. http://cuddletech.com/blog/pivot/entry.php?id=939

OpenSolaris - Migrating from samba to cifs

OpenSolaris 2008.11 has a cifs/smb server built into the kernel. From what i have been reading (and discovering) this is a much more efficient and faster way to get your files out into the network.

Previously i have run a dedicated samba service to share my files as I’ve come from various linux distros which require it. Seems i should be doing things differently on OpenSolaris.

The dedicated samba service is called;

OpenSolaris - RTL8111/8168B issues

I’ve got an integrated RTL8111 nic which seemed to work fine under opensolaris 2008.11. But if the nic was put under load for a various length of time it seemed to just drop off the network.

At first i thought it was my SMB service dying, but after a quick ping i relised i had lost the entire TCP/IP stack on that particular card. Hmm…

It does come back online if you are patient and wait for about 5mins or so.

Linux - Add DHCP and DNS

How to install DHCP and DNS on Fedora / Centos / Redhat box;

yum -y install dhcp.i386 bind.i386

Set services to auto start using ntsysv – services are called “dhcpd” and “named”.

How to configure dhcp;

nano /etc/dhcpd.conf — configure as per sample provided. The sample is usually located in the same directory. service dhcpd restart - should start without problem if done correctly

Note: dhcp range has to be on the same network as your adapter. You can run dhcpd from the command line to diagnose any issues.

OpenSolaris - Manual Network DNS issue

If you have tried to setup a manual IP on your opensolaris box you may find that DNS is not working as you would expect in some cases. nslookup resolves the name to an ip, but pinging doesnt make it to the box…

How to fix;

Edit your /etc/nsswitch.conf file and add the word “dns” to the hosts and ipnodes lines If you make a backup of /etc/nsswitch.conf you can also just copy /etc/nsswitch.dns over it…

Linux - Wireless networking

if your card is natively supported type ;

iwconfig

iwlist scanning – should also show you the wireless networks that are in range (will work if driver is loaded)

you should see wlan0 if all is good; (grab your wireless details)

iwconfig wlan0 mode managed (should already be in this mode)

there are some cool options here like “secondary” mode which the node acts as a backup master/repeater. “Repeater” - the node forwards packets between other wire-less nodes

ZFS - Creating snapshots

There is some funky ways of modifying the default “time slider” services to do the work for you, but i like a bit more hands on. Generally so i know what is happening in the background, but the time slider can be sometimes overkill creating snapshots every 15 mins if not configured properly.

On a side note i’ve yet to get my head around the SMF stuff properly… Anyhow onto creating snapshots.

Corporate Firewall - SSH and port 443 goodness

Things you’ll need; (basic instructions) SSH - either Linux or Open SSH for windows (set this up first and ensure its working!). I have only used Linux, so i do not know the details of setting up a Open SSH box on windows (good luck).

Router with pinhole or port forwarding abilities. – forward your external 443 port to internal 22 on your SSH box

Putty.exe - use this to test your SSH connection locally (you should be able to connect on port 22 locally or 443 externally)

ZFS - Removing all snapshots

To list all of your current snapshots;

zfs list -t snapshot

This is a handy script to remove all snapshots….

for snapshot in `zfs list -H -t snapshot | cut -f 1` do zfs destroy $snapshot done

As always : at your own risk. ;)

fakeRAID vs Software RAID (windows)

O.k. here is the latest from atomic magazine… I’m talking about RAID 0 (stripe) here.

Software RAID (i.e. windows stripe) is faster (both in throughput and seek time) than the “hardware” fake RAID built in to most new mother boards. Apparently it doesn’t matter about the stripe size of your raid either…. Software raid still wins??

I’m a bit skeptical about this, and will have to en devour on a few tests to conclude whether this is true or not…

Remotely Enable Remote Desktop

I work in a lab environment, so most of the windows XP machines i enable remote desktop for easy access. All new machines have remote desktop enabled via group policy.

The GP is located here; (link were appropriate in AD structure)

Computer Configuration, Administrative Templates, Windows Components, Terminal Services, – > Allows users to connect remotely using Terminal Services setting. Enable this.

If you don’t have a domain or don’t have group policy implemented you can still enable remote desktop via the reg command in XP. Here is an example;

Linux - Installing VirtualBox additions

The following works on CentOs / Fedora / redhat etc… 

Logon to your distro. The packages you need are the kernel-devel.i686, kernel.i686 (if not the latest), and gcc.i386 (complier)

yum -y install kernel.i686 gcc.i386

reboot as the kernel needs to load, then logon again install the kernel dev; 

yum -y install kernel-devel.i686

Now you want to present the virtualbox additions to the cdrom drive on your distro. Click “install additions” on the virtualbox guest console. 

VMware Server 2.0 - Infrastructure Client

One thing i like about vmware server 2.0, is that you are not forced to use the web console in all cases.

If you are lucky enough to have access to VMware Infrastructure Client 2.5 you can connect via it using the following syntax at the logon screen;

IP address / Name : http://192.168.9.100

If you enter a URL in the host field, use your root and correct password you should be able to logon without issue. Welcome to a nice fast GUI admin console.

Cisco - Switch Reference

Setting up a trunk between switches

Enable Switch to enable mode Configure Terminal Enter global configuration mode

Interface FastEthernet0/1 Entering interface configuration for port 0/1. This is where you pick the port you want to trunk.

Switchport mode trunk Set port to trunking mode.

Switchport trunk encapsulation dot1q Set trunk type to 802.1q. If your switch only supports either ISL or 802.1q, this command does not exist because there is nothing to specify. This command only works when you can choose between the two.

Linux - crontab

Time to schedule some tasks!

First you need to make sure your in the /etc/cron.d/cron.allow file. If you are not SU to root and add yourself into it.

Now to create your new crontab file;

crontab -e

You are in vi in your newly created crontab file (note if you do not have access to do this it will say so)

Now, i’m no expert at using vi, but if you press i you will go into insert mode. Do this, then type the cron job details. A typical cron job will look like this

Linux - Hard Drive Performance

Or lack of.

You must insure that your drives are using the sata driver (if they are sata disks), quickest way to check is that they will be called sda sdb etc…. and not hda hdb, as this is the default IDE driver and will slow down the performance majorly.

How to check performance;

hdparm -tT /dev/hda

Modern drives should be getting over 50MB/s easily. If your getting about 5MB/s you have the problem.

Linux - mapping to a windows share (SMB)

As per below. First you will need to install samba client.

In Fedora / Centos …

yum -y samba-client

then use the mount command to mount the share to a directory… 

mount -t cifs -n //192.168.9.70/software /mnt/sharename -o username=guest,password=

It will be similar in other distros. Remember to create the /mnt/sharename directory before trying to mount any share to the directory. Directories are created like so;

mkdir /mnt/sharename

Linux - setting the time

How to set the time in Linux; (from a command line)

date -s “09/21/2007 09:20:00”

hwclock –systohc

the second command links the time back to the hardware clock.

Note: within a vm guest it is always advised to install the guest additions as the time on a guest can slowly move away from the correct time.

Virtual Appliance - Virtual Router

This is quite a handy app for creating small virtual routers. See the website for more detail… The commandline is similar to cisco - so its good for practice if you are going for your CCNA.

http://www.vyatta.com/products/virtualized.php

Oh - its open source and free!

I’m a bit lazy in most cases and just add a few virtual nics into my VM’s and do the routing though them. But some people may find this handy for a single point to manage networking.

VMWare - Converter Best Practices (p2v)

I found this on the web a while back, it sums up most of what you need to know before doing any P2V work (this generally talks about a windows physical to virtual conversion)…. 

http://www.vmware-tsx.com/download.php?asset_id=48

Converter Best Practices

What should I do after I successfully convert my virtual machine?

If you change from a multi-processor system to a uni-processor system you need to manually change the HAL on the Windows server after the conversion. To do this go into Device Manager after the machine first boots and discovers it’s new hardware and then click on Computer then right-click on the processor and select Update Driver. Then select Install from specific location and then Don’t search I will choose the driver to install. Then select show All compatible hardware and select the appropriate processor. For example, if you went from a dual cpu to a single cpu then select ACPI uni-processor PC instead of ACPI multi-processor PC. You will need to reboot once you change this. To verify what HAL you are using you right-click your hal.dll in c:\windows\system32 and select the Version tab and select Internal Name and it should say halmacpi.dll for multi-processor acpi and halacpi.dll for uni-processor acpi.

Next clean up all the non-present hardware after the P2V conversion. To do this go to a CMD prompt and type;

SET DEVMGR_SHOW_NONPRESENT_DEVICES=1 

DEVMGMT.MSC

then select Show Hidden Devices. Delete any old grayed out hardware. Next remove any vendor specific applications/drivers. For example on a HP server you should go to Add/Remove programs and remove any HP management agents, survey utility, array config utility, version control agent, etc. Also check your NIC and make sure there are no vendor specific drivers there (ie. teaming). Check the Services to see if all there is anything vendor specific related there and disable any services that are.