<?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>[ t h e f r a g g l e . c o m ] &#187; disk</title>
	<atom:link href="http://www.thefraggle.com/tag/disk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thefraggle.com</link>
	<description>technology, photography and anything else that springs to mind.</description>
	<lastBuildDate>Tue, 13 Sep 2011 09:37:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Replacing a failed disk in an SVM root mirror</title>
		<link>http://www.thefraggle.com/2010/11/27/replacing-a-failed-disk-in-an-svm-root-mirror/</link>
		<comments>http://www.thefraggle.com/2010/11/27/replacing-a-failed-disk-in-an-svm-root-mirror/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 17:13:09 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[]]></category>
		<category><![CDATA[disk]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/?p=106</guid>
		<description><![CDATA[So SVM isn&#8217;t something I seem to have to fiddle with much as it just works &#8482; once it&#8217;s all setup, but what if you have a disk fail, and this is an older system using SVM to mirror root/boot devices? Well it&#8217;s pretty simple and can all be done online&#8230; First you need to [...]]]></description>
			<content:encoded><![CDATA[<p>So SVM isn&#8217;t something I seem to have to fiddle with much as it just works &#8482; once it&#8217;s all setup, but what if you have a disk fail, and this is an older system using SVM to mirror root/boot devices? Well it&#8217;s pretty simple and can all be done online&#8230;</p>
<p>First you need to identify which disk has actually failed. In our case it&#8217;s c0t0d0.</p>
<p>You&#8217;ll need to make sure that you remove the stale state database replicas first using metadb:</p>
<p><code>metadb</code></p>
<p>The output above shows the slices that replicas have been created on, to remove the ones from our disk that has failed use the following:</p>
<p><code>metadb -d /dev/dsk/c0t0d0s7</code></p>
<p>Now a lot of the time the case might be that the machine you&#8217;re working on needs to stay up whilst you&#8217;re repairing it. Thankfully Solaris will allow us to remove the disk whilst the system is still running and replace it. My advice would be to simply un-configure the disk that has failed, because even if we make a mistake it might be possible to recover some data from the disk we&#8217;re removing, depending on how long you&#8217;ve left it in error for.</p>
<p><code>cfgadm -al</code></p>
<p>Will show us where the disk lives, identify the correct disk in the list (look at the disks attached from c0, you should be able to work out from there&#8230;)</p>
<p><code>cfgadm -c unconfigure c0::dsk/c0t0d0</code></p>
<p>Now that the disk is removed, we need to get the list of the failed submirrors:</p>
<p><code>metastat -c</code></p>
<p>Will give us the list of mirrors that are failed because of c0t0d0, next remove them from the mirrors they are a member of:</p>
<p><code>metadetach -f d0 d1<br />
metadetach -f d10 d11<br />
metadetach -f d35 d31<br />
metadetach -f d40 d41<br />
metadetach -f d50 d51<br />
metadetach -f d60 d61</code></p>
<p>Once they&#8217;ve been cleared we need to clear the concats:</p>
<p><code>metaclear d1<br />
metaclear d11<br />
metaclear d31<br />
metaclear d41<br />
metaclear d51<br />
metaclear d61<br />
</code></p>
<p>Now that&#8217;s cleaned up we can insert the new disk and format it:</p>
<p><code><em>#insert the new hard disk...</em><br />
cfgadm -c configure c0::dsk/c0t0d0<br />
<em>#get the vtoc configuration from the good disk</em><br />
prtvtoc /dev/rdsk/c1t0d0s2 > /tmp/format.out<br />
<em>#and write it to the new disk</em><br />
fmthard -s /tmp/format.out /dev/rdsk/c0t0d0s2<br />
</code></p>
<p>Now that we&#8217;ve done that it&#8217;d be a good idea to re-create the database state replicas on the new disk:</p>
<p><code>metadb -a -c 2 /dev/dsk/c0t0d0s7</code></p>
<p>Once this is done we can move on to recreating the concats:</p>
<p><code>metainit d1 1 1 c0t0d0s0<br />
metainit d11 1 1 c0t0d0s1<br />
metainit d31 1 1 c0t0d0s3<br />
metainit d41 1 1 c0t0d0s4<br />
metainit d51 1 1 c0t0d0s5<br />
metainit d61 1 1 c0t0d0s6</code></p>
<p>And then attach these to the mirrors they&#8217;re meant to be in:</p>
<p><code>metattach d0 d1<br />
metattach d10 d11<br />
metattach d35 d31<br />
metattach d40 d41<br />
metattach d50 d51<br />
metattach d60 d61</code></p>
<p>As you attach the mirrors you&#8217;ll be able to start monitoring the progress of the mirror re-syncs, you can do this by using metastat:</p>
<p><code>metastat -c</code></p>
<p>Which will give you a short output of all the configured disks, and show the &#8220;Resync %&#8221; status of each mirror that is being re-synced.</p>
<p>A fairly easy task once you know all the steps, you just need to be careful that once you&#8217;ve removed the bad concats that if you need to reboot at all, you boot from the correct disk. Usually I setup devaliases in the obp called bootdiska (c0t0d0) and bootdiskb (c1t0d0) and the devalias &#8216;disk&#8217; is usually just an alias to the same place as bootdiska. So, given c0t0d0 is the disk that has failed on us, make sure you boot from the secondary disk:</p>
<p><code>ok boot disk</code></p>
<p>If you&#8217;re not sure what was created, just issue:</p>
<p><code>ok devalias</code></p>
<p>to show the list of aliases configured, if none useful seem to be there, use:</p>
<p><code>ok probe-scsi-all</code></p>
<p>to give you a list of the disks that are available on the system, from there you should be able to figure out where the disk you want to boot from is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2010/11/27/replacing-a-failed-disk-in-an-svm-root-mirror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iSCSI quick-start guide.</title>
		<link>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/</link>
		<comments>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:19:00 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/?p=72</guid>
		<description><![CDATA[I had to configure an iSCSI target for testing purposes, the steps I followed are below. This assumes that you have the tgtadm software installed, and that you are making use of LVM. 1. create the backing volume in lvm we have one volume group, called vg01, if you want to see what volume groups [...]]]></description>
			<content:encoded><![CDATA[<p>I had to configure an iSCSI target for testing purposes, the steps I followed are below.</p>
<p>This assumes that you have the tgtadm software installed, and that you are making use of LVM.</p>
<h5>1. create the backing volume in lvm</h5>
<p>we have one volume group, called vg01, if you want to see what volume groups you have available, issue:</p>
<p style="padding-left: 30px;"><code>$ vgs<br />
VG   #PV #LV #SN Attr   VSize  VFree<br />
vg01   1   6   0 wz--n- 501G    295G</code></p>
<p>To create your volume, issue something like this:</p>
<p style="padding-left: 30px;"><code>$ lvcreate -L50G vg01 -n iscsiback01</code></p>
<p>Logical volume &#8220;iscsiback01&#8243; created</p>
<h5>2. set up the iSCSI target</h5>
<h6>2.1 create the iSCSI target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op new --mode target --tid 1 -T test-file01:storagetest</code></p>
<p>To verify this was created successfully:</p>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op show --mode target</code></p>
<p style="padding-left: 30px;"><code> Target 1: test-file01:storagetest<br />
System information:<br />
Driver: iscsi<br />
State: ready<br />
I_T nexus information:<br />
LUN information:<br />
LUN: 0<br />
Type: controller<br />
SCSI ID: deadbeaf1:0<br />
SCSI SN: beaf10<br />
Size: 0 MB<br />
Online: Yes<br />
Removable media: No<br />
Backing store: No backing store<br />
Account information:<br />
ACL information:<br />
</code></p>
<h6>2.2  Add a LUN to the target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/vg01/iscsiback01</code></p>
<h6>2.3 Allow access to the new target</h6>
<p style="padding-left: 30px;"><code>$ tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL</code></p>
<p>Instead of using &#8220;ALL&#8221; you can specify addresses that you want to be allowed to access these LUNs.</p>
<h5>3. Set up an iSCSI initiator</h5>
<p>Lets assume that our iSCSI target server is sat on 192.168.10.1, on the initiator you need to issue the following to discover the targets on there</p>
<p style="padding-left: 30px;"><code>$ iscsiadm --mode discovery --type sendtargets --portal 192.168.10.1<br />
192.168.10.1:3260,1 test-file01:storagetest<br />
</code></p>
<p>Once you&#8217;ve done this log into the target session</p>
<p style="padding-left: 30px;"><code>$ iscsiadm --mode node --targetname test-file01:storagetest --portal 192.168.10.1:3260 --login</code></p>
<p>Once you&#8217;ve done this, the first LUN should be added as a new sdX device, &#8220;fdisk -l&#8221; should show this new disk, if not, restart the iscsi service on the initiator and then perform a partprobe.</p>
<p>If you add a new LUN to the target, you can always refresh your iscsi session to force it to show up:</p>
<p style="padding-left: 30px;"><code>$ iscsiadm -m session -R</code></p>
<p>It&#8217;s worth noting that this tool won&#8217;t save any of this configuration to a config file. I resorted to entering the commands above into /etc/rc.local to make sure they were run on boot. You also need to make sure that iscsid and tgtadm are set to start on boot, if you&#8217;re using RHEL or clone of that, a simple:</p>
<p style="padding-left: 30px;"><code><br />
$ chkconfig iscsid on<br />
$ chkconfig tgtadm on</code></p>
<p>Will do this for you, if you&#8217;re using debian:</p>
<p style="padding-left: 30px;"><code><br />
$ update-rc.d iscsid defaults<br />
$ update-rc.d tgtadm defaults</code></p>
<p>Should do the same.</p>
<p>See <a title="TGT Project" href="http://stgt.berlios.de/" target="_blank">http://stgt.berlios.de/</a> for more information about tgt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2009/09/14/iscsi-quick-start-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>always check the disk free!</title>
		<link>http://www.thefraggle.com/2007/04/12/always-check-the-disk-free/</link>
		<comments>http://www.thefraggle.com/2007/04/12/always-check-the-disk-free/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 21:27:22 +0000</pubDate>
		<dc:creator>Chris Ganderton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.thefraggle.com/2007/04/12/always-check-the-disk-free/</guid>
		<description><![CDATA[Came up against the strangest problem the other day, which in the end made it blatantly clear that the most simple 1st checks should always be done; that is things like disk space etc. A server I have access too uses LDAP for user info and Kerberos5 for realm authentication. It was reported that this [...]]]></description>
			<content:encoded><![CDATA[<p>Came up against the strangest problem the other day, which in the end made it blatantly clear that the most simple 1st checks should <strong>always</strong> be done; that is things like disk space etc.</p>
<p>A server I have access too uses LDAP for user info and Kerberos5 for realm authentication. It was reported that this server wasn&#8217;t letting anyone login via ssh, and the only way that I was able to login, was via the console connection for the box (so essentially the only way to connect was locally).</p>
<p>I was able to prove that LDAP lookups were working, by simply id&#8217;ing on user accounts I knew to not exist locally which were stored in LDAP. I was also able to init a kerberos ticket when logged in, and login as ldap/krb5 users &#8220;locally&#8221;.</p>
<p>After a while of faffing about, enabling debug logging on sshd and so on, it dawned on me to check the disk space, thanks to an odd I/O moan in the sshd debug log. Low and behold! the partition where the kerberos key cache for ssh was completely full!</p>
<p>It goes to show that even simple checks like that which sometimes seem noddy, should always be done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thefraggle.com/2007/04/12/always-check-the-disk-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

