<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technology, Computer, Network and Games Cheat &#187; Unix</title>
	<atom:link href="http://www.gamescheat.ca/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gamescheat.ca</link>
	<description>Day to day technical how to - by Andrew Lin</description>
	<lastBuildDate>Thu, 26 May 2011 18:48:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Unable to login to remote server via ssh</title>
		<link>http://www.gamescheat.ca/2011/05/unable-to-login-to-remote-server-via-ssh/</link>
		<comments>http://www.gamescheat.ca/2011/05/unable-to-login-to-remote-server-via-ssh/#comments</comments>
		<pubDate>Wed, 18 May 2011 11:00:26 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Aix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=887</guid>
		<description><![CDATA[A funny thing happened to one of my Red Hat 5 Enterprise servers after applying the errata. I rebooted the servers as usual after applying the updates, and they came up just fine. But unfortunately I was not able to logon remotely via ssh to a server. I tried various different accounts including root, but [...]]]></description>
			<content:encoded><![CDATA[<p>A funny thing happened to one of my Red Hat 5 Enterprise servers after applying the errata.  I rebooted the servers as usual after applying the updates, and they came up just fine.  But unfortunately I was not able to logon remotely via ssh to a server.  I tried various different accounts including root, but none of them worked. </p>
<p>It seems that I was able to login successfully into the server, but within few seconds it would kick me out.  Just before it disconnected my ssh session, I saw the message ‘The server is going down..’.   For some strange reason that message was stuck in the operating system, it was the message displayed just before the scheduled reboot.  I had pushed out the reboot command from the Red Hat Satellite server.  All the other servers rebooted fine.</p>
<p>I knew that clearing this message would resolve my dilemma, but I had no idea which file held it.  After much searching I found the culprit, it was /etc/nologin. Due to reason I did not want to try and figure out as it would take too much time, this file did not get automatically deleted after the reboot.  I deleted /etc/nologin, and then was able to successfully login via ssh to the server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2011/05/unable-to-login-to-remote-server-via-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a new superuser in Linux</title>
		<link>http://www.gamescheat.ca/2011/05/how-to-create-a-new-superuser-in-linux/</link>
		<comments>http://www.gamescheat.ca/2011/05/how-to-create-a-new-superuser-in-linux/#comments</comments>
		<pubDate>Tue, 17 May 2011 18:06:59 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=883</guid>
		<description><![CDATA[The administrative account ‘root’ is the most powerful user in Linux and Unix. This account is created by default during installation of the operating system. Most security consultants will recommend that the root account be deleted or renamed. This is to make it harder for a hacker to find out what a valid user account [...]]]></description>
			<content:encoded><![CDATA[<p>The administrative account ‘root’ is the most powerful user in Linux and Unix.  This account is created by default during installation of the operating system.   Most security consultants will recommend that the root account be deleted or renamed.  This is to make it harder for a hacker to find out what a valid user account is. </p>
<p>Before you delete or rename the root account it is important that you create a new account with the same privileges as root.  This account should have the same capabilities as root, a new superuser account.  I will explain the steps to create a new superuser account in Redhat Linux.  The steps are similar for Centos, Fedora and most other variants of Linux.</p>
<p>Let’s begin by checking the characteristics of the root account.</p>
<blockquote><p># id root<br />
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)</p>
<p>uid=0(root), this indicates that root has a user id of 0.<br />
gid=0, the group id is 0.<br />
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel), these are the groups root belongs to.  The numbers signifies the group id numbers, e.g. disk has a group id of 6.</p></blockquote>
<p>To create a new superuser, it must have the same uid, gid and belong to the same groups as the root account.</p>
<p>You can create a new superuser account using the adduser command.</p>
<blockquote><p># adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M andrew</p>
<p>-u 0 –o, this sets the uid to 0.<br />
-g 0, sets the gid to 0.<br />
-G 0,1,2,3,4,6,10, sets the group membership to 0 = root, 1 = bin, 2 = daemon, 3 = sys, 4 = adm, 6 = disk and 10 = wheel.<br />
-M, do not create a home directory.<br />
andrew, new user account name.</p></blockquote>
<p>Create a password for the new account.</p>
<blockquote><p># passwd andrew<br />
Changing password for user andrew:<br />
New UNIX password:<br />
Retype new UNIX password:<br />
Passwd: all authentication tokens updated successfully.</p></blockquote>
<p>What if you want to promote an existing user to superuser?  Then you will need to edit two files, /etc/passwd and /etc/group.</p>
<p>Open /etc/passwd with Vi editor and change the gid and uid to 0 for andrew.</p>
<blockquote><p>andrew:x:0:0::/home/andrew:/bin/bash</p></blockquote>
<p>Edit /etc/group and add andrew to the groups root, bin, daemon, sys, adm, disk and wheel.</p>
<blockquote><p>root:x:0:root,andrew<br />
bin:x:1:root,bin,daemon,andrew<br />
daemon:x:2:root,bin,daemon,andrew<br />
sys:x:3:root,bin,adm,andrew<br />
adm:x:4:root,adm,daemon,andrew<br />
disk:x:6:root,andrew<br />
wheel:x:10:root,andrew</p></blockquote>
<p>If the user account andrew has and existing home directory such as /home/andrew, then you will need to change the ownership to reflect root. </p>
<blockquote><p># chown root:root /home/andrew</p></blockquote>
<p>Otherwise you will receive the following error message, upon logging in.</p>
<blockquote><p>User’s $HOME/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permission. User $HOME directory must be owned by user and not writable by other users.</p></blockquote>
<p>This is because the uid and gid for andrew has been changed to 0, this is the same as root.  Whereas /home/andrew still belongs to the username andrew, which had a uid and gid of 500 or higher number.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2011/05/how-to-create-a-new-superuser-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nslookup resolves address but ping is unable to resolve hostname on Unix server</title>
		<link>http://www.gamescheat.ca/2010/11/nslookup-resolves-addpress-but-ping-is-unable-to-resolve-hostname-on-unix-server/</link>
		<comments>http://www.gamescheat.ca/2010/11/nslookup-resolves-addpress-but-ping-is-unable-to-resolve-hostname-on-unix-server/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 14:42:58 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Aix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SUN]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=844</guid>
		<description><![CDATA[I came across this issue on my newly built Solaris 10 server. I was able to ping a remote machine by Ip address, but not by its hostname. This indicated that I had the correct route and gateway. Using nslookup and dig I verified that the DNS servers were resolving the hostname to IP address. [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this issue on my newly built Solaris 10 server.  I was able to ping a remote machine by Ip address, but not by its hostname. This indicated that I had the correct route and gateway. Using nslookup and dig I verified that the DNS servers were resolving the hostname to IP address.  I confirmed that the file /etc/resolv.conf had the correct syntax for search domain-name.com.</p>
<p>Here is what my /etc/resolv.conf looks like, the two DNS servers are defined correctly as it the search domain.<br />
<strong>domain andrewlin.com<br />
namesserver 10.10.10.11<br />
namesserver 10.10.11.13<br />
search andrewlin.com</strong><br />
The gateway was defined in /etc/defaultrouter.<br />
<strong>10.10.0.1</strong><br />
It seems that ping did not know how to resolve an address.  I was also not able to surf the internet with the Firefox browser in the Sun Java Desktop System for Soalris.  All symptoms indicated that the nsswitch.conf did not have the correct environment defined.  The /etc/nsswitch.conf file defines which services are to used to retrieve information such as hostnames, password files, and group files.  So in this case for the command ping and firefox which wants to resolve and address, it will check the nsswitch.conf file to see what services to use.</p>
<p>Below are the lines I changed in /etc/nsswitch.conf, by adding dns to the end of each lines.<br />
<strong>hosts: files dns<br />
ipnodes: files dns</strong><br />
I am now able to ping and surf the internet without any issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/11/nslookup-resolves-addpress-but-ping-is-unable-to-resolve-hostname-on-unix-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to map to a remote NFS directory from a VMware ESX 4 server.</title>
		<link>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/</link>
		<comments>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 12:00:02 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=842</guid>
		<description><![CDATA[I ran into this error while trying to mount a NFS directory on a remote server from my Vmware ESX4 server. My Vmware esx server is called esx4-server and the remote NFS server is called remote-server. I executed the mount commant and got the below error. [root@esx4-server /]# mount -t nfs remote-server:/home/andrew/mnt mount.nfs: Input/output error [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into this error while trying to mount a NFS directory on a remote server from my Vmware ESX4 server.  My Vmware esx server is called esx4-server and the remote NFS server is called remote-server.<br />
I executed the mount commant and got the below error.<br />
<strong>[root@esx4-server /]# mount -t nfs remote-server:/home/andrew/mnt<br />
mount.nfs: Input/output error</strong><br />
I then decided to use the -v (verbose) option for mount.  This will list the mounting process in verbose, it is better for troubleshooting.<br />
<strong>[root@esx4-server /]# mount -vt nfs remote-server:/home/andrew/mnt<br />
mount: trying 192.20.66.88 prog 100003 vers 3 prot tcp port 2049<br />
mount: trying 192.20.66.88 prog 100005 vers 3 prot udp port 32794<br />
mount.nfs: Input/output error</strong></p>
<p>I then checked the log files for more information, and below are the messages I saw.<br />
<strong>[root@esx4-server /]# cat /var/log/messages<br />
Oct 26 10:32:30 esx4-server vobd: Oct 26 10:32:30.936: 159470608100us: [esx.problem.vmfs.nfs.mount.connect.failed] Failed to mount to server 192.20.66.88 mount point /VMLibrary/. Error: Unable to connect to NFS server.<br />
Oct 26 11:36:50 esx4-server kernel: [162970.448490] portmap: server localhost not responding, timed out<br />
Oct 26 11:36:50 esx4-server kernel: [162970.453525] RPC: failed to contact portmap (errno -5).</strong><br />
From the log file I was able to determine that the pormap service was not started. It is required to map to a remote NFS directory.  I then proceeded with starting the protmap service.<br />
service portmap start</p>
<p>To esure that the service starts automatically when the server reboots use the below command.<br />
<strong>chkconfig portmap on</strong><br />
You may also have to stop the firewall service on the esx server with the command <strong>service firewall stop</strong>.  To prevent it from starting after a reboot, <strong>chkconfig firewall off</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Sparc commands to power on and boot up the server.</title>
		<link>http://www.gamescheat.ca/2010/11/sun-sparc-commands-to-power-on-and-boot-up-the-server/</link>
		<comments>http://www.gamescheat.ca/2010/11/sun-sparc-commands-to-power-on-and-boot-up-the-server/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 16:06:52 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sparc]]></category>
		<category><![CDATA[SUN]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=839</guid>
		<description><![CDATA[Booting up the Sun Sparc M3000 server. After logging into the XSCF console, power on the server. XSCF> poweron -d 0 DomainIDs to power on:00 Continue? [y&#124;n] :y Switch to the server console. XSCF> console -d 0 Connect to DomainID 0?[y&#124;n] :y Devalias will list all devices which can be booted. {0} ok devalias cdrom [...]]]></description>
			<content:encoded><![CDATA[<p>Booting up the Sun Sparc M3000 server.</p>
<p>After logging into the XSCF console, power on the server.<br />
XSCF> poweron -d 0<br />
DomainIDs to power on:00<br />
Continue? [y|n] :y</p>
<p>Switch to the server console.<br />
XSCF> console -d 0<br />
Connect to DomainID 0?[y|n] :y</p>
<p>Devalias will list all devices which can be booted.<br />
{0} ok devalias<br />
cdrom                    /pci@0,600000/pci@0/pci@0/scsi@0/disk@4,0:f<br />
net                      /pci@0,600000/pci@0/pci@1/pci@0/network@4<br />
disk                     /pci@0,600000/pci@0/pci@0/scsi@0/disk@0<br />
name                     aliases                                          </p>
<p>To boot from the disk, use the boot command.<br />
{0} ok boot disk<br />
Boot device: /pci@0,600000/pci@0/pci@0/scsi@0/disk@0  File and args:<br />
SunOS Release 5.10 Version Generic_141444-09 64-bit<br />
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved<br />
Use is subject to license terms.<br />
Hostname: andrew_lin</p>
<p>Switch back to the XSCF console with<br />
#. will bring you back to the XSCF console.</p>
<p>To list the default boot device use the printenv command.<br />
ok printenv boot-device<br />
boot-device =           /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/disk@w50060e80058c7b10,1:a</p>
<p>If you wanted to change the default boot device, use the setenv boot-device command.<br />
ok setenv boot-device device[n]</p>
<p>Save the changes with reset-all.<br />
ok reset-all</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/11/sun-sparc-commands-to-power-on-and-boot-up-the-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating RDM to LUN (SAN) mapping on VMware ESX 4, Vcenter.</title>
		<link>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/</link>
		<comments>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 20:42:52 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=830</guid>
		<description><![CDATA[In the past I have written articles about how to create a RDM to LUN disk mapping for VMware ESX 3. http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/ and http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/ The procedure to identify the path for the RDM (raw disk mapping) to LUN (disk on SAN) on Vmware ESX 4 is different from Vmware Esx 3. There are a few [...]]]></description>
			<content:encoded><![CDATA[<p>In the past I have written articles about how to create a RDM to LUN disk mapping for <a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">VMware ESX 3</a>.<br />
<a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</a> and <a href="http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</a></p>
<p>The procedure to identify the path for the RDM (raw disk mapping) to LUN (disk on SAN) on Vmware ESX 4 is different from Vmware Esx 3.  There are a few more steps in version 4.  I will explain below how to determine the path for RDM to LUN in ESX 4.</p>
<p>Login to the console with root permission.</p>
<blockquote><p># find /vmfs/volumes -name **-rdm**<br />
/vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1-rdmp.vmdk</p></blockquote>
<p>Find all RDM file in .vmfs/volumes. Remove -rdmp from the result and that is the path you need for the next step.</p>
<blockquote><p># vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk<br />
Disk /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk is a Passthrough Raw Device Mapping<br />
Maps to: vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<p>Use the vmkfstools -q command to find the vml id of the LUN, it is vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56.</p>
<blockquote><p># esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56<br />
naa.60060e80058c7b0000008c7b0000310b                            vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<p>Now use the esxcfg-scsidevs command to find the Network Addressing Authority identifier (naa) for the LUN.</p>
<blockquote><p># esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b<br />
fc.2001001b3232c093:2101001b3232c093-fc.50060e80058c7b55:50060e80058c7b55-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba2:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba2 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3001001b3232c093:2101001b3232c093<br />
   Target Identifier: fc.60060e80058c7b55:50060e80058c7b55<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:01:00:1b:32:32:c0:93 WWPN: 23:01:00:1b:32:32:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:55 WWPN: 56:06:0e:80:05:8c:7b:55</p>
<p>fc.2000001b3212c093:2100001b3212c093-fc.50060e80058c7b45:50060e80058c7b45-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba1:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba1 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3000001b3212c093:2100001b3212c093<br />
   Target Identifier: fc.60060e80058c7b45:50060e80058c7b45<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:00:00:1b:32:12:c0:93 WWPN: 23:00:00:1b:32:12:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:45 WWPN: 56:06:0e:80:05:8c:7b:45</p></blockquote>
<p>The esxcfg-mpath -l command generates the detailed information for the LUN.  Because there are redundant path to the LUN on the SAN, the result is listed twice with different fiber channel HBA interfaces.</p>
<p>Now what if your VMware ESX server is hosting many servers all with different RDMs.  It would be very tedious to manually compile a report for RDM to LUN mapping.  I create a script that will automatically do all the above steps and will output the result to screen or you can redirect the result to a file.  This will script will search for all the RDMs and create the mappings.  Below is the script and explanation of how it works.</p>
<p><strong><br />
<blockquote>#!/bin/bash<br />
# Andrew Lin<br />
# August 4, 2010<br />
# Pay Andrew Lin lot&#8217;s of money before you<br />
# can use this script</p>
<p>date<br />
hostname</p>
<p>find /vmfs/volumes -name **-rdm** | sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217; | sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217; | sed &#8216;s/^/vmkfstools -q /g&#8217; >> andrew-disk-map |<br />
chmod 645 andrew-disk-map</p>
<p>file=andrew-disk-map<br />
while read line<br />
do<br />
 $line<br />
 $line | grep vml | sed &#8216;s/.*to:/esxcfg-scsidevs -u | grep/g&#8217; > andrew_lin1</p>
<p>     chmod 755 andrew_lin1<br />
     ./andrew_lin1 | sed &#8216;s/ .*//g&#8217;<br />
     ./andrew_lin1 | sed &#8216;s/ .*//g&#8217; | sed &#8216;s/^/esxcfg-mpath -L &#8211;device=/g&#8217; >andrew_lin2<br />
     # rm andrew_lin1</p>
<p>     chmod 755 andrew_lin2<br />
     ./andrew_lin2<br />
     # rm andrew_lin2</p>
<p> echo -e &#8220;\n&#8221;<br />
done <$file</p></blockquote>
<p></strong></p>
<p>I will explain below what the above script does.</p>
<blockquote><p>find /vmfs/volumes -name **-rdm**<br />
/vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1-rdmp.vmdk</p></blockquote>
<p>Search for all RDM (raw disk mapping), VMware1_1-rdmp.vmdk is found.</p>
<blockquote><p>sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217;</p></blockquote>
<p>Change the characters -rdmp.vmdk to .vmdk. The s/ means to substitute, and /g means globally apply the changes for all matches. Some RDM have the -rdmp.vmdk extension (not shown in the above example).</p>
<blockquote><p>sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217;</p></blockquote>
<p>Change -rdm.vmdk to .vmdk for all matches.</p>
<blockquote><p>sed &#8216;s/^/vmkfstools -q /g&#8217;</p></blockquote>
<p>Add the command vmkfstools -q to the beginning of each line.</p>
<blockquote><p>>> andrew-disk-map | chmod 645 andrew-disk-map</p></blockquote>
<p>Redirect the output to the file andrew-disk-map.  Change the file permission to 645 to make it executable.</p>
<p>Below is the result of the above command stored in andrew-disk-map.</p>
<blockquote><p>vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk</p></blockquote>
<blockquote><p>file=andrew-disk-map</p></blockquote>
<p>Define the variable called file which contains the name of the file andrew-disk-map.</p>
<blockquote><p>while read line<br />
do<br />
 ..<br />
 &#8230;<br />
 &#8230;.<br />
done <$file</p></blockquote>
<p>The while loop will read the contents of the file defined in the variable $file (which is andrew-disk-map).  The file is read one line at a time and the commands defined within the while loop are executed for each line read.</p>
<blockquote><p>$line</p></blockquote>
<p>Execute the line read from the file andrew-disk-map and send the output to screen.</p>
<blockquote><p><strong>Command</strong><br />
vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk<br />
<strong>Output</strong><br />
Disk /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk is a Passthrough Raw Device Mapping<br />
Maps to: vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>$line | grep vml | sed &#8216;s/.*to:/esxcfg-scsidevs -u | grep/g&#8217; > andrew_lin1</p></blockquote>
<p>Grep will find the line that contains the characters vml,  this is the unique LUN id.  Replace all characters before and upto the characters to: with esxcfg-scsidevs -u | grep.  The result will look like the below line which is redirected to the file andrew_lin1.</p>
<blockquote><p>esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>chmod 755 andrew_lin1</p></blockquote>
<p>Chmod 755 will make the file andrew_lin1 executable.</p>
<blockquote><p>./andrew_lin1 | sed &#8216;s/ .*//g&#8217;</p></blockquote>
<p>Execute the file andrew_lin1.  Sed &#8216;s/ .*//g&#8217; will delete everything after the first space found, otherwise the output will look like the below.</p>
<blockquote><p><strong>Command executed (this is the content of the file andrew_lin1).</strong><br />
esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56<br />
<strong>Output</strong><br />
naa.60060e80058c7b0000008c7b0000310b                            vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>./andrew_lin1 | sed &#8216;s/ .*//g&#8217; | sed &#8216;s/^/esxcfg-mpath -l &#8211;device=/g&#8217; >andrew_lin2</p></blockquote>
<p>Execute the file andrew_lin1, from the result remove everything after the LUN ID number (naa.60060e80058c7b0000008c7b0000310b). Then add the command esxcfg-mpath -L &#8211;device= in front of the LUN ID number, see below example.  The output is redirected to the file andrew_lin2.<br />
esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b</p>
<blockquote><p># rm andrew_lin1</p></blockquote>
<p>You are done with file andrew_lin1 and can delete it. If you want to save the file for troubleshooting then comment out the above line with the # sign.</p>
<blockquote><p>chmod 755 andrew_lin2</p></blockquote>
<p>Make the file andrew_lin2 executable.</p>
<blockquote><p>./andrew_lin2</p></blockquote>
<p>Execute andrew_lin2.  Which contains the command esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b.  The output below is displayed on screen.  Notice that there are redundant paths to the LUN on the SAN.</p>
<blockquote><p>fc.2001001b3232c093:2101001b3232c093-fc.50060e80058c7b55:50060e80058c7b55-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba2:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba2 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3001001b3232c093:2101001b3232c093<br />
   Target Identifier: fc.60060e80058c7b55:50060e80058c7b55<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:01:00:1b:32:32:c0:93 WWPN: 23:01:00:1b:32:32:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:55 WWPN: 56:06:0e:80:05:8c:7b:55</p>
<p>fc.2000001b3212c093:2100001b3212c093-fc.50060e80058c7b45:50060e80058c7b45-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba1:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba1 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3000001b3212c093:2100001b3212c093<br />
   Target Identifier: fc.60060e80058c7b45:50060e80058c7b45<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:00:00:1b:32:12:c0:93 WWPN: 23:00:00:1b:32:12:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:45 WWPN: 56:06:0e:80:05:8c:7b:45</p></blockquote>
<blockquote><p># rm andrew_lin2</p></blockquote>
<p>Delete the file andrew_lin2 by removing the # comment.</p>
<blockquote><p>echo -e &#8220;\n&#8221;</p></blockquote>
<p>Enter a line space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Booting up Solaris 10 from a SAN replicated LUN on a different Sun SPARC server</title>
		<link>http://www.gamescheat.ca/2010/07/booting-up-solaris-10-from-a-san-replicated-lun-on-a-different-sun-sparc-server/</link>
		<comments>http://www.gamescheat.ca/2010/07/booting-up-solaris-10-from-a-san-replicated-lun-on-a-different-sun-sparc-server/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 20:23:40 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SUN]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=815</guid>
		<description><![CDATA[The quickest way to recover from a total disaster is to have some sort of replication implemented. There are two different methods of real-time replication, hardware and software. My experiences with software replication such as Symantec Veritas Volume replicator for AIX was not pleasing. It required constant maintenance and troubleshooting. The best is hardware replication [...]]]></description>
			<content:encoded><![CDATA[<p>The quickest way to recover from a total disaster is to have some sort of replication implemented.  There are two different methods of  real-time replication, hardware and software.  My experiences with software replication such as Symantec Veritas Volume replicator for AIX was  not pleasing.  It required constant maintenance and troubleshooting. The best is hardware replication if you can afford it.  A lot of  organizations pick software replication as it generally cost a lot less up front, but the cost of maintenance eventually adds up.</p>
<p>I will explain how to recover a Solaris 10 server from hardware replicated SAN disk.  It took me sometime to figure out how to boot up from  the replicated SAN LUN (disk), and many more hours to understand why the steps I applied works.</p>
<p>In this example I have a SUN SPARC M3000 server with two Qlogic fiber channel cards (HBA) installed in the PCI solts.  The HBAs were already  configured to connect to the SAN disk (LUN).  This LUN contained the replicated copy of a production Slaris 10 server.  The production server had two ZFS pool residing in a single LUN.</p>
<p>Using the Solaris 10 installation CD boot up the Sparc server into single user mode. </p>
<blockquote><p>boot cdrom -s</p></blockquote>
<p>The first thing you need to do is to see if the HBAs are working.  The connected status indictes that communication between the server and  switch is working.  There are two HBAs installed for redundancy, both connected to the same LUN.</p>
<blockquote><p># luxadm -e port<br />
/devices/pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0:devctl CONNECTED<br />
/devices/pci@1,700000/pci@0/pci@0/SUNW,qlc@0/fp@0,0:devctl CONNECTED</p></blockquote>
<p>Now you need to find out if the SAN disk is visible from the server. Even though both HBAs are connected to the same SAN disk, you will see  two separate SAN disks in the results below.  It just means there are two paths to the SAN.</p>
<blockquote><p># luxadm probe<br />
No Network Array enclosures found in /dev/es</p>
<p>Found Fibre Channel device(s):<br />
  Node WWN:50060e80058c7b10  Device Type:Disk device<br />
    Logical Path:/dev/rdsk/c1t50060E80058C7B10d1s2<br />
  Node WWN:50060e80058c7b00  Device Type:Disk device<br />
    Logical Path:/dev/rdsk/c2t50060E80058C7B00d1s2</p></blockquote>
<p>In the above example the first LUN is c1t50060E80058C7B10d1s2. This is the logical device name which is a symbolic link to the physical  device name stored in the /devices directory. Logical device names contain the controller number(c2), target number (t50060E80058C7B10), disk number (d1), and slice number (s2).</p>
<p>The next step is to find out how the disk is partitioned, the format command will give you that information. You need this information to  understand how to boot up the disk.</p>
<blockquote><p># format<br />
Searching for disks&#8230;done</p>
<p>AVAILABLE DISK SELECTIONS:<br />
0. c1t50060E80058C7B10d1 <HITACHI-OPEN-V-SUN-6006 cyl 65533 alt 2 hd 15 sec<br />
1066>/pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b10,1</p>
<p>1. c2t50060E80058C7B00d1 <HITACHI-OPEN-V-SUN-6006 cyl 65533 alt 2 hd 15 sec<br />
1066>/pci@1,700000/pci@0/pci@0/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b00,1</p></blockquote>
<p>Select the first disk 0.</p>
<blockquote><p>Specify disk (enter its number): 0<br />
selecting c1t50060E80058C7B10d1<br />
[disk formatted]</p>
<p>FORMAT MENU:<br />
        disk       &#8211; select a disk<br />
        type       &#8211; select (define) a disk type<br />
        partition  &#8211; select (define) a partition table<br />
        current    &#8211; describe the current disk<br />
        format     &#8211; format and analyze the disk<br />
        repair     &#8211; repair a defective sector<br />
        label      &#8211; write label to the disk<br />
        analyze    &#8211; surface analysis<br />
        defect     &#8211; defect list management<br />
        backup     &#8211; search for backup labels<br />
        verify     &#8211; read and display labels<br />
        save       &#8211; save new disk/partition definitions<br />
        inquiry    &#8211; show vendor, product and revision<br />
        volname    &#8211; set 8-character volume name<br />
        !<cmd>     &#8211; execute <cmd>, then return<br />
        quit</p></blockquote>
<p>Display the labels and slices (partitions).  In Solaris each slice is treated as a separate physical disk.  In the below example you can tell that the disk is labeled as VTOC (Volume Table of Contents) because you can see the cylinders.  VTOC is also known as SMI label.  If the disk was labeled with EFI (Extensible Firmware Interface), then you would see sectors instead of cylinders.  Partition 0 (slice 0) holds the  operating system files, the boot disk.  Please note that you cannot boot from a disk with EFI label.  Slice 2 is the entire physical disk  because it contains all cylinders, 0 &#8211; 65532.</p>
<blockquote><p>format> verify</p>
<p>Primary label contents:</p>
<p>Volume name = <<br />
ascii name  = <HITACHI-OPEN-V-SUN-6006 cyl 65533 alt 2 hd 15 sec 1066><br />
pcyl        = 65535<br />
ncyl        = 65533<br />
acyl        =    2<br />
nhead       =   15<br />
nsect       = 1066<br />
Part      Tag    Flag     Cylinders         Size            Blocks<br />
  0       root    wm       0 &#8211;  3356       25.60GB    (3357/0/0)    53678430<br />
  1 unassigned    wm       0                0         (0/0/0)              0<br />
  2     backup    wm       0 &#8211; 65532      499.66GB    (65533/0/0) 1047872670<br />
  3 unassigned    wm       0                0         (0/0/0)              0<br />
  4 unassigned    wm       0                0         (0/0/0)              0<br />
  5 unassigned    wm       0                0         (0/0/0)              0<br />
  6 unassigned    wm       0                0         (0/0/0)              0<br />
  7 unassigned    wm    3357 &#8211; 65532      474.07GB    (62176/0/0)  994194240
    </p></blockquote>
<p>Here is what we know so far, we know that the disk name is c1t50060E80058C7B10d1. Slice 0 on this disk contains the boot files.  The physical path for this disk is /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b10,1.  Now we need to find out the physical path for Slice 0.</p>
<p>I know that the disk contains ZFS filesystems because it is a replica of the production disk.  When a ZFS filesystem is moved to a different  SPARC server it must first be imported because the hostid is different.</p>
<p>List the ZFS pool contained on the disk using the zpool import command.  There are two ZFS pools in the below example, epool and rpool.  Take a note of the status and action.</p>
<blockquote><p># zpool import<br />
  pool: epool<br />
    id: 16865366839830765202<br />
 state: ONLINE<br />
status: The pool was last accessed by another system.<br />
action: The pool can be imported using its name or numeric identifier and the &#8216;-f&#8217; flag.<br />
   see: http://www.sun.com/msg/ZFS-8000-EY<br />
config:</p>
<p>        epool                      ONLINE<br />
          c2t50060E80058C7B00d1s7  ONLINE</p>
<p>  pool: rpool<br />
    id: 10594898920105832331<br />
 state: ONLINE<br />
status: The pool was last accessed by another system.<br />
action: The pool can be imported using its name or numeric identifier and the &#8216;-f&#8217; flag.<br />
   see: http://www.sun.com/msg/ZFS-8000-EY<br />
config:</p>
<p>        rpool                      ONLINE<br />
          c2t50060E80058C7B00d1s0  ONLINE</p></blockquote>
<p>Import the pool with the zpool import command.  The options -a will import all the ZFS pools it can find, the -f option will force the  import.  If you do not specify the force option, then the import may fail with the error &#8220;cannot import &#8216;rpool&#8217;: pool may be in use from other system, it was last accessed by server name (hostid: 123456)&#8221;.  Ignore the error message about failed to create mountpoint.</p>
<blockquote><p># zpool import -af<br />
cannot mount &#8216;/epool&#8217;: failed to create mountpoint<br />
cannot mount &#8216;/rpool&#8217;: failed to create mountpoint</p></blockquote>
<p>List the imported ZFS pools.</p>
<blockquote><p># zpool list<br />
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT<br />
epool   472G   260G   212G    55%  ONLINE  -<br />
rpool  25.5G  5.75G  19.8G    22%  ONLINE  -</p></blockquote>
<p>List the ZFS filesystems. In the example below notice the mountpoint / is mounted on the zfs filesystem rpool/ROOT/zfsboot.  This is the boot partition, it resides in rpool.</p>
<blockquote><p># zfs list<br />
NAME                                     USED  AVAIL  REFER  MOUNTPOINT<br />
epool                                    260G   205G    21K  /epool<br />
rpool                                   7.74G  17.4G    99K  /rpool<br />
rpool/ROOT                              4.74G  17.4G    21K  legacy<br />
rpool/ROOT/zfsboot                      4.74G  17.4G  4.48G  /<br />
rpool/ROOT/zfsboot/var                   139M  17.4G   105M  /var<br />
rpool/dump                              1.00G  17.4G  1.00G  -<br />
rpool/swap                              2.00G  19.4G    16K  -</p></blockquote>
<p>Change the mountpoint for rpoo/ROOT/zfsboot to /mnt so you can mount it to read the contents.</p>
<blockquote><p># zfs set mountpoint=/mnt rpool/ROOT/zfsboot</p></blockquote>
<p>Confirm that the mountpoint was changed.</p>
<blockquote><p># zfs list<br />
NAME                                     USED  AVAIL  REFER  MOUNTPOINT<br />
epool                                    260G   205G    21K  /epool<br />
rpool                                   7.74G  17.4G    99K  /rpool<br />
rpool/ROOT                              4.74G  17.4G    21K  legacy<br />
rpool/ROOT/zfsboot                      4.74G  17.4G  4.48G  /mnt<br />
rpool/ROOT/zfsboot/var                   139M  17.4G   105M  /mnt/var<br />
rpool/dump                              1.00G  17.4G  1.00G  -<br />
rpool/swap                              2.00G  19.4G    16K  -
           </p></blockquote>
<p>Now mount rpool/ROOT/zfsboot.</p>
<blockquote><p># zfs mount rpool/ROOT/zfsboot</p></blockquote>
<p>List the logical disks.</p>
<blockquote><p># cd /dev/dsk<br />
# ls<br />
c1t50060E80058C7B10d1s0  c2t50060E80058C7B00d1s0<br />
c1t50060E80058C7B10d1s1  c2t50060E80058C7B00d1s1<br />
c1t50060E80058C7B10d1s2  c2t50060E80058C7B00d1s2<br />
c1t50060E80058C7B10d1s3  c2t50060E80058C7B00d1s3<br />
c1t50060E80058C7B10d1s4  c2t50060E80058C7B00d1s4<br />
c1t50060E80058C7B10d1s5  c2t50060E80058C7B00d1s5<br />
c1t50060E80058C7B10d1s6  c2t50060E80058C7B00d1s6<br />
c1t50060E80058C7B10d1s7  c2t50060E80058C7B00d1s7</p></blockquote>
<p>As stated earlier the physical path for the disk we are looking for is /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b10,1.   The boot slice is 0.  We can derive from the physical path that the disk name is 50060e80058c7b10.  We also know from the output of the format command that the physical disk 50060e80058c7b10 maps to the logical disk c1t50060E80058C7B10d1.  Therefore we can derive that the  logical boot disk is c1t50060E80058C7B10d1s0.</p>
<p>Now find out what physical path c1t50060E80058C7B10d1s0 is a symbolic link for and that is your complete boot path.  In the below example the boot path starts at the first slash (/) right after /devices. It is /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b10,1:a.  You need to replace ssd@ with disk@ when entering the path into EEPROM.</p>
<blockquote><p># ls -l c1t50060E80058C7B10d1s0<br />
lrwxrwxrwx   1 root     root          82 Jul  5 10:21 c1t50060E80058C7B10d1s0 -><br />
 ../../devices/pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/ssd@w50060e80058c7b10,1:a</p></blockquote>
<p>If you have more than one ZFS pool the non root pool may not get mounted upon booting up the server, as in this example.  You may get the  below error.</p>
<blockquote><p>SUNW-MSG-ID: ZFS-8000-D3, TYPE: Fault, VER: 1, SEVERITY: Major<br />
EVENT-TIME: Mon Jul  5 11:54:14 EDT 2010<br />
PLATFORM: SUNW,SPARC-Enterprise, CSN: PX654321, HOSTNAME: Andrew-Lin<br />
SOURCE: zfs-diagnosis, REV: 1.0<br />
EVENT-ID: 33e5a9f1-49ac-6ebc-f2a9-dff25dea6b86<br />
DESC: A ZFS device failed.  Refer to http://sun.com/msg/ZFS-8000-D3 for more information.<br />
AUTO-RESPONSE: No automated response will occur.<br />
IMPACT: Fault tolerance of the pool may be compromised.<br />
REC-ACTION: Run &#8216;zpool status -x&#8217; and replace the bad device.</p>
<p>http://sun.com/msg/ZFS-8000-D3fameserverq9{root}: zpool status -x<br />
  pool: epool<br />
 state: UNAVAIL<br />
status: One or more devices could not be opened.  There are insufficient<br />
        replicas for the pool to continue functioning.<br />
action: Attach the missing device and online it using &#8216;zpool online&#8217;.<br />
   see: http://www.sun.com/msg/ZFS-8000-3C<br />
 scrub: none requested<br />
config:</p>
<p>        NAME                                       STATE     READ WRITE CKSUM<br />
        epool                                      UNAVAIL      0     0     0  insufficient replicas<br />
          c3t60060E8005652C000000652C00002100d0s7  UNAVAIL      0     0     0  cannot open</p></blockquote>
<p>The above error is caused by the zpool.cache file.  This file contains the old paths of the disks from the previous server. The default  behavior of Solaris 10 is to read the path from the zpool.cache file to speed up the boot sequence.  You should delete this file and the  system will recreate a fresh one during the boot up sequence.</p>
<p>Below are the steps to rename the zpool.cache file.</p>
<blockquote><p># cd /mnt/etc/zfs<br />
# ls<br />
zpool.cache<br />
# mv zpool.cache zpool.cache.old</p></blockquote>
<p>Now you need to reverse the changed you applied to the mountpoint earlier. Make sure that you change directory out of /mnt to /, otherwise  the set mountpoint command will fail with the error device busy.  Ignore the cannot mount &#8216;/&#8217;: directory is not empty message.</p>
<blockquote><p># zfs set mountpoint=/ rpool/ROOT/zfsboot<br />
cannot mount &#8216;/&#8217;: directory is not empty<br />
property may be set but unable to remount filesystem                            </p></blockquote>
<p>Confirm that the mount points were changed.</p>
<blockquote><p># zfs list<br />
NAME                                     USED  AVAIL  REFER  MOUNTPOINT<br />
epool                                    260G   205G    21K  /epool<br />
rpool                                   7.74G  17.4G    99K  /rpool<br />
rpool/ROOT                              4.74G  17.4G    21K  legacy<br />
rpool/ROOT/zfsboot                      4.74G  17.4G  4.48G  /<br />
rpool/ROOT/zfsboot/var                   139M  17.4G   105M  /var<br />
rpool/dump                              1.00G  17.4G  1.00G  -<br />
rpool/swap                              2.00G  19.4G    16K  -</p></blockquote>
<p>Shutdown the server.</p>
<blockquote><p># init 0
                            </p></blockquote>
<p>Now set the boot device in EEPROM.</p>
<blockquote><p>setenv boot-device /pci@0,600000/pci@0/pci@8/SUNW,qlc@0/fp@0,0/disk@w50060e80058c7b10,1:a</p></blockquote>
<p>The server is ready to be booted with the boot command.</p>
<blockquote><p>{0} ok boot</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/07/booting-up-solaris-10-from-a-san-replicated-lun-on-a-different-sun-sparc-server/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to get the network card speed in Solaris 9</title>
		<link>http://www.gamescheat.ca/2010/05/how-to-get-the-network-card-speed-in-solaris-9/</link>
		<comments>http://www.gamescheat.ca/2010/05/how-to-get-the-network-card-speed-in-solaris-9/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:47:18 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=811</guid>
		<description><![CDATA[To determine the network card speed in Solaris 9 use the ndd utility. First list the NIC installed and active on the Solaris 9 server. # ifconfig -a lo0: flags=1000849 mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 hme0: flags=1000843 mtu 1500 index 2 inet 162.10.1.11 netmask ffff0000 broadcast 162.10.255.255 ether 8:0:20:c4:8c:87 There is one [...]]]></description>
			<content:encoded><![CDATA[<p>To determine the network card speed in Solaris 9 use the ndd utility.</p>
<p>First list the NIC installed and active on the Solaris 9 server.</p>
<blockquote><p># ifconfig -a<br />
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1<br />
        inet 127.0.0.1 netmask ff000000<br />
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2<br />
        inet 162.10.1.11 netmask ffff0000 broadcast 162.10.255.255<br />
        ether 8:0:20:c4:8c:87</p></blockquote>
<p>There is one network card installed and active, hme0.</p>
<blockquote><p># ndd -get /dev/hme link_mode<br />
1</p></blockquote>
<p>Interpretation:<br />
0 &#8212; half-duplex<br />
1 &#8212; full-duplex</p>
<blockquote><p># ndd -get /dev/hme link_speed<br />
1</p></blockquote>
<p>Interpretation:<br />
0 &#8212; 10 Mbit<br />
1 &#8212; 100 Mbit<br />
1000 &#8212; 1 Gbit </p>
<p>To query a different NIC, such as hme1, set the &#8220;instance&#8221; to 1, and then perform the link_mode and link_speed queries above. </p>
<blockquote><p># ndd -set /dev/hme instance 1 </p></blockquote>
<p>The ndd commands above must be run as root.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/05/how-to-get-the-network-card-speed-in-solaris-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to list the status of swap in Solaris</title>
		<link>http://www.gamescheat.ca/2010/02/how-to-list-the-status-of-swap-in-solaris/</link>
		<comments>http://www.gamescheat.ca/2010/02/how-to-list-the-status-of-swap-in-solaris/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 10:00:36 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Aix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=796</guid>
		<description><![CDATA[List the status of all swap areas. # swap -l swapfile dev swaplo blocks free dev/dsk/c0t0d0s1 32,9 16 8425712 8425712 The output has five columns: path The path name for the swap area. dev The major/minor device number in decimal if it is a block special device; zeroes otherwise. swaplo The swaplow value for the [...]]]></description>
			<content:encoded><![CDATA[<p>List the status of all swap areas.</p>
<blockquote><p># swap -l<br />
swapfile             dev  swaplo blocks   free<br />
dev/dsk/c0t0d0s1   32,9      16 8425712 8425712</p></blockquote>
<p>The  output  has five columns:<br />
path<br />
The path name for the swap area.</p>
<p>dev<br />
The major/minor device number in decimal if it is a block special device; zeroes otherwise.</p>
<p>swaplo<br />
The swaplow value for the area in 512-byte blocks.</p>
<p>blocks<br />
The swaplen value for the area in 512-byte blocks.</p>
<p>free<br />
The number of 512-byte blocks in this area that are not currently allocated.</p>
<p>To find the status of total swap usage use the -s option.</p>
<blockquote><p># swap -s<br />
total: 180928k bytes allocated + 28456k reserved = 209384k used, 10691424k available     </p></blockquote>
<p>List the status of all the swap areas. The output has five columns:</p>
<p>path<br />
The path name for the swap area.</p>
<p>dev<br />
The major/minor device number in decimal if it is a block special device; zeroes otherwise.</p>
<p>swaplo<br />
The swaplow value for the area in 512-byte blocks.</p>
<p>blocks<br />
The swaplen value for the area in 512-byte blocks.</p>
<p>free<br />
The number of 512-byte blocks in this area that are not currently allocated.</p>
<p>The total amount of swap space in bytes currently allocated for use as backing store.</p>
<p>reserved<br />
The total amount of swap space in bytes not currently allocated, but claimed by memory mappings for possible future use.</p>
<p>used<br />
The total amount of swap space in bytes that is either allocated or reserved.</p>
<p>available<br />
The total swap space in bytes that is currently available for future reservation and allocation.</p>
<p>These   numbers include swap space from all configured swap areas as listed by the -l option, as well swap space in the form of physical memory.                                                                                                                                  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/02/how-to-list-the-status-of-swap-in-solaris/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using grep/egrep to find out which file contains a word or string in Unix or Linux</title>
		<link>http://www.gamescheat.ca/2010/02/using-grepegrep-to-find-out-which-file-contains-a-word-or-string-in-unix-or-linux/</link>
		<comments>http://www.gamescheat.ca/2010/02/using-grepegrep-to-find-out-which-file-contains-a-word-or-string-in-unix-or-linux/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 15:04:00 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Aix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=783</guid>
		<description><![CDATA[If you need to find out which file in a directory contains a specific word then the grep command is your friend. Here is an example, if you wanted to find out which file in the directory /home contains the word groundhog. grep –i “groundhog” /home/* /home/shadow:Today is groundhog day The –i option means grep [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to find out which file in a directory contains a specific word then the grep command is your friend.</p>
<p>Here is an example, if you wanted to find out which file in the directory /home contains the word groundhog.</p>
<blockquote><p>grep –i “groundhog” /home/*<br />
/home/shadow:Today is groundhog day</p></blockquote>
<p>The –i option means grep will ignore upper/lower case distinction during comparisons.<br />
The word to search for is enclosed in double quotes, “groundhog”.<br />
/home is the directory to search in and the * signifies all files.<br />
The file /home/shadow contains the word groundhog, the content of the line containing the word groundhog is displayed on screen.</p>
<p>But what if you wanted to search for a string of words. Grep only searches for a single word.  Egrep will search all files for a string of words.  Here is an excerpt from the man pages of Solaris 10.</p>
<p>The egrep (expression grep) utility  searches  files  for  a<br />
pattern of characters and prints all lines that contain that<br />
pattern. egrep uses full  regular  expressions  (expressions<br />
that   has   string   values  that  use  the  full  set  of<br />
alphanumeric and special characters) to match the  patterns.<br />
It  uses a fast deterministic algorithm that sometimes needs<br />
exponential space.                                           </p>
<p>Below is an example of egrep.</p>
<blockquote><p>egrep –i “Apple announces the release of the ipad” /home/*<br />
/home/obama: Today Apple announces the release of the ipad</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/02/using-grepegrep-to-find-out-which-file-contains-a-word-or-string-in-unix-or-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

