<?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>Wazi &#187; Landon Cox</title>
	<atom:link href="http://olex.openlogic.com/wazi/author/lcox/feed/" rel="self" type="application/rss+xml" />
	<link>http://olex.openlogic.com/wazi</link>
	<description>Thinking OPEN</description>
	<lastBuildDate>Fri, 19 Mar 2010 03:29:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu Fiesty Spazzing and Returning to Read-Only State</title>
		<link>http://olex.openlogic.com/wazi/2008/ubuntu-fiesty-spazzing-and-returning-to-read-only-state/</link>
		<comments>http://olex.openlogic.com/wazi/2008/ubuntu-fiesty-spazzing-and-returning-to-read-only-state/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 18:13:58 +0000</pubDate>
		<dc:creator>Landon Cox</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=1811</guid>
		<description><![CDATA[Are you waking up to Ubuntu Feisty defaulting to a read only state? Our developers cracked this one... ]]></description>
			<content:encoded><![CDATA[<h3>Issue</h3>
<p>We&#8217;d like to share a fix for something that has been driving us insane on an Ubuntu Fiesty box (though don’t think it’s at all limited to that distro). This fix may be common knowledge, but, if, like us, you&#8217;ve not heard about it, seriously, how common can it be, eh?</p>
<p>The box in question is a 500G Maxtor USB drive used as a backup drive for a Dell pizza box running Ubuntu Fiesty. We formatted it ext2, got it mounted, ran backup data to it, no problems. We made a daily cron job to do backups, but every morning when we reviewed the cron notifications, we&#8217;d discover that the backup failed because the file system was read-only which is not how we left it.</p>
<p>We&#8217;d log in, try to make a file on the backup drive and sure enough, couldn’t because it was read only. We’d unmount it, then remount it and it would be fine. By the next morning it was read-only again.</p>
<p>We reformatted the drive to ext3, reiserfs…no matter what: problems. Looking at log messages we&#8217;d see things like this:</p>
<p>Nov 19 07:29:54 hurricane kernel: [724306.332761] sd 4:0:0:0: Device not ready: : Current: sense key: Not Ready<br />
Nov 19 07:29:54 hurricane kernel: [724306.332771] Additional sense: Logical unit not ready, initializing command required<br />
Nov 19 07:29:54 hurricane kernel: [724306.332781] end_request: I/O error, dev sdb, sector 10706<br />
Nov 19 07:29:54 hurricane kernel: [724306.332785] printk: 4 messages suppressed.<br />
Nov 19 07:29:54 hurricane kernel: [724306.332797] lost page write due to I/O error on sdb1</p>
<p>where sdb1 was my USB backup drive partition. After digging, we finally found a thread:</p>
<p>http://ubuntuforums.org/showthread.php?t=494673</p>
<p>that talked about a similar issue. Some people saw it on NTFS, FAT32, etc &#8211; it has nothing to do with the drive format as far as we can tell.</p>
<h3>Trick</h3>
<p>The problem is that some drives will spin down (to save energy, we suppose), but that hoses up the filesystem and kernel for writing to it.</p>
<p>For us, the fix was similar to that suggested in the link above:</p>
<p>1) create a file in /etc/udev/rules.d called 85-usb-hd-fix.rules and add this line to it:</p>
<p>BUS==”scsi”, SYSFS{vendor}==”Maxtor”, RUN+=”/usr/bin/usbhdfix %k”</p>
<p>(where you modify the vendor to be appropriate)</p>
<p>2) in /usr/bin add a file: usbhdfix and put this content in it:</p>
<p>#!/bin/bash<br />
# http://ubuntuforums.org/showthread.php?t=494673</p>
<p>echo 1 &gt; /sys/block/$1/device/scsi_disk:*/allow_restart</p>
<p>3) of course, chmod +x usbhdfix as appropriate for you.</p>
<p>After this, our backups never failed again due to the read-only issue.</p>
<p>Apparently a kernel fix is coming or is already there…we didn’t chase that down.</p>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2008/ubuntu-fiesty-spazzing-and-returning-to-read-only-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
