<?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"
	>

<channel>
	<title>EzyLinux - Linux Server and Linux Desktop</title>
	<atom:link href="http://www.ezylinux.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ezylinux.com</link>
	<description>ลินุกซ์ง่ายนิดเดียว</description>
	<pubDate>Tue, 01 Jul 2008 04:51:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Decrease the time for rebuilding the RAID 1 array</title>
		<link>http://www.ezylinux.com/2008/06/27/decrease-the-time-for-rebuilding-the-raid-1-array/</link>
		<comments>http://www.ezylinux.com/2008/06/27/decrease-the-time-for-rebuilding-the-raid-1-array/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 14:07:38 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[HDD Management]]></category>

		<category><![CDATA[Decrease time rebuilding raid]]></category>

		<category><![CDATA[Raid]]></category>

		<category><![CDATA[RAID 1]]></category>

		<category><![CDATA[rebuild RAID]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=171</guid>
		<description><![CDATA[เมื่อต้องการลดเวลาการ rebuild Raid 1 เราสามารถใช้คำสั่งด้านล่างนี้ได้ครับ
#mdadm -C /dev/md0 -l1 -n2 /dev/sda1 /dev/sda2 &#8211;bitmap=internal
&#8211;bitmap (Write-intent bitmap) จะช่วยลดเวลาการ Sync ได้โดยถ้าเกิด disk offline temporarily, kernel crash จะทำการ Sync เฉพาะ Block ที่ถูกแก้ไขเท่านั้น แต่ถ้า block ไหนไม่ได้ถูก Sync จะถูก copy มาแทน
&#8211;bitmap=internal หมายถึงการเก็บ metadata ไว้ที่ Raid เลย


	Tags: Decrease time rebuilding raid, Raid, RAID 1, rebuild RAID

	Related posts
	
	Re-shape or Grow a Raid 5 array. [...]]]></description>
			<content:encoded><![CDATA[<p>เมื่อต้องการลดเวลาการ rebuild <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> 1 เราสามารถใช้คำสั่งด้านล่างนี้ได้ครับ</p>
<p>#<tt class="command">mdadm -C /dev/md0 -l1 -n2 /dev/sda1 /dev/sda2 &#8211;bitmap=internal</tt></p>
<p><tt class="command">&#8211;bitmap </tt>(Write-intent bitmap) จะช่วยลดเวลาการ Sync ได้โดยถ้าเกิด disk offline temporarily, kernel crash จะทำการ Sync เฉพาะ Block ที่ถูกแก้ไขเท่านั้น แต่ถ้า block ไหนไม่ได้ถูก Sync จะถูก copy มาแทน</p>
<p><tt class="command">&#8211;bitmap=internal หมายถึงการเก็บ metadata ไว้ที่ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> เลย<br />
</tt></p>

	Tags: <a href="http://www.ezylinux.com/tag/decrease-time-rebuilding-raid/" title="Decrease time rebuilding raid" rel="tag">Decrease time rebuilding raid</a>, <a href="http://www.ezylinux.com/tag/raid/" title="Raid" rel="tag">Raid</a>, <a href="http://www.ezylinux.com/tag/raid-1/" title="RAID 1" rel="tag">RAID 1</a>, <a href="http://www.ezylinux.com/tag/rebuild-raid/" title="rebuild RAID" rel="tag">rebuild RAID</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li><a href="http://www.ezylinux.com/2008/06/27/re-shape-or-grow-a-raid-5-array/" title="Re-shape or Grow a Raid 5 array. (June 27, 2008)">Re-shape or Grow a Raid 5 array.</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/27/decrease-the-time-for-rebuilding-the-raid-1-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Re-shape or Grow a Raid 5 array.</title>
		<link>http://www.ezylinux.com/2008/06/27/re-shape-or-grow-a-raid-5-array/</link>
		<comments>http://www.ezylinux.com/2008/06/27/re-shape-or-grow-a-raid-5-array/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 12:09:15 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[HDD Management]]></category>

		<category><![CDATA[Grow a Raid 5]]></category>

		<category><![CDATA[Raid]]></category>

		<category><![CDATA[Raid 5]]></category>

		<category><![CDATA[Re-shape Raid 5]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=170</guid>
		<description><![CDATA[การเพิ่มเนื้อที่ในการทำ Raid Software ของทาง linux นั้นมีการแก้ไขที่ไม่ยากอย่างที่คิด โดยสมมติให้เรามีการทำ Software Raid 5 อยู่ 1 deivce คือ /dev/md0 และมีจำนวนของ HDD ที่ทำ Raid 5 อยู่ทั้งหมด 3 ลูก และเราต้องการเพิ่มเนื้อเนื่องจากสาเหตุใดก็ตามแต่ เราสามารถทำได้โดยเพิ่ม  HDD เข้ามาตามจำนวนที่ต้องการ (ขอเน้นนิดนะครับ HDD ใหม่ควรที่จะมีเนื้อที่เท่ากับ HDD เดิมที่ใช้ทำ Raid อยู่) โดยผมสมมติว่าต้องการเพิ่ม HDD 1 ลูก ชื่อ device /dev/sdd1 นะครับ เมื่อทำการเพิ่ม HDD เข้าไปแล้ว ให้ใช้คำสั่งด้านล่างนี้เพื่อเพิ่ม HDD เข้าสู่ Raid device
#mdadm /dev/md0 -a /dev/sdd1
จากนั้นให้ run คำสั่งด้านล่างเพื่อเพิ่มขนาดของ [...]]]></description>
			<content:encoded><![CDATA[<p>การเพิ่มเนื้อที่ในการทำ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> Software ของทาง linux นั้นมีการแก้ไขที่ไม่ยากอย่างที่คิด โดยสมมติให้เรามีการทำ Software <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> 5 อยู่ 1 deivce คือ /dev/md0 และมีจำนวนของ HDD ที่ทำ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> 5 อยู่ทั้งหมด 3 ลูก และเราต้องการเพิ่มเนื้อเนื่องจากสาเหตุใดก็ตามแต่ เราสามารถทำได้โดยเพิ่ม  HDD เข้ามาตามจำนวนที่ต้องการ (ขอเน้นนิดนะครับ HDD ใหม่ควรที่จะมีเนื้อที่เท่ากับ HDD เดิมที่ใช้ทำ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> อยู่) โดยผมสมมติว่าต้องการเพิ่ม HDD 1 ลูก ชื่อ device /dev/sdd1 นะครับ เมื่อทำการเพิ่ม HDD เข้าไปแล้ว ให้ใช้คำสั่งด้านล่างนี้เพื่อเพิ่ม HDD เข้าสู่ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> device</p>
<p><tt class="command">#mdadm /dev/md0 -a /dev/sdd1</tt></p>
<p>จากนั้นให้ run คำสั่งด้านล่างเพื่อเพิ่มขนาดของ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> device โดยที่</p>
<p>-n คือจำนวนของ HDD ทั้งหมดของ <a href="http://www.ezylinux.com/tag/raid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Raid">Raid</a> Device</p>
<p><tt class="command">&#8211;backup-file คือ การ save </tt><tt class="command">critical section เพื่อป้องกันการเกิดเหตุการณ์ล้มเหลว แล้วจะไม่เกิดอันตรายต่อข้อมูลของเรา<br />
</tt></p>
<p>#<tt class="command">mdadm -G /dev/md0 -n4 &#8211;backup-file=/tmp/critical-section</tt></p>
<p>ขั้นตอนสุดท้ายให้ทำการ Resize Filesystem ครับ โดยใช้คำสั่ง</p>
<p>#<tt class="command">resize2fs /dev/md0</tt></p>
<p>เมื่อเสร็จทุกขั้นตอนแล้วให้ทำการรันคำสั่ง</p>
<p>#cat /proc/mdstat</p>
<p>ถ้าเห็นสถานะ [UUUU] แสดงว่าใช้ได้แล้วครับ <img src='http://www.ezylinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>

	Tags: <a href="http://www.ezylinux.com/tag/grow-a-raid-5/" title="Grow a Raid 5" rel="tag">Grow a Raid 5</a>, <a href="http://www.ezylinux.com/tag/raid/" title="Raid" rel="tag">Raid</a>, <a href="http://www.ezylinux.com/tag/raid-5/" title="Raid 5" rel="tag">Raid 5</a>, <a href="http://www.ezylinux.com/tag/re-shape-raid-5/" title="Re-shape Raid 5" rel="tag">Re-shape Raid 5</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li><a href="http://www.ezylinux.com/2008/06/27/decrease-the-time-for-rebuilding-the-raid-1-array/" title="Decrease the time for rebuilding the RAID 1 array (June 27, 2008)">Decrease the time for rebuilding the RAID 1 array</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/27/re-shape-or-grow-a-raid-5-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to enable xdmcp</title>
		<link>http://www.ezylinux.com/2008/06/20/how-to-enable-xdmcp/</link>
		<comments>http://www.ezylinux.com/2008/06/20/how-to-enable-xdmcp/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 16:33:38 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[System]]></category>

		<category><![CDATA[xdmcp]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=169</guid>
		<description><![CDATA[เมื่อต้องการที่จะเปิดการทำงานของ xdmcp ในปัจจุบันไฟล์ config ของ xdmcp ได้ถูกเปลี่ยนแปลงไป จากเดิมอยู่ที่ /etc/X11/gdm/gdm.conf มาเป็น /etc/gdm/custom.conf การเปิด xdmcp นั้นให้แก้ไขไฟล์นี้ โดยแก้ไขในส่วนด้านล่างของข้อความ xdmcp ให้มีคำว่า 
Enable=true

หรืออีกวิธีคือใช้ tool แบบ gui โดยรัน
#gdmsetup

เมื่อทำการแก้ไขเสร็จเรียบร้อยแล้ว อย่าลืมรันคำสั่ง
#gdm-restart

ด้วยนะครับ

	Tags: xdmcp

	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p>เมื่อต้องการที่จะเปิดการทำงานของ <a href="http://www.ezylinux.com/tag/xdmcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xdmcp">xdmcp</a> ในปัจจุบันไฟล์ config ของ <a href="http://www.ezylinux.com/tag/xdmcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xdmcp">xdmcp</a> ได้ถูกเปลี่ยนแปลงไป จากเดิมอยู่ที่ <tt class="command">/etc/X11/gdm/gdm.conf มาเป็น </tt><tt class="command">/etc/gdm/custom.conf การเปิด <a href="http://www.ezylinux.com/tag/xdmcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xdmcp">xdmcp</a> นั้นให้แก้ไขไฟล์นี้ โดยแก้ไขในส่วนด้านล่างของข้อความ <a href="http://www.ezylinux.com/tag/xdmcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xdmcp">xdmcp</a> ให้มีคำว่า </tt></p>
<pre class="screen">Enable=true

หรืออีกวิธีคือใช้ tool แบบ gui โดยรัน
<tt class="command">#gdmsetup

เมื่อทำการแก้ไขเสร็จเรียบร้อยแล้ว อย่าลืมรันคำสั่ง
#</tt><tt class="command">gdm-restart

ด้วยนะครับ</tt></pre>

	Tags: <a href="http://www.ezylinux.com/tag/xdmcp/" title="xdmcp" rel="tag">xdmcp</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/20/how-to-enable-xdmcp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Other Virtual network interfaces go down when bring down virtual network interfaces</title>
		<link>http://www.ezylinux.com/2008/06/20/other-virtual-network-interfaces-go-down-when-bring-down-virtual-network-interfaces/</link>
		<comments>http://www.ezylinux.com/2008/06/20/other-virtual-network-interfaces-go-down-when-bring-down-virtual-network-interfaces/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 16:20:02 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[Network]]></category>

		<category><![CDATA[network virtual network interface]]></category>

		<category><![CDATA[Virtual network interface]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=168</guid>
		<description><![CDATA[เคยเกิดปัญหาไหม ถ้าเราทำการสร้าง Virtual network interfaces ขึ้นมาหลายๆ interface และพบว่าเมื่อเรา down Virtual network interfaces บาง Virtual network interfaces จะทำให้ Virtual network interfaces อื่นเกิดการ down ไปพร้อมกัน อาการที่เกิดขึ้น เมื่อเรามี virtual network interfaces ทั้งหมด 4 virtual network interfaces ดังนี้ eth0:0, eth0:1, eth0:2 และ eth0:3 และเราต้องการ down eth0:0 และใช้คำสั่ง
#ifdown eth0:0
จะเกิดการ down ที่ eth0:1, eth0:2 และ eth0:3 ด้วย เนื่องจากว่าเกิดจากบักที่ glibc จะทำให้เมื่อเรา down [...]]]></description>
			<content:encoded><![CDATA[<p>เคยเกิดปัญหาไหม ถ้าเราทำการสร้าง Virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces ขึ้นมาหลายๆ interface และพบว่าเมื่อเรา down Virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces บาง Virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces จะทำให้ Virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces อื่นเกิดการ down ไปพร้อมกัน อาการที่เกิดขึ้น เมื่อเรามี virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces ทั้งหมด 4 virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interfaces ดังนี้ eth0:0, eth0:1, eth0:2 และ eth0:3 และเราต้องการ down eth0:0 และใช้คำสั่ง</p>
<p>#ifdown eth0:0</p>
<p>จะเกิดการ down ที่ eth0:1, eth0:2 และ eth0:3 ด้วย เนื่องจากว่าเกิดจากบักที่ glibc จะทำให้เมื่อเรา down virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interface ที่หมายเลขหนึ่งๆ จะทำให้ virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interface ที่มีหมายเลขสูงกว่า down ไปด้วย ในที่นี้ก็คือ virtual <a href="http://www.ezylinux.com/tag/network/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Network">network</a> interface eth0:1, eth0:2 และ eth0:3 จะ down ไปด้วย</p>
<p>อีกตัวอย่างนึง เราต้องการ down eth0:2 และใช้คำสั่ง</p>
<p>#ifdown eth0:2</p>
<p>จะเกิดการ down ที่ eth0:3</p>
<p>ทางแก้ไขก็คือ upgrade glibc อย่างเดียวเลยครับ</p>

	Tags: <a href="http://www.ezylinux.com/tag/network/" title="Network" rel="tag">Network</a>, <a href="http://www.ezylinux.com/tag/network-virtual-network-interface/" title="network virtual network interface" rel="tag">network virtual network interface</a>, <a href="http://www.ezylinux.com/tag/virtual-network-interface/" title="Virtual network interface" rel="tag">Virtual network interface</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li><a href="http://www.ezylinux.com/2008/03/06/make-bridge-multiple-network-interfaces-on-xen-host-to-guests-os/" title="Make bridge multiple network interfaces on Xen host to guests os. (March 6, 2008)">Make bridge multiple network interfaces on Xen host to guests os.</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/20/other-virtual-network-interfaces-go-down-when-bring-down-virtual-network-interfaces/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Show line numbers in vi/vim editor.</title>
		<link>http://www.ezylinux.com/2008/06/18/show-line-numbers-in-vivim-editor/</link>
		<comments>http://www.ezylinux.com/2008/06/18/show-line-numbers-in-vivim-editor/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 12:59:43 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[SSH/Telnet]]></category>

		<category><![CDATA[line numbers]]></category>

		<category><![CDATA[vi]]></category>

		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=167</guid>
		<description><![CDATA[ในบางครั้งเราต้องการที่จะค้นหาข้อความที่อยู่ในบรรทัดใดบรรทัดหนึ่งของไฟล์ที่ต้องการแก้ไข ซึ่งครั้งหนึ่งผมก็เคยต้องการค้นหาว่าบรรทัดที่เกิด error ตามที่ Log แสดงออกมานั้นมีข้อมูลอะไรอยู่ ซึ่งตอนแรกๆก็ไม่ได้ค้นหาวิธีว่ามันทำอย่างไรให้แสดงเลขบรรทัดออกมา ช่วงนั้นก็อาศัยความถึกเข้าสู้ด้วยการนับบรรทัดเอา ในบทความนี้ผมจะมาบอกวิธีีการทำให้โปรแกรม vi/vim แสดงเลขบรรทัดและยกเลิกแสดงเลขบรรทัดว่ามันง่ายแค่นิดเดียว เอาละครับมาเริ่มกันเลยละกัน
ถ้าต้องการแสดงเลขบรรทัดให้พิมพ์คำว่า
:set number หรือ :set nu
ถ้าต้องการยกเลิกการแสดงเลขบรรทัดให้พิมพ์คำว่า
:set nonum หรือ :set nonumber
** ข้อสำคัญจะต้องอยู่ใน command mode ของ vi/vim (ผมไม่รู้ว่าเรียกว่าโหมดอะไรแต่ขอเรียกอย่างงี้ละกัน) ถ้ายังไม่แน่ใจว่าอยู่หรือยังให้กด Esc ย้ำไปสองครั้งก่อนพิมพ์คำสั่งข้างต้นนะครับ 

	Tags: line numbers, vi, vim

	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p>ในบางครั้งเราต้องการที่จะค้นหาข้อความที่อยู่ในบรรทัดใดบรรทัดหนึ่งของไฟล์ที่ต้องการแก้ไข ซึ่งครั้งหนึ่งผมก็เคยต้องการค้นหาว่าบรรทัดที่เกิด error ตามที่ Log แสดงออกมานั้นมีข้อมูลอะไรอยู่ ซึ่งตอนแรกๆก็ไม่ได้ค้นหาวิธีว่ามันทำอย่างไรให้แสดงเลขบรรทัดออกมา ช่วงนั้นก็อาศัยความถึกเข้าสู้ด้วยการนับบรรทัดเอา ในบทความนี้ผมจะมาบอกวิธีีการทำให้โปรแกรม <a href="http://www.ezylinux.com/tag/vi/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vi">vi</a>/<a href="http://www.ezylinux.com/tag/vim/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vim">vim</a> แสดงเลขบรรทัดและยกเลิกแสดงเลขบรรทัดว่ามันง่ายแค่นิดเดียว เอาละครับมาเริ่มกันเลยละกัน</p>
<p>ถ้าต้องการแสดงเลขบรรทัดให้พิมพ์คำว่า<br />
:set number หรือ :set nu</p>
<p>ถ้าต้องการยกเลิกการแสดงเลขบรรทัดให้พิมพ์คำว่า<br />
:set nonum หรือ :set nonumber</p>
<p>** ข้อสำคัญจะต้องอยู่ใน command mode ของ <a href="http://www.ezylinux.com/tag/vi/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vi">vi</a>/<a href="http://www.ezylinux.com/tag/vim/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vim">vim</a> (ผมไม่รู้ว่าเรียกว่าโหมดอะไรแต่ขอเรียกอย่างงี้ละกัน) ถ้ายังไม่แน่ใจว่าอยู่หรือยังให้กด Esc ย้ำไปสองครั้งก่อนพิมพ์คำสั่งข้างต้นนะครับ <img src='http://www.ezylinux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>

	Tags: <a href="http://www.ezylinux.com/tag/line-numbers/" title="line numbers" rel="tag">line numbers</a>, <a href="http://www.ezylinux.com/tag/vi/" title="vi" rel="tag">vi</a>, <a href="http://www.ezylinux.com/tag/vim/" title="vim" rel="tag">vim</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/18/show-line-numbers-in-vivim-editor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Increase the maximum file descriptors for Squid</title>
		<link>http://www.ezylinux.com/2008/06/13/increase-the-maximum-file-descriptors-for-squid/</link>
		<comments>http://www.ezylinux.com/2008/06/13/increase-the-maximum-file-descriptors-for-squid/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 14:04:35 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[Squid]]></category>

		<category><![CDATA[file descriptors]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=166</guid>
		<description><![CDATA[ถ้า squid คุณเกิดปัญหาหรือ error message ขึ้นว่า WARNING! Your cache is running out of filedescriptors ในไฟล์ cache.log แสดงว่า Squid version ที่ใช้อยู่ได้ compile ให้ไฟล์ file descriptors ให้สามารถใช้ได้มากสุด 1024 ซึ่งปัญหานี้เราไม่สามารถแก้ไขด้วยวิธีการใช้ ulimit ได้โดยตรง
ใน Squid ที่ support จะมี option max_filedesc เพิ่มขึ้นมาเพื่อใช้ในกาีรแก้ไขปัญหานี้
Linux ที่ support (ตอนนี้ทราบแต่ทาง Red Hat)
Red Hat Enterprise Linux 3: squid-2.5.STABLE3-6.3E.18
Red Hat Enterprise Linux 4: squid-2.5.STABLE14-1.4E
Red Hat Enterprise Linux 5
ส่วนวิธีการแก้ไขนั้นเราสามารถทำได้ตามขั้นตอนข้างล่างนี้ได้เลยครับ
1. [...]]]></description>
			<content:encoded><![CDATA[<p>ถ้า <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a> คุณเกิดปัญหาหรือ error message ขึ้นว่า <strong><span style="color: #800000;">WARNING! Your cache is running out of filedescriptors</span></strong> ในไฟล์ cache.log แสดงว่า <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">Squid</a> version ที่ใช้อยู่ได้ compile ให้ไฟล์ <a href="http://www.ezylinux.com/tag/file-descriptors/" class="st_tag internal_tag" rel="tag" title="Posts tagged with file descriptors">file descriptors</a> ให้สามารถใช้ได้มากสุด 1024 ซึ่งปัญหานี้เราไม่สามารถแก้ไขด้วยวิธีการใช้ ulimit ได้โดยตรง</p>
<p>ใน <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">Squid</a> ที่ support จะมี option max_filedesc เพิ่มขึ้นมาเพื่อใช้ในกาีรแก้ไขปัญหานี้</p>
<p>Linux ที่ support (ตอนนี้ทราบแต่ทาง Red Hat)</p>
<p>Red Hat Enterprise Linux 3: <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a>-2.5.STABLE3-6.3E.18<br />
Red Hat Enterprise Linux 4: <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a>-2.5.STABLE14-1.4E<br />
Red Hat Enterprise Linux 5</p>
<p>ส่วนวิธีการแก้ไขนั้นเราสามารถทำได้ตามขั้นตอนข้างล่างนี้ได้เลยครับ</p>
<p>1. แก้ไขไฟล์ /etc/security/limits.conf โดยให้เพิ่มข้อความด้านล่างเข้าไปในไฟล์</p>
<p>* - nofile 4096</p>
<p>2. ทำการ re-login (กด Ctrl-D ก็ได้ครับ) เข้าสู่ระบบให้เพื่อให้ทำการโหลด Config ค่าที่ได้แก้ไขไปเมื่อกี้ จากนั้นให้พิมพ์เพื่อทำการตรวจสอบว่าค่าที่ได้แก้ไขถูกโหลดขึ้นมาแล้ว</p>
<p># ulimit -a<br />
<span style="color: #800000;"> open files (-n) 4096</span></p>
<p>3. แก้ไขไฟล์ /etc/<a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a>/<a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a>.conf แล้วเพิ่มค่าด้านล่างเข้าไป</p>
<p>max_filedesc 4096</p>
<p><span style="color: #ff0000;">ค่าที่ได้แก้ไขควรที่จะมี่า<strong>เท่ากับ</strong>ค่าที่แก้ไขในไฟล์ /etc/security/limits.conf ในข้อที่ 1.</span></p>
<p>4. ทำการ Restart <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a> service:</p>
<p># service <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a> restart</p>
<p>5. พิมพ์ squidclient เพื่อตรวจสอบว่า <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a> ได้โหลดคอนฟิกเป็นที่เรียบร้อยแล้วดังคำสั่งด้านล่าง</p>
<p># squidclient mgr:info</p>
<p><span style="color: #993300;">File descriptor usage for <a href="http://www.ezylinux.com/tag/squid/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Squid">squid</a>:<br />
Maximum number of <a href="http://www.ezylinux.com/tag/file-descriptors/" class="st_tag internal_tag" rel="tag" title="Posts tagged with file descriptors">file descriptors</a>: 4096</span></p>

	Tags: <a href="http://www.ezylinux.com/tag/file-descriptors/" title="file descriptors" rel="tag">file descriptors</a>, <a href="http://www.ezylinux.com/tag/squid/" title="Squid" rel="tag">Squid</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li><a href="http://www.ezylinux.com/2007/08/28/transparent-proxy-in-squid-26/" title="Transparent proxy in squid 2.6 (August 28, 2007)">Transparent proxy in squid 2.6</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/13/increase-the-maximum-file-descriptors-for-squid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reduce a non-root LVM.</title>
		<link>http://www.ezylinux.com/2008/06/04/reduce-a-non-root-lvm/</link>
		<comments>http://www.ezylinux.com/2008/06/04/reduce-a-non-root-lvm/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 09:56:07 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[HDD Management]]></category>

		<category><![CDATA[System]]></category>

		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/?p=165</guid>
		<description><![CDATA[การลดขนาดของ LVM สามารถที่ไม่ไม่ใช้ root user ทำก็ได้ ซึ่งจากตัวอย่างนี้จะสมมติการลดขนาดของ LVM ที่มีเนื้อที่จำนวน 10GB โดยต้องการที่จะลดขนาดของ LVM ให้มีขนาดเหลือ 8GB โดยสมมติว่าเราได้ Mount LVM นี้ใน directory /data ขั้นตอนการลดขนาดสามารถทำตาม step ข้างล่างนี้ได้เลยครับ
ขั้นที่ 1. ให้ทำการ umount ข้อมูลก่อนเพื่อป้องกันไม่ให้ OS ใช้งาน LVM นี้
$ umount /data
ขั้นที่ 2. ทำการลดขนาด file system ก่อน ซึ่งขั้นตอนนี้สำคัญมากถ้าเราไม่ทำการลดขนาดของ file system ก่อนจะทำให้อาจเกิดความเสียหายต่อ data ของเราได้
$ resize2fs /dev/vg0/LV 8G         [...]]]></description>
			<content:encoded><![CDATA[<p>การลดขนาดของ <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> สามารถที่ไม่ไม่ใช้ root user ทำก็ได้ ซึ่งจากตัวอย่างนี้จะสมมติการลดขนาดของ <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> ที่มีเนื้อที่จำนวน 10GB โดยต้องการที่จะลดขนาดของ <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> ให้มีขนาดเหลือ 8GB โดยสมมติว่าเราได้ Mount <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> นี้ใน directory /data ขั้นตอนการลดขนาดสามารถทำตาม step ข้างล่างนี้ได้เลยครับ</p>
<p>ขั้นที่ 1. ให้ทำการ umount ข้อมูลก่อนเพื่อป้องกันไม่ให้ OS ใช้งาน <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> นี้<br />
$ umount /data</p>
<p>ขั้นที่ 2. ทำการลดขนาด file system ก่อน ซึ่งขั้นตอนนี้สำคัญมากถ้าเราไม่ทำการลดขนาดของ file system ก่อนจะทำให้อาจเกิดความเสียหายต่อ data ของเราได้<br />
$ resize2fs /dev/vg0/LV 8G           // 8G นี้คือขนาดที่เราต้องการจะลด</p>
<p>ขั้นที่ 3. ทำการลดขนาดของ LV โดยใช้คำสั่ง<br />
$ lvreduce -L -2G /dev /vg0/LV     // -2G คือขนาดที่เราต้องการลบออกจาก LV</p>
<p>ขั้นที่ 4. ทำการ mount ข้อมูล<br />
$ mount /data</p>
<p>ขั้นที่ 5. ลองใช้คำสั่ง df -h เพื่อตรวจสอบขนาดหลังการลด</p>
<h4><span style="color: #ff0000;">คำเตือน!! เมื่อทำการลดขนาดของ <a href="http://www.ezylinux.com/tag/lvm/" class="st_tag internal_tag" rel="tag" title="Posts tagged with LVM">LVM</a> ควรที่จะ backup ก่อนทุกครั้ง และห้ามลดขนาดของ LV มากกว่าเนื้อที่ที่เหลืออยู่.</span></h4>

	Tags: <a href="http://www.ezylinux.com/tag/lvm/" title="LVM" rel="tag">LVM</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/06/04/reduce-a-non-root-lvm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>View just the uncommented lines of text in a config file</title>
		<link>http://www.ezylinux.com/2008/05/30/view-just-the-uncommented-lines-of-text-in-a-config-file/</link>
		<comments>http://www.ezylinux.com/2008/05/30/view-just-the-uncommented-lines-of-text-in-a-config-file/#comments</comments>
		<pubDate>Fri, 30 May 2008 11:46:34 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[System]]></category>

		<category><![CDATA[config file]]></category>

		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/2008/05/30/view-just-the-uncommented-lines-of-text-in-a-config-file/</guid>
		<description><![CDATA[เราสามารถที่จะใช้คำสั่ง grep ในการช่วยดูไฟล์คอนฟิกในส่วนของข้อความที่มีที่ขึ้นต้นด้วยตัวอักษรต่างๆ เพื่อใช้ในการดูคอมเม้นต์ของไฟล์คอนฟิกนั้นๆว่าได้ทำการคอมเม้นต์อะไรบ้าง จะได้สะดวกในการค้นหาและตรวจสอบค่าคอนฟิกของเรา
รูปแบบคำสั่ง
#grep -v &#8220;^#&#8221; myfile.conf  &#124; cat -s &#124; less
ต้องการดูคอมเม้นต์ของไฟล์คอนฟิกที่มีลักษณะการคอมเม้นต์ที่ใช้ #
# grep -v &#8220;^#&#8221; /etc/CONFIGFILE.conf &#124; cat -s &#124; less
หรือ ต้องการดูคอมเม้นต์ของไฟล์ sendmail.mc ให้พิมพ์
# grep -v &#8220;^dnl&#8221; /etc/mail/sendmail.mc &#124; cat -s &#124; less

	Tags: config file, grep

	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p>เราสามารถที่จะใช้คำสั่ง <a href="http://www.ezylinux.com/tag/grep/" class="st_tag internal_tag" rel="tag" title="Posts tagged with grep">grep</a> ในการช่วยดูไฟล์คอนฟิกในส่วนของข้อความที่มีที่ขึ้นต้นด้วยตัวอักษรต่างๆ เพื่อใช้ในการดูคอมเม้นต์ของไฟล์คอนฟิกนั้นๆว่าได้ทำการคอมเม้นต์อะไรบ้าง จะได้สะดวกในการค้นหาและตรวจสอบค่าคอนฟิกของเรา</p>
<p>รูปแบบคำสั่ง</p>
<p>#<a href="http://www.ezylinux.com/tag/grep/" class="st_tag internal_tag" rel="tag" title="Posts tagged with grep">grep</a> -v &#8220;^#&#8221; myfile.conf  | cat -s | less</p>
<p>ต้องการดูคอมเม้นต์ของไฟล์คอนฟิกที่มีลักษณะการคอมเม้นต์ที่ใช้ #</p>
<p># <a href="http://www.ezylinux.com/tag/grep/" class="st_tag internal_tag" rel="tag" title="Posts tagged with grep">grep</a> -v &#8220;^#&#8221; /etc/CONFIGFILE.conf | cat -s | less</p>
<p>หรือ ต้องการดูคอมเม้นต์ของไฟล์ sendmail.mc ให้พิมพ์<br />
# <a href="http://www.ezylinux.com/tag/grep/" class="st_tag internal_tag" rel="tag" title="Posts tagged with grep">grep</a> -v &#8220;^dnl&#8221; /etc/mail/sendmail.mc | cat -s | less</p>

	Tags: <a href="http://www.ezylinux.com/tag/config-file/" title="config file" rel="tag">config file</a>, <a href="http://www.ezylinux.com/tag/grep/" title="grep" rel="tag">grep</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/05/30/view-just-the-uncommented-lines-of-text-in-a-config-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Configure the shell to logout automatically after a period of idle time.</title>
		<link>http://www.ezylinux.com/2008/05/30/configure-the-shell-to-logout-automatically-after-a-period-of-idle-time/</link>
		<comments>http://www.ezylinux.com/2008/05/30/configure-the-shell-to-logout-automatically-after-a-period-of-idle-time/#comments</comments>
		<pubDate>Fri, 30 May 2008 10:55:13 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[SSH/Telnet]]></category>

		<category><![CDATA[Security]]></category>

		<category><![CDATA[System]]></category>

		<category><![CDATA[logout]]></category>

		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/2008/05/30/configure-the-shell-to-logout-automatically-after-a-period-of-idle-time/</guid>
		<description><![CDATA[ในบางระบบที่มีการให้ user  login เข้าสู่ระบบเยอะมากและมี user ที่ออกจากระบบโดยไม่มีการ logout ออกไปจะทำให้ระบบสูญเสียทรัพยากรโดยใช้เหตุ ดังนั้นเราสามารถที่จะนำวิธีนี้มาแก้ไขได้และยังเพื่อความปลอดภัยให้กับระบบอีกทางนึงด้วย วิธีการจะแตกต่างกันขึ้นอยู่กับ shell ที่ใช้ซึ่งสามารถดูวิธีการเว็ตของแต่ละ shell ได้ดังวิธีข้างล่าง
สำหรับ bash or zsh:
#export TMOUT=เวลา หน่อยเป็นวินาที
สำหรับ tcsh:
#set autologout=เวลา หน่อยเป็นวินาที
สำหรับ ksh:
#export TMOUT=เวลา หน่อยเป็นวินาที

	Tags: logout, shell

	Related posts
	
	No related posts.
	

]]></description>
			<content:encoded><![CDATA[<p>ในบางระบบที่มีการให้ user  login เข้าสู่ระบบเยอะมากและมี user ที่ออกจากระบบโดยไม่มีการ <a href="http://www.ezylinux.com/tag/logout/" class="st_tag internal_tag" rel="tag" title="Posts tagged with logout">logout</a> ออกไปจะทำให้ระบบสูญเสียทรัพยากรโดยใช้เหตุ ดังนั้นเราสามารถที่จะนำวิธีนี้มาแก้ไขได้และยังเพื่อความปลอดภัยให้กับระบบอีกทางนึงด้วย วิธีการจะแตกต่างกันขึ้นอยู่กับ <a href="http://www.ezylinux.com/tag/shell/" class="st_tag internal_tag" rel="tag" title="Posts tagged with shell">shell</a> ที่ใช้ซึ่งสามารถดูวิธีการเว็ตของแต่ละ <a href="http://www.ezylinux.com/tag/shell/" class="st_tag internal_tag" rel="tag" title="Posts tagged with shell">shell</a> ได้ดังวิธีข้างล่าง</p>
<p>สำหรับ bash or zsh:<br />
#export TMOUT=เวลา หน่อยเป็นวินาที</p>
<p>สำหรับ tcsh:<br />
#set autologout=เวลา หน่อยเป็นวินาที</p>
<p>สำหรับ ksh:<br />
#export TMOUT=เวลา หน่อยเป็นวินาที</p>

	Tags: <a href="http://www.ezylinux.com/tag/logout/" title="logout" rel="tag">logout</a>, <a href="http://www.ezylinux.com/tag/shell/" title="shell" rel="tag">shell</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/05/30/configure-the-shell-to-logout-automatically-after-a-period-of-idle-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Access a USB flash drive in Linux.</title>
		<link>http://www.ezylinux.com/2008/04/23/access-a-usb-flash-drive-in-linux/</link>
		<comments>http://www.ezylinux.com/2008/04/23/access-a-usb-flash-drive-in-linux/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 19:52:32 +0000</pubDate>
		<dc:creator>Tum.</dc:creator>
		
		<category><![CDATA[HDD Management]]></category>

		<category><![CDATA[System]]></category>

		<category><![CDATA[USB flash drive]]></category>

		<guid isPermaLink="false">http://www.ezylinux.com/2008/04/23/access-a-usb-flash-drive-in-linux/</guid>
		<description><![CDATA[การใช้งาน USB flash หรือ thumbdrives ในระบบปฏิบัติการ Linux นั้นโดยทั่วไปแล้วเมื่อเราเสียบเจ้าตัว USB flash หรือ thumbdrives เข้าไป Linux จะ auto mount ให้เอง แต่ในบางครั้งก็ไม่มีการ auto mount เจ้า USB flash หรือ thumbdrives ดังนั้นผู้ใช้งานมือใหม่ทั้งหลายอาจจะเกิดอาการเซ็งขึ้นมาเนื่องจากการใช้งานที่ยุ่งยาก และไม่รู้ว่าจะทำอย่างไรถึงจะสามารถใช้งานได้ ในบทความนี้ผมจะได้กล่าวถึงการทำให้เราสามารถใช้งาน USB flash หรือ thumbdrives ได้ในกรณีที่ Linux ไม่ทำการ auto mount ให้

ขั้นแรกให้พิมพ์คำสั่ง
#tail -f /var/log/messages
เพื่อตรวจสอบดูว่า  USB flash หรือ thumbdrives ที่เสียบเข้าไปนั้นตัว linux เห็น Hardware นี้หรือปล่าว จากนั้นให้้ทำการเสียบ USB flash หรือ [...]]]></description>
			<content:encoded><![CDATA[<p>การใช้งาน USB flash หรือ thumbdrives ในระบบปฏิบัติการ Linux นั้นโดยทั่วไปแล้วเมื่อเราเสียบเจ้าตัว USB flash หรือ thumbdrives เข้าไป Linux จะ auto mount ให้เอง แต่ในบางครั้งก็ไม่มีการ auto mount เจ้า USB flash หรือ thumbdrives ดังนั้นผู้ใช้งานมือใหม่ทั้งหลายอาจจะเกิดอาการเซ็งขึ้นมาเนื่องจากการใช้งานที่ยุ่งยาก และไม่รู้ว่าจะทำอย่างไรถึงจะสามารถใช้งานได้ ในบทความนี้ผมจะได้กล่าวถึงการทำให้เราสามารถใช้งาน USB flash หรือ thumbdrives ได้ในกรณีที่ Linux ไม่ทำการ auto mount ให้</p>
<p><span id="more-158"></span></p>
<p>ขั้นแรกให้พิมพ์คำสั่ง</p>
<p>#tail -f /var/log/messages</p>
<p>เพื่อตรวจสอบดูว่า  USB flash หรือ thumbdrives ที่เสียบเข้าไปนั้นตัว linux เห็น Hardware นี้หรือปล่าว จากนั้นให้้ทำการเสียบ USB flash หรือ thumbdrives เข้าไปแล้วจะมีข้อความขึ้นมาดังข้างล่าง</p>
<p>Jun 27 12:18:09 localhost kernel: usb 1-5: new high speed USB device using ehci_hcd and address 9<br />
Jun 27 12:18:10 localhost kernel: Initializing USB Mass Storage driver&#8230;<br />
Jun 27 12:18:10 localhost kernel: scsi2 : SCSI emulation for USB Mass Storage devices<br />
Jun 27 12:18:10 localhost kernel: usbcore: registered new driver usb-storage<br />
Jun 27 12:18:10 localhost kernel: USB Mass Storage support registered.<br />
Jun 27 12:18:15 localhost kernel:   Vendor: 256MB     Model: USB2.0FlashDrive  Rev: 2.00<br />
Jun 27 12:18:15 localhost kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02<br />
Jun 27 12:18:15 localhost kernel: sda: Unit Not Ready, sense:<br />
Jun 27 12:18:15 localhost kernel: : Current: sense key: Unit Attention<br />
Jun 27 12:18:15 localhost kernel:     Additional sense: Not ready to ready change, medium may have changed<br />
Jun 27 12:18:15 localhost kernel: sda : READ CAPACITY failed.<br />
Jun 27 12:18:15 localhost kernel: sda : status=1, message=00, host=0, driver=08<br />
Jun 27 12:18:15 localhost kernel: sd: Current: sense key: Unit Attention<br />
Jun 27 12:18:15 localhost kernel:     Additional sense: Not ready to ready change, medium may have changed<br />
Jun 27 12:18:15 localhost kernel: sda: Write Protect is off<br />
Jun 27 12:18:15 localhost kernel: sda: assuming drive cache: write through<br />
Jun 27 12:18:15 localhost kernel: SCSI device sda: 512000 512-byte hdwr sectors (262 MB)<br />
Jun 27 12:18:15 localhost kernel: sda: Write Protect is off<br />
Jun 27 12:18:15 localhost kernel: sda: assuming drive cache: write through<br />
<font color="#800000"> Jun 27 12:18:15 localhost kernel:  sda: sda1</font><br />
Jun 27 12:18:15 localhost kernel: Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0<br />
Jun 27 12:18:15 localhost scsi.agent[3965]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5:1.0/host2/target2:0:0/2:0:0:0<br />
Jun 27 12:18:15 localhost fstab-sync[3989]: added mount point /media/usbdisk for /dev/sda1</p>
<p>จากตัวหนังมือสีแดงสามารถอธิบายคร่าวๆได้ว่า เห็น  USB flash หรือ thumbdrives แล้วชื่อว่า sda และมี partition อยู่ 1 partition ชื่อว่า sda1</p>
<p>ขั้นตอนตัวหนังสือสีเขียวข้างล่างนี้อาจไม่ต้องทำก็ได้<br />
<font color="#008000"> ทำการตรวจสอบดูว่า module usb_storage ได้ถูกโหลดขึ้มมาหรือยัง ด้วยคำสั่ง </font></p>
<p><font color="#008000">#lsmod<br />
Module                  Size  Used by<br />
usb_storage            74761  0<br />
sd_mod                 22977  0<br />
scsi_mod              136457  2 usb_storage,sd_mod</font></p>
<p><font color="#008000">ทำการตรวจสอบ ID ของ flash drive โดยใช้คำสั่ง</font></p>
<p><font color="#008000">#lsusb<br />
Bus 001 Device 009: ID 0ea0:2168 Ours Technology, Inc. Transcend JetFlash 2.0 / Astone USB Drive</font></p>
<p>เมื่อทำการตรวจสอบดูเรียบร้อยแล้วว่าระบบสามารถพบ USB flash หรือ thumbdrives  แล้วขั้นต่อไปเป็นการนำ USB flash หรือ thumbdrives มาใช้งานครับ ด้วยการใช้คำสั่ง</p>
<p># mkdir /mymountpoint                                                    <font color="#800000">// สร้าง directory เพื่อรองรับการ mount</font><br />
# mount /dev/sda1 /mymountpoint          <font color="#800000">     // ทำการ mount USB flash หรือ thumbdrives ขึ้นมาใน directory ที่ชื่อ mymountpoint</font></p>
<p>เมื่อทำครบตามขั้นตอนข้างต้นแล้วยังไม่สามารถใช้งานได้ให้ลองใช้คำสั่ง</p>
<p>#modprobe usb-storage</p>
<p>เพื่อทำการโหลด module usb-storage  ขึ้นมาและให้ทำตามขั้นตอนข้างต้นใหม่หมด</p>
<p>ในกรณีที่ไม่สามารถใช้งานได้เลย (worst case) ให้ทำการ Restart เครื่องใหม่ครับ</p>
<p>เสริม: เมื่อเราไม่ได้ใช้งาน USB flash หรือ thumbdrives นานๆระบบจะทำการ unplug ให้เราโดยอัตโนมัติ และเราสามารถดูได้ว่าระบบทำการ unplug ให้เราแล้วหรือยังโดยให้เราเข้าไปดูที่ไฟล์ /var/log/messages จะมีข้อความข้างล่างปรากฏอยู่แสดงว่าระบบได้ทำการ unplug USB flash หรือ thumbdrives แล้ว</p>
<p>Jun 27 12:35:14 localhost kernel: usb 1-5: USB disconnect, address 9</p>

	Tags: <a href="http://www.ezylinux.com/tag/usb-flash-drive/" title="USB flash drive" rel="tag">USB flash drive</a><br />

	<h4>Related posts</h4>
	<ul class='st-related-posts'>
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ezylinux.com/2008/04/23/access-a-usb-flash-drive-in-linux/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
<br />
<b>Warning</b>:  stristr() [<a href='function.stristr'>function.stristr</a>]: Empty delimiter in <b>E:\ezylinux\wp-content\plugins\wassup\wassup.php</b> on line <b>2093</b><br />
