Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Ubuntu LinuxでSSDの寿命を延ばすための設定
schneemoca
follow
0
7-21-2009 9:22 PM
439 views
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
In 1909 NONE of these things had been invented
What's Wrong With This Snowflake?
New map of gravity variations across the Earth.
Heterochromia in Animals
12 Coolest Nutcrackers
Christmas Morning 1864
Happy Holidays!
God Hates Lady Gaga
13 Beautiful Flower Photos
20 Beautiful Winter Photos
visit the
Top Clips page
View the Top Clips from
July 21, 2009
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/75728166-d60a-4229-8345-f5577a054752/2B5B1DB0-D8B0-41AC-8543-F7F7F7696CE9/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a" href="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a" style="font-size: 11px;">74.125.153.132</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><H2><B>Ubuntu</B> LinuxでSSDの寿命を延ばすための設定</H2></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><H3>OSのキャッシュの書き込みの頻度調整</H3></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P><B>Ubuntu</B>はデフォルトでは書き込み処理はすべてメモリ上にキャッシュされ、これを5秒に1回ディスクに書き込むという仕組みになっているらしいです。なので、このキャッシュを書き込む頻度を5秒から15秒にします。具体的には /etc/sysctl.conf に以下の行を追加します。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><PRE class="bash">vm.dirty_writeback_centisecs = <SPAN>1500</SPAN></PRE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P>設定したら sysctl -p するかOSごと再起動しましょう。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><H3>mlocateを行なう頻度を少なく</H3></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P>locateコマンドのデータベースを作成する mlocate はデフォルトでは /etc/cron.daily にあるので1日1回動いてしまいます。これが動くと大量のディスク書き込みが発生するので、locateのデータベースを最新にしなくても良い場合、この mlocate は /etc/cron.weekly にでも移動しておきます。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><H3>/tmpはtmpfsに</H3></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P>/tmpは再起動するとどうせ消えるデータなので、SSDへの書き込みを少なくするために tmpfs でマウントするようにします。具体的には /<B>etc/fstab</B> にイカの行を追記して再起動します。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><PRE class="bash">tmpfs <SPAN>/</SPAN>tmp tmpfs defaults,<SPAN><SPAN>size</SPAN></SPAN>=512m <SPAN>0</SPAN> <SPAN>0</SPAN></PRE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><H3>mountする際はnoatimeオプションをつける</H3></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P>デフォルトでは読み込みが発生する度にファイルの最終アクセス時刻が更新されてしまいますが、これも寿命を縮めてしまうので、noatimeオプションを導入します。(ただし、アクセス時刻を記録したい場合はこのオプションは導入しないでください) 具体的には /<B>etc/fstab</B> で</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><PRE class="bash"><SPAN>UUID</SPAN>=8bac1db5-e2c6-495f-b3ce-7390dea9392a <SPAN>/</SPAN> ext3 relatime,<SPAN>errors</SPAN>=remount-ro <SPAN>0</SPAN> <SPAN>1</SPAN></PRE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><P>と relatime となっているところを noatime にします。</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><PRE class="bash"><SPAN>UUID</SPAN>=8bac1db5-e2c6-495f-b3ce-7390dea9392a <SPAN>/</SPAN> ext3 noatime,<SPAN>errors</SPAN>=remount-ro <SPAN>0</SPAN> <SPAN>1</SPAN></PRE></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://74.125.153.132/search?q=cache:b_4gSdgGLUcJ:tech.lampetty.net/tech/index.php/archives/299+swap%E9%A0%98%E5%9F%9F%E3%80%80ubuntu%E3%80%80/etc/fstab&cd=9&hl=ja&ct=clnk&gl=jp&lr=lang_ja&client=firefox-a"><li style="margin-left:16px;padding-left: 0px;"><A title="2009 年 4 月 26 日" rel="bookmark" href="http://tech.lampetty.net/tech/index.php/archives/297"><B>Ubuntu</B> Server版をインストール後にやった4つのこと</A></LI></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/2B5B1DB0-D8B0-41AC-8543-F7F7F7696CE9/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK