<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2449219125291160382</id><updated>2024-11-06T10:50:10.664+08:00</updated><category term="Blogger"/><category term="BBC VPN"/><category term="DNSmasq"/><category term="Google"/><category term="HACK"/><category term="Renren"/><category term="SAI"/><category term="TowerVPN"/><category term="VPN"/><category term="Windows live writer"/><category term="WordPress"/><category term="XSS"/><category term="resolvconf"/><category term="免费VPN"/><category term="免费香港VPN"/><category term="动漫"/><category term="同步"/><category term="手绘"/><category term="插件"/><category term="新加坡VPN"/><category term="游戏"/><category term="翻墙"/><category term="自动翻墙 VPN"/><category term="英国vpn"/><category term="黑客"/><title type='text'>ZXM‘s Blog</title><subtitle type='html'>The more quieter you become, the more you are able to hear</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-9167298701526092779</id><published>2013-03-05T13:13:00.000+08:00</published><updated>2013-03-05T13:15:11.785+08:00</updated><title type='text'>海盗湾入住朝鲜</title><content type='html'>这尼玛太讽刺了，民主自由的西方怎么容不下它呢。。&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=109&quot; target=_blank&gt;海盗湾入住朝鲜&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/9167298701526092779/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/03/blog-post.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/9167298701526092779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/9167298701526092779'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/03/blog-post.html' title='海盗湾入住朝鲜'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-1636425352142359467</id><published>2013-02-28T00:38:00.001+08:00</published><updated>2013-02-28T00:38:34.898+08:00</updated><title type='text'>20130227</title><content type='html'>今天早上七点多就醒了，想了想十点有课，纠结半天要不要去，决定再睡会九点多起，结果一觉睡到十点半，上7人人发现老师点名，我了个槽，专点大四的，还说建议没去上课的人退课。。纠结半天。下午咨询了分配工作的事情，回来的路上碰到了关老师，结果说明天去商量毕设，让我准备一下。。我勒个去，连夜看论文，还是看不懂，明天再看到底怎么办吧。。。。哎，睡啦睡啦，晚安&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=108&quot; target=_blank&gt;20130227&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/1636425352142359467/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/20130227.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/1636425352142359467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/1636425352142359467'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/20130227.html' title='20130227'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3799675024850087185</id><published>2013-02-26T23:09:00.001+08:00</published><updated>2013-02-26T23:09:42.454+08:00</updated><title type='text'>God Knows</title><content type='html'>乾(かわ)いた心(こころ)で駆(か)け抜(ぬ)け る&lt;br /&gt; &lt;br /&gt; ごめんね何(なに)もできなくて&lt;br /&gt; &lt;br /&gt; 痛(いた)みを分(わ)かち合(あ)うことさえ&lt;br /&gt; &lt;br /&gt; あなたは许(ゆる)してくれない&lt;br /&gt; &lt;br /&gt; 无垢(むく)に生(い)きるため振(ふ)り向(む) かず&lt;br /&gt; &lt;br /&gt; 背中(せなか)向(む)けて 去(さ)ってしまう&lt;br /&gt; &lt;br /&gt; on the lonely rail&lt;br /&gt; &lt;br /&gt; 私(わたし)ついていくよ&lt;br /&gt; &lt;br /&gt; どんな辛(つら)い世界(せかい)の闇(やみ) の中(なか)でさえ&lt;br /&gt; &lt;br /&gt; きっとあなたは辉(かがや)いて&lt;br /&gt; &lt;br /&gt; 超(こ)える未来(みらい)の果(は)て&lt;br /&gt; &lt;br /&gt; 弱(よわ)さ故(ゆえ)に魂(たましい)こわさ れぬように&lt;br /&gt; &lt;br /&gt; my way 重(かさ)なるよ&lt;br /&gt; &lt;br /&gt; いまふたりにGod bless...&lt;br /&gt; &lt;br /&gt; 届(とど)けて热(あつ)くなる想(おも)いは&lt;br /&gt; &lt;br /&gt; 现実(げんじつ)溶(と)かしてさまよう&lt;br /&gt; &lt;br /&gt; 会(あ)いたい気持(きも)ちに理由(りゆう) はない&lt;br /&gt; &lt;br /&gt; あなたへあふれだすLovin&amp;#039; you&lt;br /&gt; &lt;br /&gt; せめて美(うつく)しい梦(ゆめ)だけを&lt;br /&gt; &lt;br /&gt; 描(えが)きながら 追(お)いかけよう&lt;br /&gt; &lt;br /&gt; for your lonely heart&lt;br /&gt; &lt;br /&gt; やめて嘘(うそ)はあなたらしくないよ&lt;br /&gt; &lt;br /&gt; 目(め)を见(み)てこれからのことを话(は な)そう&lt;br /&gt; &lt;br /&gt; 私(わたし)覚悟(かくご)してる&lt;br /&gt; &lt;br /&gt; 暗(くら)い未来(みらい)だって&lt;br /&gt; &lt;br /&gt; 强(つよ)くなって运命(うんめい)変(か)え られるかもね&lt;br /&gt; &lt;br /&gt; my wish かなえたいのに&lt;br /&gt; &lt;br /&gt; すべてはGod knows...&lt;br /&gt; &lt;br /&gt; あなたがいて私(わたし)がいて&lt;br /&gt; &lt;br /&gt; ほかの人(ひと)は消(き)えてしまった&lt;br /&gt; &lt;br /&gt; 淡(あわ)い梦(ゆめ)の美(うつく)しさを描 (えが)きながら&lt;br /&gt; &lt;br /&gt; 伤迹(きずあと)なぞる&lt;br /&gt; &lt;br /&gt; だから私(わたし)ついていくよ&lt;br /&gt; &lt;br /&gt; どんな辛(つら)い世界(せかい)の闇(やみ) の中(なか)でさえ&lt;br /&gt; &lt;br /&gt; きっとあなたは辉(かがや)いて&lt;br /&gt; &lt;br /&gt; 超(こ)える未来(みらい)の果(は)て&lt;br /&gt; &lt;br /&gt; 弱(よわ)さ故(ゆえ)に魂(たましい)こわさ れぬように&lt;br /&gt; &lt;br /&gt; my way 重(かさ)なるよ&lt;br /&gt; &lt;br /&gt; いまふたりにGod bless...&lt;br /&gt; &lt;br /&gt; 中&amp;lt;strong&amp;gt;文歌词&amp;lt;/strong&amp;gt;:&lt;br /&gt; &lt;br /&gt; 怀着渴求的心飞奔而来&lt;br /&gt; &lt;br /&gt; 却什么也做不到&lt;br /&gt; &lt;br /&gt; 对不起就连与你一起分担痛楚&lt;br /&gt; &lt;br /&gt; 你也始终不愿容许&lt;br /&gt; &lt;br /&gt; 坚持纯粹人生从不回头&lt;br /&gt; &lt;br /&gt; 只留下背影&lt;br /&gt; &lt;br /&gt; 你渐渐离去&lt;br /&gt; &lt;br /&gt; 走在孤独的人生上&lt;br /&gt; &lt;br /&gt; 跟我一起走吧&lt;br /&gt; &lt;br /&gt; 无论世界多么艰辛多么黑暗&lt;br /&gt; &lt;br /&gt; 你一定会绽放光彩&lt;br /&gt; &lt;br /&gt; 跨越未来的尽头&lt;br /&gt; &lt;br /&gt; 不让灵魂因脆弱而受伤&lt;br /&gt; &lt;br /&gt; 跟上我的脚步&lt;br /&gt; &lt;br /&gt; 愿神保佑我们&lt;br /&gt; &lt;br /&gt; 炙热的思念历尽艰辛传递给你&lt;br /&gt; &lt;br /&gt; 却在现实中溶化&lt;br /&gt; &lt;br /&gt; 令我彷徨失措&lt;br /&gt; &lt;br /&gt; 渴望见到你的心情不需要理由&lt;br /&gt; &lt;br /&gt; 对你的爱意已经满溢心胸&lt;br /&gt; &lt;br /&gt; 至少要将那美丽的梦想&lt;br /&gt; &lt;br /&gt; 一面描绘一面不停追逐&lt;br /&gt; &lt;br /&gt; 为了你孤独的心灵&lt;br /&gt; &lt;br /&gt; 停止吧&lt;br /&gt; &lt;br /&gt; 谎言并不是你的风格&lt;br /&gt; &lt;br /&gt; 看着我来畅谈将来的人生吧&lt;br /&gt; &lt;br /&gt; 我已经做好了心理准备&lt;br /&gt; &lt;br /&gt; 即使未来一片黑暗&lt;br /&gt; &lt;br /&gt; 坚强的我们或许能够改变命运&lt;br /&gt; &lt;br /&gt; 渴望去实现我的心愿&lt;br /&gt; &lt;br /&gt; 一切却无人知晓&lt;br /&gt; &lt;br /&gt; 这个世界中&lt;br /&gt; &lt;br /&gt; 有我有你&lt;br /&gt; &lt;br /&gt; 其他人都已经消失不见&lt;br /&gt; &lt;br /&gt; 一边幻想着优美的梦想&lt;br /&gt; &lt;br /&gt; 一边细数着伤痕&lt;br /&gt; &lt;br /&gt; 所以&lt;br /&gt; &lt;br /&gt; 跟我一起走吧&lt;br /&gt; &lt;br /&gt; 无论世界多么艰辛多么黑暗&lt;br /&gt; &lt;br /&gt; 你一定会绽放光彩&lt;br /&gt; &lt;br /&gt; 跨越未来的尽头&lt;br /&gt; &lt;br /&gt; 不让灵魂因脆弱而受伤&lt;br /&gt; &lt;br /&gt; 跟上我的脚步&lt;br /&gt; &lt;br /&gt; 愿神保佑我们&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=107&quot; target=_blank&gt;God Knows&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3799675024850087185/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/god-knows.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3799675024850087185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3799675024850087185'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/god-knows.html' title='God Knows'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-2872142914454441092</id><published>2013-02-25T17:28:00.001+08:00</published><updated>2013-02-25T17:28:26.862+08:00</updated><title type='text'>安卓客户端文字图片</title><content type='html'>文字&lt;br /&gt; 图片&lt;br /&gt; &lt;br /&gt; &amp;lt;a href=&amp;quot;http://xmzhao.6te.net/wp-content/uploads/2013/02/wpid-original_LpWh_42ea000055a9125b11.jpg&amp;quot;&amp;gt;&amp;lt;img title=&amp;quot;original_LpWh_42ea000055a9125b.jpg&amp;quot; class=&amp;quot;alignnone size-full&amp;quot; alt=&amp;quot;image&amp;quot; src=&amp;quot;http://xmzhao.6te.net/wp-content/uploads/2013/02/wpid-original_LpWh_42ea000055a9125b10.jpg&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=105&quot; target=_blank&gt;安卓客户端文字图片&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/2872142914454441092/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_5001.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2872142914454441092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2872142914454441092'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_5001.html' title='安卓客户端文字图片'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3559575421793638742</id><published>2013-02-25T17:24:00.001+08:00</published><updated>2013-02-26T13:21:50.029+08:00</updated><title type='text'>wordpress 同步到blogger的问题</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
好像用wlw发带图片的文章到wordpress同步到blogger的时候就可以显示 图片，但是用手机发图片到wordpress的时候就会出问题，是因为上传图片的目录不同么？&lt;br /&gt;
&amp;lt;!--more--&amp;gt;&lt;br /&gt;
明天到学校再看看具体怎么回事&lt;br /&gt;
&lt;hr /&gt;
Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=102&quot; target=&quot;_blank&quot;&gt;wordpress 同步到blogger的问题&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3559575421793638742/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/wordpress-blogger.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3559575421793638742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3559575421793638742'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/wordpress-blogger.html' title='wordpress 同步到blogger的问题'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-7981310912699567330</id><published>2013-02-25T16:59:00.001+08:00</published><updated>2013-02-25T16:59:57.927+08:00</updated><title type='text'>测试</title><content type='html'>&amp;lt;a href=&amp;quot;http://xmzhao.6te.net/wp-content/uploads/2013/02/wpid-wp-13617827585181.jpg&amp;quot;&amp;gt;&amp;lt;img title=&amp;quot;wp-1361782758518.jpg&amp;quot; class=&amp;quot;alignnone size-full&amp;quot; alt=&amp;quot;image&amp;quot; src=&amp;quot;http://xmzhao.6te.net/wp-content/uploads/2013/02/wpid-wp-1361782758518.jpg&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=76&quot; target=_blank&gt;测试&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/7981310912699567330/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_7699.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7981310912699567330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7981310912699567330'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_7699.html' title='测试'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-2026115469400631879</id><published>2013-02-25T16:57:00.001+08:00</published><updated>2013-02-25T16:57:09.096+08:00</updated><title type='text'>测试拍照2</title><content type='html'>&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=73&quot; target=_blank&gt;测试拍照2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/2026115469400631879/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/2.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2026115469400631879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2026115469400631879'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/2.html' title='测试拍照2'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-7090291121375287807</id><published>2013-02-25T16:55:00.001+08:00</published><updated>2013-02-25T16:55:13.853+08:00</updated><title type='text'>测试拍照</title><content type='html'>&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=72&quot; target=_blank&gt;测试拍照&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/7090291121375287807/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_6555.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7090291121375287807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7090291121375287807'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_6555.html' title='测试拍照'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-895399819206825619</id><published>2013-02-25T16:54:00.001+08:00</published><updated>2013-02-25T16:54:26.371+08:00</updated><title type='text'>测试拍照</title><content type='html'>&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=71&quot; target=_blank&gt;测试拍照&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/895399819206825619/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_8057.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/895399819206825619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/895399819206825619'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_8057.html' title='测试拍照'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-953451186295487371</id><published>2013-02-25T15:58:00.001+08:00</published><updated>2013-02-25T16:03:17.932+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows live writer"/><category scheme="http://www.blogger.com/atom/ns#" term="插件"/><title type='text'>试试Windows live writer的一些插件</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;a href=&quot;http://xmzhao.6te.net/uploads/d1e2727420e0_DADC/writersplash_2.png&quot;&gt;&lt;img align=&quot;left&quot; alt=&quot;writersplash_2&quot; border=&quot;0&quot; height=&quot;398&quot; src=&quot;http://xmzhao.6te.net/uploads/d1e2727420e0_DADC/writersplash_2_thumb.png&quot; title=&quot;writersplash_2&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;今天测试一下Windows live writer 的几个好玩的插件，&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;以后应该会继续补充&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;1.Polaroid Picture&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:aee8428d-1701-49f2-9ff6-a6885e3fc683&quot; style=&quot;display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;a href=&quot;http://xmzhao.6te.net/uploads/d1e2727420e0_DADC/QQ20121231032953-8x6.jpg&quot; rel=&quot;thumbnail&quot; title=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;361&quot; src=&quot;http://xmzhao.6te.net/uploads/d1e2727420e0_DADC/QQ20121231032953.png&quot; width=&quot;580&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman; font-size: medium;&quot;&gt;2.Insert Code&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot; style=&quot;height: 20px; width: 100%;&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   1:  &lt;/span&gt;#include&amp;lt;iostream&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   2:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; std;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   3:  &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; main()&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   4:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;lnum&quot;&gt;   5:  &lt;/span&gt;cout&amp;lt;&amp;lt;&lt;span class=&quot;str&quot;&gt;&quot;hello world&quot;&lt;/span&gt;&amp;lt;&amp;lt;endl;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   6:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt; {&lt;br /&gt; 	font-size: small;&lt;br /&gt; 	color: black;&lt;br /&gt; 	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; 	background-color: #ffffff;&lt;br /&gt; 	/*white-space: pre;*/&lt;br /&gt; }&lt;br /&gt; .csharpcode pre { margin: 0em; }&lt;br /&gt; .csharpcode .rem { color: #008000; }&lt;br /&gt; .csharpcode .kwrd { color: #0000ff; }&lt;br /&gt; .csharpcode .str { color: #006080; }&lt;br /&gt; .csharpcode .op { color: #0000c0; }&lt;br /&gt; .csharpcode .preproc { color: #cc6633; }&lt;br /&gt; .csharpcode .asp { background-color: #ffff00; }&lt;br /&gt; .csharpcode .html { color: #800000; }&lt;br /&gt; .csharpcode .attr { color: #ff0000; }&lt;br /&gt; .csharpcode .alt &lt;br /&gt; {&lt;br /&gt; 	background-color: #f4f4f4;&lt;br /&gt; 	width: 100%;&lt;br /&gt; 	margin: 0em;&lt;br /&gt; }&lt;br /&gt; .csharpcode .lnum { color: #606060; }&lt;br /&gt; &lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
3.Insert File&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wlWriterEditableSmartContent&quot; id=&quot;scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:595a2717-1213-4afc-94e9-ef990fa320fc&quot; style=&quot;display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&amp;nbsp; &amp;nbsp;Picture &lt;a href=&quot;http://xmzhao.6te.net/uploads/d1e2727420e0_DADC/35_19500_28f68c7444f1b69.jpg&quot; target=&quot;_blank&quot;&gt;Test&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=65&quot; target=&quot;_blank&quot;&gt;试试Windows live writer的一些插件&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/953451186295487371/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/windows-live-writer.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/953451186295487371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/953451186295487371'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/windows-live-writer.html' title='试试Windows live writer的一些插件'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-4021272267073067470</id><published>2013-02-25T13:40:00.001+08:00</published><updated>2013-02-25T14:49:16.511+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="WordPress"/><category scheme="http://www.blogger.com/atom/ns#" term="同步"/><title type='text'>用wordpress同步更新blogger</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 使用Google提供的blogger做为日常的博客的，它可以像wordpress一样扩展，同时也比一般我们用户的wordpress更加稳定，因此成为了目前为数不多仍在写博客的同学的最佳选择之一。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDftq7MIJtL8ny-uL2lulkrJjVrXCcuIMAay-sNxUM58IWZCaSyXVp04DJGwDfCi4b4jGszB9GkhuuKWfpKwyYENgO6RVDTNK3RvU28eIoKu1cJ-dgFBHyQOKV3Eo4plIh09tN2PGVRw/s1600/wordpress.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDftq7MIJtL8ny-uL2lulkrJjVrXCcuIMAay-sNxUM58IWZCaSyXVp04DJGwDfCi4b4jGszB9GkhuuKWfpKwyYENgO6RVDTNK3RvU28eIoKu1cJ-dgFBHyQOKV3Eo4plIh09tN2PGVRw/s320/wordpress.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&amp;nbsp; &amp;nbsp; 但是由于中国政府和Google的关系一向不和，blogger使用了blogspot域，总是会被GFW毙掉，因此需要更新博客的话必须翻墙，又因为我个人比较懒，以及在网页上写博客的众多麻烦，比如保存比较困难、以及无法离线编辑博文的问题，总是想找一个可以线下编辑的博客软件，于是了解到了Windows live writer。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 如果直接使用Windows live writer 来编辑blogger又会因为GFW的问题而各种麻烦，想来想去，看到了网上的某位大神提供的一种方法:windows live wirter –&amp;gt; wordpress –&amp;gt; blogger，当然这个wordpress所在的服务器必须是境外的服务器，使用这样复杂的策略总算成功更新了blogger。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Windows live writer 连接wordpress的过程非常简单，这里不做介绍，现在将wordpress 同步到blogger 的过程的简单的配置过程说一下：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;blogger准备&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;br /&gt;&lt;br /&gt;在blogger的设置-&amp;gt; 移动设备和电子邮件之中，设置使用电子邮件发布的 secret word，这样我们就可以通过向这个地址发送邮件来更新blogger了，在下面的选项中可以选定对于电子邮件如何处理，是直接发布还是存为草稿。&lt;br /&gt;&lt;br /&gt;如下图：&lt;a href=&quot;http://xmzhao.6te.net/uploads/wordpressblogger_BA4E/QQ20130225132828.jpg&quot;&gt;&lt;img alt=&quot;QQ截图20130225132828&quot; border=&quot;0&quot; height=&quot;381&quot; src=&quot;http://xmzhao.6te.net/uploads/wordpressblogger_BA4E/QQ20130225132828_thumb.jpg&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;QQ截图20130225132828&quot; width=&quot;542&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;wordpress准备&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
需要安装一个&quot;DJ EmailPublish&quot;的插件，安装好后在 设置-&amp;gt; Email Publish 中可以设置邮件更新的方法，我们在email 地址栏输入我们在上一部分配置的邮件地址，publish type 选择full text，然后再SMTP部分将username 和password按照wordpress登录的用户名和密码输入即可，如下图&lt;br /&gt;&lt;a href=&quot;http://xmzhao.6te.net/uploads/wordpressblogger_BA4E/image.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;414&quot; src=&quot;http://xmzhao.6te.net/uploads/wordpressblogger_BA4E/image_thumb.png&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;544&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;点击&quot;update email publish options &quot;，大功告成&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;用你的Windows live writer 写一篇试试看吧~&lt;br /&gt;
&lt;hr /&gt;
Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=36&quot; target=&quot;_blank&quot;&gt;用wordpress同步更新blogger&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/4021272267073067470/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/wordpressblogger.html#comment-form' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/4021272267073067470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/4021272267073067470'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/wordpressblogger.html' title='用wordpress同步更新blogger'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDftq7MIJtL8ny-uL2lulkrJjVrXCcuIMAay-sNxUM58IWZCaSyXVp04DJGwDfCi4b4jGszB9GkhuuKWfpKwyYENgO6RVDTNK3RvU28eIoKu1cJ-dgFBHyQOKV3Eo4plIh09tN2PGVRw/s72-c/wordpress.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-1206925421121916517</id><published>2013-02-25T04:52:00.001+08:00</published><updated>2013-02-25T04:52:03.071+08:00</updated><title type='text'>测试同步功能</title><content type='html'>&lt;p&gt;Windows live writer –&amp;gt; wordpress –&amp;gt; blogger&lt;/p&gt;&lt;br /&gt;&lt;hr /&gt; Orignal From: &lt;a href=&quot;http://xmzhao.6te.net/?p=35&quot; target=_blank&gt;测试同步功能&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/1206925421121916517/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_4836.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/1206925421121916517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/1206925421121916517'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_4836.html' title='测试同步功能'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-8979718183324889538</id><published>2013-02-25T00:59:00.000+08:00</published><updated>2013-02-25T01:09:24.735+08:00</updated><title type='text'>要回学校了</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &amp;nbsp; 说起来这个假期过得真快，明天就要离家回学校了（别人都上课了你还不走还好意思说= =），感觉上了大学后假期一个比一个过得快。模模糊糊的记得大一的时候寒假做了好多好多事情，结果这个寒假似乎没有做什么事情就已经结束了。于是不禁唏嘘，时间过得真快。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 其实说起来感觉过得快的原因有很多，我总结了一下大致有以下几点：&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;每天晚睡玩起&lt;/li&gt;
这个寒假正常的睡眠时间是凌晨三点，正常的起床时间是中午11点，这样算下来的话，每天一起床就要吃饭，接下来就是下午上网吃饭，到了晚上就感觉一天过完了
&lt;li&gt;生活重复度太高&lt;/li&gt;
今年寒假每天的生活都差不多，没怎么逛亲戚，也没怎么看书，整天水人人以及看动漫，小说也没怎么看，就像那句话&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;你到底是活了365天，还是把一天重复了365遍&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;ul&gt;我觉得我应该是把一天活了365遍吧
&lt;li&gt;在回首看过去的时光的时候，总是觉得过得特别快&lt;/li&gt;
就像我们回首看我们逝去的二十多年光阴一样，我们站在时光的铁轨旁，时光像火车一样轰鸣着朝我们涌来，又不夹杂着一丝留恋的离我们而去。&lt;/ul&gt;
&lt;ul&gt;&lt;/ul&gt;
&amp;nbsp; &amp;nbsp; 假期看到了很多小学同学，他们大多早已经工作了很久，大家见面聊的都是工作如何，对象如何，领导如何，何时结婚，何时生小孩。等回到家看着桌子上玻璃板下面铺着的小学同学合照，照片里的大家笑的天真的样子，时间过得这么快。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/8979718183324889538/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_25.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/8979718183324889538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/8979718183324889538'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post_25.html' title='要回学校了'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>中国陕西省延安市延长县</georss:featurename><georss:point>36.579313 110.01233400000001</georss:point><georss:box>35.762712 108.72144050000001 37.395914 111.3032275</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3741313431605882158</id><published>2013-02-25T00:06:00.000+08:00</published><updated>2013-02-25T00:07:47.517+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SAI"/><category scheme="http://www.blogger.com/atom/ns#" term="动漫"/><category scheme="http://www.blogger.com/atom/ns#" term="手绘"/><title type='text'>我的SAI</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhUWp_VKU5k9Yy2-uE-wPllmG8rUf4yG9lQsJmd1xoDkDMolEtRFyrEKi_A0es2_zUpPStLeRNkGfaDZAltpjvWHyD84f5wVD2WDSfEe_6-97UEpdx-UopYl0i6wY3-LO2P8V2aYZ87w/s1600/33.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhUWp_VKU5k9Yy2-uE-wPllmG8rUf4yG9lQsJmd1xoDkDMolEtRFyrEKi_A0es2_zUpPStLeRNkGfaDZAltpjvWHyD84f5wVD2WDSfEe_6-97UEpdx-UopYl0i6wY3-LO2P8V2aYZ87w/s640/33.jpg&quot; width=&quot;436&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;第一次使用Sai鼠绘，那会儿没有数位板，还是在考试前的一段时间，&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidVH3z-zW44aXXniqfhJoiau7Hd2wvuL7DaTZ7g19bul6EFtXifSioKaA5dGCS14Bw7Ud-7Xs0Fq8azKXowrPV7hE2Ql5gXseS2jpyloYAW4gaf9O-vkgha6g61ZfnqUU4Z86R8U582A/s1600/01000000000000119087489731160.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidVH3z-zW44aXXniqfhJoiau7Hd2wvuL7DaTZ7g19bul6EFtXifSioKaA5dGCS14Bw7Ud-7Xs0Fq8azKXowrPV7hE2Ql5gXseS2jpyloYAW4gaf9O-vkgha6g61ZfnqUU4Z86R8U582A/s640/01000000000000119087489731160.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7zGfxrsQw5OEly0uzRRwM1waJsINLJyb9nb0y9Y2hNvWy6HfmvY9adG0ycj4BYns0suIj2T67PROUgbL8_WD0TQW86omWa53Dbfk9FOVUqVAt0GLH65rxw1uC5vZgEJtbnbPbNsvTqQ/s1600/original_cbWR_02320000150e125b.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7zGfxrsQw5OEly0uzRRwM1waJsINLJyb9nb0y9Y2hNvWy6HfmvY9adG0ycj4BYns0suIj2T67PROUgbL8_WD0TQW86omWa53Dbfk9FOVUqVAt0GLH65rxw1uC5vZgEJtbnbPbNsvTqQ/s640/original_cbWR_02320000150e125b.jpg&quot; width=&quot;522&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmRdPwqPHVlreAUVuqRY4mpALVidUzB8bSKM2ZEY15qebNxuVZuMIaMcF-LHLuqc8bc9IvikNBlHe0eIsceKQpjEbuOopLtlTqoyUB_oR18AUrKCOZHv56yY0hd86jxmmcJhCcQHbFfg/s1600/psycho-pass.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;614&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmRdPwqPHVlreAUVuqRY4mpALVidUzB8bSKM2ZEY15qebNxuVZuMIaMcF-LHLuqc8bc9IvikNBlHe0eIsceKQpjEbuOopLtlTqoyUB_oR18AUrKCOZHv56yY0hd86jxmmcJhCcQHbFfg/s640/psycho-pass.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ3PlreaxgNQ9iCP-em8_qJUOB3T8Sv5FBjVKVlPFQRcnxVl4NnuoZ66QmNkbwkmRihMBm33DvV6eq6cergQtEcp101R7LJ7hYNaz1Ns7d473zGYQXlQkaz0wwCx4w4gPCiIMsP5NGeg/s1600/%25E5%2587%258C%25E6%25B3%25A2%25E4%25B8%25BD.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;497&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ3PlreaxgNQ9iCP-em8_qJUOB3T8Sv5FBjVKVlPFQRcnxVl4NnuoZ66QmNkbwkmRihMBm33DvV6eq6cergQtEcp101R7LJ7hYNaz1Ns7d473zGYQXlQkaz0wwCx4w4gPCiIMsP5NGeg/s640/%25E5%2587%258C%25E6%25B3%25A2%25E4%25B8%25BD.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijrzlws_c8OMTXzXSk3JxYvdhJUJONlAbgvl92BRF_zQD7ZvEVwf6VdIfqOumzZAa7bYptvpaQjbAz6xdDP4cU7_PjMZ4alNFnqm2Mr1NuRyJh-SgNDdlzzLSZG0w3M9DmExXYkBhwqg/s1600/%25E5%25BF%258D%25E9%2587%258E%25E5%25BF%258D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijrzlws_c8OMTXzXSk3JxYvdhJUJONlAbgvl92BRF_zQD7ZvEVwf6VdIfqOumzZAa7bYptvpaQjbAz6xdDP4cU7_PjMZ4alNFnqm2Mr1NuRyJh-SgNDdlzzLSZG0w3M9DmExXYkBhwqg/s640/%25E5%25BF%258D%25E9%2587%258E%25E5%25BF%258D.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeM26lgpqdeggPOZaJbQhxG6oeNneEZ4oqo5aHJg0CIc5O-OI0jCYLNWwcFDmggkNbYaSunDKI9denms3wgQLqdEJrfQqmE2gX-khyphenhyphen_SfPEoeqQTxLDOCzKFj_YUywVFt7csPZK0-2CQ/s1600/6a600c338744ebf8318a7178d9f9d72a6159a7f9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeM26lgpqdeggPOZaJbQhxG6oeNneEZ4oqo5aHJg0CIc5O-OI0jCYLNWwcFDmggkNbYaSunDKI9denms3wgQLqdEJrfQqmE2gX-khyphenhyphen_SfPEoeqQTxLDOCzKFj_YUywVFt7csPZK0-2CQ/s640/6a600c338744ebf8318a7178d9f9d72a6159a7f9.jpg&quot; width=&quot;594&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_gMJ3xzhWOMyQsWdFrRMk4OzZLCKLeTTZIqYG4uDWaqO2u4srmrSL4YpKLt223DZ_6dyQHxCMFxR09wykxHqJ0Yc9YJ9PU6zZVV1sjbb65O-K7kpUeBlffcpgwFd7qko1l3PDANhHNg/s1600/large_10bZ_19dc00000ac5118f.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_gMJ3xzhWOMyQsWdFrRMk4OzZLCKLeTTZIqYG4uDWaqO2u4srmrSL4YpKLt223DZ_6dyQHxCMFxR09wykxHqJ0Yc9YJ9PU6zZVV1sjbb65O-K7kpUeBlffcpgwFd7qko1l3PDANhHNg/s640/large_10bZ_19dc00000ac5118f.jpg&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3741313431605882158/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/sai.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3741313431605882158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3741313431605882158'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/sai.html' title='我的SAI'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhUWp_VKU5k9Yy2-uE-wPllmG8rUf4yG9lQsJmd1xoDkDMolEtRFyrEKi_A0es2_zUpPStLeRNkGfaDZAltpjvWHyD84f5wVD2WDSfEe_6-97UEpdx-UopYl0i6wY3-LO2P8V2aYZ87w/s72-c/33.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>中国陕西省延安市延长县</georss:featurename><georss:point>36.579313 110.01233400000001</georss:point><georss:box>36.579313 110.01233400000001 36.579313 110.01233400000001</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-6730851419004619756</id><published>2013-02-24T19:57:00.001+08:00</published><updated>2013-02-24T23:41:56.995+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="Google"/><title type='text'>Blogger今天更新几个重要功能_Google / 谷歌_cnBeta.COM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixCyx_RuyJ5CDL8QcNEgIU96Fp63F7EjhV4b-2sGibPDHJwngRMOz5gnJozCosoEBXdDIlxSyBwj66oxqlEJtb8RGHzp6GbTOKt0V-JdE1BAdxCAasF_HKHXoPmrECu3_A0T5Dy7RF4g/s1600/2wqsnm1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixCyx_RuyJ5CDL8QcNEgIU96Fp63F7EjhV4b-2sGibPDHJwngRMOz5gnJozCosoEBXdDIlxSyBwj66oxqlEJtb8RGHzp6GbTOKt0V-JdE1BAdxCAasF_HKHXoPmrECu3_A0T5Dy7RF4g/s320/2wqsnm1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.cnbeta.com/articles/59124.htm&quot;&gt;Blogger今天更新几个重要功能_Google / 谷歌_cnBeta.COM&lt;/a&gt;: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://chrome.google.com/webstore/detail/pengoopmcjnbflcjbmoeodbmoflcgjlk&quot; style=&quot;font-size: 13px;&quot;&gt;&#39;via Blog this&#39;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/6730851419004619756/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/bloggergoogle-cnbetacom.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6730851419004619756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6730851419004619756'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/bloggergoogle-cnbetacom.html' title='Blogger今天更新几个重要功能_Google / 谷歌_cnBeta.COM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixCyx_RuyJ5CDL8QcNEgIU96Fp63F7EjhV4b-2sGibPDHJwngRMOz5gnJozCosoEBXdDIlxSyBwj66oxqlEJtb8RGHzp6GbTOKt0V-JdE1BAdxCAasF_HKHXoPmrECu3_A0T5Dy7RF4g/s72-c/2wqsnm1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-6798165090855157968</id><published>2013-02-24T18:27:00.001+08:00</published><updated>2013-02-24T18:27:23.573+08:00</updated><title type='text'>用Zoundry Raven写博客</title><content type='html'>&lt;p&gt;Zoundry 是Zoundry Blog Writer，Zoundry 网志编辑器是一款全功能的编辑器，支持富文本，适合本地写博客发布到网上。&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Zoundry Raven是Zoundry 最近推出的新软件，比过去的Zoundry有了很多改版。&lt;br /&gt;&lt;br/&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/6798165090855157968/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/zoundry-raven.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6798165090855157968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6798165090855157968'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/zoundry-raven.html' title='用Zoundry Raven写博客'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-359174170701486357</id><published>2013-02-24T04:19:00.000+08:00</published><updated>2013-02-25T00:26:55.449+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HACK"/><category scheme="http://www.blogger.com/atom/ns#" term="Renren"/><category scheme="http://www.blogger.com/atom/ns#" term="XSS"/><title type='text'>对昨晚人人日志xss一点分析</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWrIfdKO4-tD11snH-D5tBBeTEYdPzoDBG-impJp6jgYIkNw6fktN3WUTBWy5leF2qQNZGy1I6LpAuWdpwyWpYZ1Tk_pnc1zgjA8dqUzLB9d7DT64Xfux0kbPJ35O3EcGX1DDJNya0ug/s1600/xss-threat3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWrIfdKO4-tD11snH-D5tBBeTEYdPzoDBG-impJp6jgYIkNw6fktN3WUTBWy5leF2qQNZGy1I6LpAuWdpwyWpYZ1Tk_pnc1zgjA8dqUzLB9d7DT64Xfux0kbPJ35O3EcGX1DDJNya0ug/s1600/xss-threat3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.8em;&quot;&gt;
特别鸣谢： @&lt;a href=&quot;http://www.renren.com/328748051/profile&quot;&gt;王大鹏.py&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.8em;&quot;&gt;
目前还幸存的日志（点击请慎重）：&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0.8em;&quot;&gt;
&lt;div style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
&lt;a href=&quot;http://blog.renren.com/share/415267397/15370669565&quot;&gt;http://blog.renren.com/share/415267397/15370669565&lt;/a&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;特别声明&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
请慎重模仿。。。。
&lt;li&gt;&lt;span style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 21px;&quot;&gt;攻击流程&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;引入js&lt;/span&gt;&lt;/li&gt;
首先查看攻击者发的&lt;a href=&quot;http://blog.renren.com/share/415267397/15370669565&quot; target=&quot;_blank&quot;&gt;日志&lt;/a&gt;，我们在日志内容部分可以看到一段代码(eval...)，这段代码在onload的时候被执行（关于这段代码是如何被添加进来的,以及本来应该被禁止的onload是如何被添加进来的，据大鹏大神的猜测是因为日志最近的跟插入视频有关的一些改版造成的一个漏洞。貌似就是视频的一些信息被存在了一个img标签上，然后这个img标签被攻击者改了，加了onload执行js了，应该是在编辑日志的时候用审查元素之类的手动修改内容，总之绕过了对onload的检查，具体的可以去那篇幸存的日志下面问是如何发出来的，应该不难）&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjh2F3VH67y0JBeNs0m5P7gLrMR0AQ5qv7AFYABy3FtsiaXP2hrN2XCAKuWuuqQTDJjquF1287w_zmBE0nEQHb36KWrq4RQ0wI0tu3Tn8To6Eq_TMk3YYUdUoq3AVSfo5mAxVN6ZqQQg/s1600/QQ%E6%88%AA%E5%9B%BE20130224034141.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjh2F3VH67y0JBeNs0m5P7gLrMR0AQ5qv7AFYABy3FtsiaXP2hrN2XCAKuWuuqQTDJjquF1287w_zmBE0nEQHb36KWrq4RQ0wI0tu3Tn8To6Eq_TMk3YYUdUoq3AVSfo5mAxVN6ZqQQg/s640/QQ%E6%88%AA%E5%9B%BE20130224034141.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;我们可以看到一段eval的代码，是加密为了防止被人人屏蔽掉的，对其中&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG_ZtUvwoUIO1rnnNPMhKLE98TNXk4kC8aRIOmvwgqwD1GqnmAnwJAigAZ_efWp-Fr2ysgoPsgcmglibK-fvC_oph5yRCviG3HTfKe64XiP_f7ous0BD33dVFQkZao-GI0i55fWHT1fA/s1600/QQ%E6%88%AA%E5%9B%BE20130224041254.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG_ZtUvwoUIO1rnnNPMhKLE98TNXk4kC8aRIOmvwgqwD1GqnmAnwJAigAZ_efWp-Fr2ysgoPsgcmglibK-fvC_oph5yRCviG3HTfKe64XiP_f7ous0BD33dVFQkZao-GI0i55fWHT1fA/s640/QQ%E6%88%AA%E5%9B%BE20130224041254.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;这段 进行解码后发现是如下代码：&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrXw10Oi6I4oGrCxLxTyVrYJhd7a0S9-t-bevrUyJMFXFv8-VooICEa3aWZl8UhaTD7YGu6Yyz-3vXpNpG-H38sqFCjYeQyYRwI1oSH6t4mrdg39CLKgLbaYvDHnRNty16O_ptHMQGQ/s1600/QQ%E6%88%AA%E5%9B%BE20130224034716.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlrXw10Oi6I4oGrCxLxTyVrYJhd7a0S9-t-bevrUyJMFXFv8-VooICEa3aWZl8UhaTD7YGu6Yyz-3vXpNpG-H38sqFCjYeQyYRwI1oSH6t4mrdg39CLKgLbaYvDHnRNty16O_ptHMQGQ/s640/QQ%E6%88%AA%E5%9B%BE20130224034716.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;这段代码的作用是在页面中增加一个script 标签，从而引入一个文件，这个文件的地址是http://t.cn/zYKFUUl，我们去直接看这个地址会发现这个文件是一个gif文件，具体这个文件是如何执行的，会在下一部分中说明。
&lt;li&gt;&lt;span style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;利用js脚本发日志&lt;/span&gt;&lt;/li&gt;
我们看到上一部分中引入了一个文件（http://t.cn/zYKFUUl），打开一看却是一个gif文件，用文本打开发现了这个文件的末尾部分加了一段代码如下图（全部代码参看 https://gist.github.com/wong2/5019880）:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbJVfCWBqhXufQJYP46NAx1yEorBg1VTZWNbslwfVRttpAxI09rYzMOMCxybzLcu2gqgCjNofZUo2MiDayTrC3GQjE34ZPzYl9ohaKkMycA_YdLT85E_UvwIpyl91uhULqMLe7hkT8ew/s1600/QQ%E6%88%AA%E5%9B%BE20130224035945.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbJVfCWBqhXufQJYP46NAx1yEorBg1VTZWNbslwfVRttpAxI09rYzMOMCxybzLcu2gqgCjNofZUo2MiDayTrC3GQjE34ZPzYl9ohaKkMycA_YdLT85E_UvwIpyl91uhULqMLe7hkT8ew/s640/QQ%E6%88%AA%E5%9B%BE20130224035945.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;这个代码的作用有以下三点&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;记录cookie&lt;/li&gt;
&lt;li&gt;从get.php中获取需要发布的日志内容（因此这次xss每次文章都不一样）&lt;/li&gt;
&lt;li&gt;发布日志（发布 的日志中只要有第一部分的那部分脚本就可以继续传播）&lt;/li&gt;
&lt;/ul&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.8em;&quot;&gt;
这几部分都可以从代码中看到&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 0.8em;&quot;&gt;
大致的过程应该就这样吧。。。。。&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/359174170701486357/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/xss.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/359174170701486357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/359174170701486357'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/xss.html' title='对昨晚人人日志xss一点分析'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWrIfdKO4-tD11snH-D5tBBeTEYdPzoDBG-impJp6jgYIkNw6fktN3WUTBWy5leF2qQNZGy1I6LpAuWdpwyWpYZ1Tk_pnc1zgjA8dqUzLB9d7DT64Xfux0kbPJ35O3EcGX1DDJNya0ug/s72-c/xss-threat3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-7483775801231145328</id><published>2013-02-10T18:11:00.001+08:00</published><updated>2013-02-10T18:12:11.879+08:00</updated><title type='text'>几个黑客小游戏</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;不知道是不是很多人像我一样，很喜欢这类黑客解谜游戏，感觉很锻炼脑子，当时黑客防线推出那款黑客游戏，有一关，我想了足足8个小时，也不觉得累。后来华夏等网站相继推出黑客游戏，我是乐此不疲。在网上也找了很多国外的黑客游戏。这里是我收集的一些黑客游戏，有网页版的，有客户端版的。对于黑客游戏，不仅仅是锻炼自己的推理能力，而且还能让自己的思维更加活泼。不过电脑小白就不要玩了。。。。。。。很可能想爆了脑袋也过不去一关。这里需要很多的知识，Java, PHP, HTML, Javascript等网页语言，另外有的游戏还需要了解程序的加壳脱壳，加密与解谜，精通各种操作系统，游戏很多，大家自己随意玩吧。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Monyer系列（黑客游戏）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://monyer.com/game/game1/&quot;&gt;http://monyer.com/game/game1/&lt;/a&gt; （中文）&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://xmzhao.blogspot.com/2013/02/monyer.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;游戏攻略&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://monyer.com/game/game2/&quot;&gt;http://monyer.com/game/game2/&lt;/a&gt; （英文）&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Sunnyspeed系列（英文）- 解谜类&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://sunnyspeed.com/puzzle/&quot;&gt;http://sunnyspeed.com/puzzle/&lt;/a&gt; （英文）&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://sunnyspeed.com/secret/&quot;&gt;http://sunnyspeed.com/secret/&lt;/a&gt; （英文）&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://sunnyspeed.com/crazy/&quot;&gt;http://sunnyspeed.com/crazy/&lt;/a&gt; （英文）&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Hack Forever（英文）- 实战攻防类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.hackerforever.com/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.hackerforever.com&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Hacker Funny Game（英文） – 模拟实战攻防类 （FLASH GAME）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.funnygames.co.nz/play/hacker&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.funnygames.co.nz/play/hacker&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Hacker Skills（英文） – 网页过关类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.hackerskills.com/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.hackerskills.com/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Uplink （英文） – 模拟 Linux 攻防 （需下载游戏）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.introversion.co.uk/uplink/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.introversion.co.uk/uplink/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;UPLINK 是一款基于Linux平台的黑客模拟游戏．玩家在其中扮演一位神通广大的黑客为ＵＰＬＩＮＫ公司工作，窃取各大公司的数据库机密资料． 深受广大游戏玩家的喜爱. 游戏里不需要你懂得太多的专业知识,反而会教你许多东西,只要你英语过得去.你是作为UPLINK的一个黑客,注册了以后你会得到一笔初始的资金和初始的软 硬件.如果你熟悉黑客的知识,你可以自己去做,如果不会的话,会有一个教学模式一步一步的教你,我这个菜鸟也看得懂要做什么.然后你的等级会上升,你就可 以正式在UPLINK的SERVER上联系客户,接取工作,完成工作就会获得回报(当然是钱啦)等级越高,任务的难度就会越高.在SERVER里,你还可 以买到更厉害的软件和硬件,让你容易完成任务。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;51CTO – 黑客游戏系列 （中文） – 实战攻防类&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;第一季【原创：黑客游戏Ⅰ】危险的telnet（&lt;a href=&quot;http://bbs.51cto.com/thread-659015-1.html&quot;&gt;http://bbs.51cto.com/thread-659015-1.html&lt;/a&gt;）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;第二季【原创：黑客游戏Ⅱ】致命的SA权限（&lt;a href=&quot;http://bbs.51cto.com/thread-659512-1.html&quot;&gt;http://bbs.51cto.com/thread-659512-1.html&lt;/a&gt;）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;第三季【原创：黑客游戏Ⅲ】神秘的远程桌面端口（http://bbs.51cto.com/thread-659854-1.html）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;MOX-X （英文）- 综合类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mod-x.co.uk/main.php&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.mod-x.co.uk/main.php&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Hacker Evolution （英文） – 模拟攻防类 （需下载游戏）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.hackerevolution.org/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.hackerevolution.org/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;路路解密破解游戏（中文）- 综合类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.666666666666.com/Index.Asp&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.666666666666.com/Index.Asp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Arthur’s Online Riddle（中文）- 网页过关类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://riddle.arthurluk.net/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://riddle.arthurluk.net/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Level Game （英文） 趣味过关游戏 （FLASHGAME）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.levelgame.net/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.levelgame.net/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;sqybi 的解谜游戏 （中文）- 网页过关类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://sqybi.com/game/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://sqybi.com/game/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;NotPron （中英文） – 解密类游戏 （这个游戏是我的最爱）&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;中文版: &lt;a href=&quot;http://deathball.net/notpron/china/notpron.htm&quot;&gt;http://deathball.net/notpron/china/notpron.htm&lt;/a&gt; 目前只有8关而已&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;英文版: &lt;a href=&quot;http://deathball.net/notpron/levelone.htm&quot;&gt;http://deathball.net/notpron/levelone.htm&lt;/a&gt; 有132关,全球只有82人通关咯&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;有道谜题（中文）- 推理游戏 – FLASHGAME&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.youdao.com/nanti/mi2010/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.youdao.com/nanti/mi2010/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;『中安网培』黑客游戏 （中文）- 网页过关类（貌似最后几关坏掉了）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://game.enet.org.cn/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://game.enet.org.cn/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Hack The Game（英文）- 模拟攻防类 （需下载游戏）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://chaozz.deepunder.dk/index.php?dir=released/hackthegame/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://chaozz.deepunder.dk/index.php?dir=released/hackthegame/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;游戏中玩家扮演黑客，完成各种入系统入侵任务，之后会有酬金和提升名气。目前网络上各种真伪日益盛行，有兴趣的朋友可以亲身体验一下，过一回当黑客的瘾哟&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;黑客榜中榜（中文） – 网页过关类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cn-hack.cn/qs/5.htm&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.cn-hack.cn/qs/5.htm&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;PCSEC’Game（中文） – 网页过关类&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.pcsec.org/game/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.pcsec.org/game/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;黑客游戏（英文）&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.chaozz.nl/?downloadid=20&amp;amp;type=ziponly&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://www.chaozz.nl/?downloadid=20&amp;amp;type=ziponly&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;国外黑客游戏集锦&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://hackergames.net/&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;http://hackergames.net/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;以后会写一些游戏破关的思路，另外如果有其他黑客游戏地址的朋友，麻烦请通知我，我会加到列表里的。&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/7483775801231145328/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post.html#comment-form' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7483775801231145328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/7483775801231145328'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/blog-post.html' title='几个黑客小游戏'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-6103931788368047387</id><published>2013-02-10T17:23:00.002+08:00</published><updated>2013-02-10T17:23:28.293+08:00</updated><title type='text'>解决 GoAgent 证书无效警告</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1377224785365482&quot;;
/* adsense */
google_ad_slot = &quot;8909065052&quot;;
google_ad_width = 728;
google_ad_height = 90;
//&lt;/script&gt;
--&amp;gt;解决 GoAgent 证书无效警告&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
发表于 2011 年 10 月 27 日&lt;br /&gt;
GoAgent 是我当前首选的代理工具，除了稳定的速度，最给力的就是能在教育网实现穿墙。如果要说有什么不足的话，就是一个月一天只有1G的流量（每个GAE帐号），不嫌麻烦的话可以多申请几个，每个gmail帐户可以免费开通10个Application。&lt;br /&gt;
&lt;br /&gt;
GoAgent 项目主页&lt;br /&gt;
http://code.google.com/p/goagent/&lt;br /&gt;
Goagent 是一个使用 Python 和 Google Appengine SDK 编写的代理软件，可以运行在Windows/Mac/Linux/Andorid/iTouch/iPhone/iPad上。&lt;br /&gt;
&lt;br /&gt;
GoAgent 的配置方法很简单，需要拥有一个 Google 帐号，然后申请一个 GAE 空间，第一次申请 GAE 空间时需要用手机接收短信验证码。具体的操作可以参考 GoAgent 项目主页。&lt;br /&gt;
&lt;br /&gt;
如果你在使用 GoAgent 时遇到证书无效问题，请按以下方法解决：&lt;br /&gt;
&lt;br /&gt;
这里以Chrome浏览器为例，理论上只要证书正确导入系统，就可以了。&lt;br /&gt;
&lt;br /&gt;
Ubuntu 系统：&lt;br /&gt;
&lt;br /&gt;
打开 Chrome 浏览器&lt;br /&gt;
首选项 &amp;gt; 高级选项 &amp;gt; 管理证书…&lt;br /&gt;
在 授权中心 导入 GoAgent/local 目录下的 CA.crt 证书&lt;br /&gt;
（注意不要导入到 服务器 ，否则不起作用）&lt;br /&gt;
在 授权中心 找到 GoAgent CA 并点击 修改…&lt;br /&gt;
修改信任设置为全部选中&lt;br /&gt;
重启浏览器&lt;br /&gt;
Windows 系统：&lt;br /&gt;
&lt;br /&gt;
打开 Chrome 浏览器&lt;br /&gt;
选项 &amp;gt; 高级选项 &amp;gt; 管理证书…&lt;br /&gt;
导入证书 &amp;gt; 下一步 &amp;gt; 选择 GoAgent/local 目录下的 CA.crt 证书 &amp;gt; 下一步 &amp;gt; 选择 证书存储：浏览… &amp;gt; 受信任的根证书颁发机构 &amp;gt; 下一步 … &amp;gt; 完成&lt;br /&gt;
重启浏览器&lt;br /&gt;
MAC 系统：&lt;br /&gt;
&lt;br /&gt;
双击 GoAgent/local 目录下的 CA.crt 证书导入到系统&lt;br /&gt;
在 Launchpad &amp;gt; 实用工具 &amp;gt; 钥匙串访问 &amp;gt; 系统 中找到 GoAgent CA 并双击&lt;br /&gt;
选择 信任 &amp;gt; 使用此证书时 &amp;gt; 总是信任&lt;br /&gt;
重启浏览器&lt;br /&gt;
然后，恭喜你，自由了！F＊GFW&lt;br /&gt;
2012/06/17 UPDATE：Windows 平台下大多情况其实是因为360或其它安全工具阻止了 goagent 自带的证书管理工具——certmgr.exe的运行，所以导致原本随goagent启动的证书导入过程失败而出现这个问题。这种情况只要把360黑名单中的certmgr.exe添加到白名单即可。&lt;br /&gt;
2012/09/11 UPDATE: 经过观察，还发现360之流会通过修改系统时间使证书失效，网页中提示证书过期多数是这种情况。这时候只需要将系统时间修改至当然时间即可。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/6103931788368047387/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/goagent.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6103931788368047387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6103931788368047387'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/goagent.html' title='解决 GoAgent 证书无效警告'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-2883643922361127997</id><published>2013-02-10T17:17:00.000+08:00</published><updated>2013-02-10T17:17:27.336+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="游戏"/><category scheme="http://www.blogger.com/atom/ns#" term="黑客"/><title type='text'>Monyer网页闯关游戏攻略</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px;&quot;&gt;最近遇到了好多网页闯关游戏。&lt;/span&gt;&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
比如有名的&lt;a href=&quot;http://www.pythonchallenge.com/&quot; style=&quot;color: #2970a6; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;pythonchallenge&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
再比如&amp;nbsp;&lt;a href=&quot;http://riddle.arthurluk.net/&quot; style=&quot;color: #2970a6; text-decoration: none;&quot;&gt;http://riddle.arthurluk.net/&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
今晚做了 &amp;nbsp;&lt;a href=&quot;http://monyer.com/game/game1/&quot; style=&quot;color: #2970a6; text-decoration: none;&quot;&gt;http://monyer.com/game/game1/&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
虽然只有15关，但感觉非常好，&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;strong&gt;强烈推荐&lt;/strong&gt;&lt;/span&gt;！&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
它让我学到了javascript的一些知识，还有基本的cookies、session、sql注入等知识，很有趣！&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
我花了几个小时，在参考答案的帮助下通关啦！&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
下面是我的通关攻略，不过我觉得首页上那个官方的攻略写的非常详细，比我的要好很多&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Verdana, &#39;BitStream vera Sans&#39;, Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;span id=&quot;more-65&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #f4f5f7; background-image: url(http://lmm333.sinaapp.com/wp-content/themes/inove/img/blockquote.gif); background-position: 3px 3px; background-repeat: no-repeat no-repeat; border: 1px dashed rgb(204, 204, 204); color: #555555; font-size: 12px; line-height: 17px; margin-bottom: 5px; margin-top: 5px; padding: 8px 12px 8px 36px;&quot;&gt;0-1 查看源码，直接点击链接

1-2 查看源码，在框里输入两个空格点提交，或者直接打hello.php

2-3 用chrome f12 里面的console直接运行一下代码，知道a=424178
或者直接在地址栏输入javascript:alert(a)，因为a的结果已经在页面加载的时候计算过了

3-4 运行下js知道密码是d4g

4-5 有个重定向，所以直接查源码：
view-source:http://monyer.com/game/game1/d4g.php

运行上面一段代码是&quot;3bhe&quot;
运行下面一段代码是&quot;a=a.toUpperCase()+1;&quot;
答案是

http://monyer.com/game/game1/3BHE1.php

5-6 这一关没做出来，答案是http://monyer.com/game/game1/seventeen7.php

6-7 很多网站md5逆向竟然要收费，哎，答案是

http://monyer.com/game/game1/eighteen8.php

7-8 注意这个not found 和出错是不同的哦

8-9 这个写个暴力程序毫无压力

9-10 盯着美女看了好久，试了几种都失败了，看答案，原来是下载图片改成txt再拖到最下面哈 http://monyer.com/game/game1/MonyerLikeYou_the10level.php

10-11 最好的办法是先运行
javascript:alert(document.cookie=&quot;username=admin&quot;)
然后刷新就行啦

http://monyer.com/game/game1/doyouknow.php

11-12直接改url

http://monyer.com/game/game1/doyouknow.php?action=show_login_true

12-13 百度搜base64解密，然后联系解密两次就行啦，出现%xx那些东西用谷歌随便搜个中午，然后把地址栏里面%xx改成搜到的，就知道字符是什么了，连续2次，答案是：

http://monyer.com/game/game1/sobeautiful.php

然后发现盗链了，说明直接输入地址的报文里来源是空的，要求从本站来
比较麻烦的办法是用socket伪造请求报文
比较好的办法是利用前面一个以免会把请求的代码输出，于是构造
&amp;lt;a href=sobeautiful.php&amp;gt;haha&amp;lt;/a&amp;gt;
点击提交，就出现过关链接啦！

13-14 看了源码，把数据库链接都告诉你了，显然是sql注入题哈！
文本框输入&#39;or&#39;&#39;=&#39;
sql变成select password,pwd from [user] where pwd=&#39;&#39;or&#39;&#39;=&#39;&#39;
原有&#39;&#39;之间增加了&#39;&#39;=&#39;&#39;的恒真式，哈哈！
答案：http://monyer.com/game/game1/whatyouneverknow.php

14-15 这个不会，直接看答案了：
ipasscrackme.php
想加入过关名单，必须通过cookies 和session两关，如果没记录的话，过去重打一下，不麻烦

ps:
我的好友techird发现：
第七关不是有图片吗，我看图片路径是img/tupian1.jpg，然后猜想密码可能是img/tupian17.jpg，然后发现不是，我就直接访问img目录，竟然可以看到所有文件……
然后就全破了&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/2883643922361127997/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2013/02/monyer.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2883643922361127997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/2883643922361127997'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2013/02/monyer.html' title='Monyer网页闯关游戏攻略'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-6631353136863235243</id><published>2012-10-06T00:53:00.003+08:00</published><updated>2012-10-06T00:53:36.508+08:00</updated><title type='text'>linux磁盘分区详解</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1377224785365482&quot;;
/* adsense */
google_ad_slot = &quot;8909065052&quot;;
google_ad_width = 728;
google_ad_height = 90;
//&lt;/script&gt;
--&amp;gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;在学习&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;的过程中，安装&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;是每一个初学者的第一个门槛。在这个过程中间，最大的困惑莫过于给硬盘进行分区。虽然，现在各种发行版本的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;已经提供了友好的图形交互界面，但是很多的人还是感觉无从下手。这其中的原因主要是不清楚&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;的分区规定，以及它下面最有效的分区工具&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;― Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: 宋体; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;的使用方法。&lt;/span&gt;&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;首先我们要对硬盘分区的基本概念进行一些初步的了解，硬盘的分区主要分为&lt;span style=&quot;color: red;&quot;&gt;基本分区&lt;/span&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;primary partion&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）和&lt;span style=&quot;color: red;&quot;&gt;扩充分区&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;(extension partion)&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;两种，基本分区和扩充分区的数目之和不能大于四个。且基本分区可以马上被使用但不能再分区。扩充分区必须再进行分区后才能使用，也就是说它必须还要进行二次分区。那么由扩充分区再分下去的是什么呢？它就是&lt;span style=&quot;color: red;&quot;&gt;逻辑分区&lt;/span&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;logical partion&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;），况且逻辑分区没有数量上限制。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;对习惯于使用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;dos&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;或&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;windows&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的用户来说，有几个分区就有几个驱动器，并且每个分区都会获得一个字母标识符，然后就可以选用这个字母来指定在这个分区上的文件和目录，它们的文件结构都是独立的，非常好理解。但对这些初上手&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的用户，可就有点恼人了。因为对&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;用户来说无论有几个分区，分给哪一目录使用，它归根结底就只有一个根目录，一个独立且唯一的文件结构。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中每个分区都是用来组成整个文件系统的一部分，因为它采用了一种叫&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;载入&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的处理方法，它的整个文件系统中包含了一整套的文件和目录，且将一个分区和一个目录联系起来。这时要载入的一个分区将使它的存储空间在一个目录下获得。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;对&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;windows&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;用户来说，操作系统必须装在同一分区里，它是商业软件&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;!&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;所以你没有选择的余地！对&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来说，你有了较大的选择余地，你可以把系统文件分几个区来装（必须要说明载入点），也可以就装在同一个分区中（载入点是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“/”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;下面从这两个方面入手，来讲解这个困扰大家的问题。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;strong&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的分区规定&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;1.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备管理&lt;/span&gt;&amp;nbsp;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 15.75pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中，每一个硬件设备都映射到一个系统的文件，对于硬盘、光驱等&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;或&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;SCSI&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备也不例外。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;把各种&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备分配了一个由&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hd&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;前缀组成的文件；而对于各种&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;SCSI&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备，则分配了一个由&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;sd&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;前缀组成的文件。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 15.75pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;对于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘，驱动器标识符为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“hdx~”,&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;其中&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“hd”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表明分区所在设备的类型，这里是指&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘了。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“x”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;为盘号（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;为基本盘，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;为基本从属盘，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;为辅助主盘，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;d&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;为辅助从属盘）&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;,“~”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;代表分区，前四个分区用数字&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表示，它们是主分区或扩展分区，从&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;开始就是逻辑分区。例，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda3&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表示为第一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘上的第三个主分区或扩展分区&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;,hdb2&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表示为第二个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘上的第二个主分区或扩展分区。对于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;scsi&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘则标识为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“sdx~”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;scsi&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘是用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;“sd”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来表示分区所在设备的类型的，其余则和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘的表示方法一样，不在多说。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 15.75pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;例如，第一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;就定义为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;；第二个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备就定义为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hdb&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;；下面以此类推。而&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;SCSI&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备就应该是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;sda&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;sdb&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;sdc&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 15.75pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;2.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区数量&lt;/span&gt;&amp;nbsp;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;要进行分区就必须针对每一个硬件设备进行操作，这就有可能是一块&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;IDE&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘或是一块&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;SCSI&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘。对于每一个硬盘（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;或&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;SCSI&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）设备，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分配了一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;16&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的序列号码，这就代表了这块硬盘上面的分区号码。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　例如，第一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘的第一个分区，在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;下面映射的就是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，第二个分区就称作是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda2&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。对于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;SCSI&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘则是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;sda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;sdb1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.6pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;3.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;各分区的作用&lt;/span&gt;&amp;nbsp;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.6pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中规定，每一个硬盘设备最多能有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个主分区（其中包含扩展分区）构成，任何一个扩展分区都要占用一个主分区号码，也就是在一个硬盘中，主分区和扩展分区一共最多是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;4&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　对于早期的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;DOS&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Windows&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Windows 2000&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;以前的版本），系统只承认一个主分区，可以通过在扩展分区上增加逻辑盘符（逻辑分区）的方法，进一步地细化分区。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.6pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;主分区的作用就是计算机用来进行启动操作系统的，因此每一个操作系统的启动，或者称作是引导程序，都应该存放在主分区上。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.6pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;这就是主分区和扩展分区及逻辑分区的最大区别。　　&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.6pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们在指定安装引导&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;bootloader&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的时候，都要指定在主分区上，就是最好的例证。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;规定了主分区（或者扩展分区）占用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;至&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;16&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;号码中的前&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;4&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个号码。以第一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;IDE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;硬盘为例说明，主分区（或者扩展分区）占用了&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda2&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda3&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，而逻辑分区占用了&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda5&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda16&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;12&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个号码。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　因此，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;下面每一个硬盘总共最多有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;16&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个分区。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　对于逻辑分区，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;规定它们必须建立在扩展分区上（在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;DOS&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Windows&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;系统上也是如此规定），而不是主分区上。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　因此，我们可以看到扩展分区能够提供更加灵活的分区模式，但不能用来作为&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;操作系统&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的引导。&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;除去上面这些各种分区的差别，我们就可以简单地把它们一视同仁了。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;4.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区指标　　&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;对于每一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区来讲，分区的大小和分区的类型是最主要的指标。容量的大小读者很容易理解，但是分区的类型就不是那么容易接受了。分区的类型规定了这个分区上面的文件系统的格式。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;支持多种的文件系统格式，其中包含了我们熟悉的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;FAT32&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;FAT16&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;NTFS&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;HP-UX&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，以及各种&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;特有的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux Native&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux Swap&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区类型。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;系统中，可以通过分区类型号码来区别这些不同类型的分区。各种类型号码在介绍&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Fdisk&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的使用方式的时候将会介绍。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;常用分区&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/boot&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，它包含了操作系统的内核和在启动系统过程中所要用到的文件，建这个&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区是有必要的，因为目前大多数的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;pc&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;机要受到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;bios&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的限制&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;况且如果有了一个单独的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/boot&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;启动分区，即使主要的根分区出现了问题，计算机依然能够&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;启动。这个分区的大小约在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;50mb—100mb&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;之间。但是如果想用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;lilo&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;启动&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;系统的话，含有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/boot&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的分区必须完全在柱面&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;1023&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;以下。又由于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;8gb&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;后的数据&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;lilo&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;不能读取，所以&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;要安装在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;8gb&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的区域以内。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/usr&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;red hat linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;系统存放软件的地方，如有可能应将最大空间分给它。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/home&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，是用户的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;home&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;目录所在地，这个分区的大小取决于有多少用户。如&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;果是多用户共同使用一台电脑的话，这个分区是完全有必要的，况且根用户也可以很好地控制普通用户使用计算机，如对用户或者用户组实行硬盘限量使用，限制普&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;通用户访问哪些文件等。其实单用户也有建立这个分区的必要，因为没这个分区的话，那么你只能以根用户的身份登陆系统，这样做是危险的，因为根用户对系统有&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;绝对的使用权，可一旦你对系统进行了误操作，麻烦也就来了。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/var/log&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，是系统日志记录分区，如果设立了这一单独的分区，这样即使系统的日志文件出现了问题，它们也不会影响到操作系统的主分区。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，用来存放临时文件。这对于多用户系统或者网络服务器来说是有必要的。&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;这样即使程序运行时生成大量的临时文件，或者用户对系统进行了错误的操作，文件系统的其它部分仍然是安全的。因为文件系统的这一部分仍然还承受着读写操&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;作，所以它通常会比其它的部分更快地发生问题。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/bin&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，存放标准系统实用程序。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/dev&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，存放设备文件。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/opt&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，存放可选的安装的软件。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/sbin&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，存放标准系统管理文件。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;上面介绍了几个常用的分区，一般来说我们需要一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;swap&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/boot&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/usr&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/home&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/var/log&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区。当然这没有什么规定，完全是依照你个人来定的。但记住至少要有两个分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;swap&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;strong&gt;Fdisk&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;使用详解&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;下面通过介绍&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的使用方法，来巩固上面所学到的各种关于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区的知识。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是各种&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;发行版本中最常用的分区工具，是被定义为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Expert&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;级别的分区工具，它让初学者有点望而却步。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;1. Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数说明&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　运行&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Fdisk&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的时候，首先映入眼帘的是欢迎界面，用户通过在这个界面中输入命令参数来操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Fdisk&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。用户通过提示键入&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;“m”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，可以显示&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;命令各个参数的说明。&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;读者可以看到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;有很多参数，可是经常使用的就是几个，如果读者熟练掌握这几个参数就可以流畅地运用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Fdisk&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，对&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的硬盘进行分区。我们先简单介绍各个参数的意义，然后详细说明几个重点参数。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;　　用户在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中进行分区的时候，最常用的参数分别是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;d&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;q&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;、&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;w&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;进行分区&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区过程，一般是先通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;p&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数来显示出硬盘分区表信息，然后根据信息确定将来的分区。如果想完全改变硬盘的分区格式，就可以通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;d&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数一个个删除存在的硬盘分区。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21.4pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;例如&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;d1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;d2&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;删除完毕，就可以通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;n&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数来增加新的分区。当按下&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;“n”&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;后，我们就可以看到新增的分区。这里要选择新建的分区类型，是主分区还是扩展分区；然后选择&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;p&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;或是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;e&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。它们的区别在上文中已经说明。然后就是设置分区的大小。需要提醒注意的是，如果硬盘上有扩展分区，就只能增加逻辑分区，不能增加扩展分区了，在增加分区的时候，其类型都是默认的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux Native&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，如果需要把其中的某些分区改变为其它类型，例如&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux Swap&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;或&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;FAT32&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等，可以通过命令&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;t&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来改变，&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;当按下&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;“t”&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;改变分区类型的时候，系统会提示要改变哪个分区，并且改变为什么类型（如果想知道系统所支持的分区类型，键入&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;l&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;所支持的分区类型号码和其对应的分区类型，可以参考表&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;2&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;（这些信息可以用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;l&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;命令得到）。改变完了分区类型，就可以按下&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;“w”&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，保存并且退出。如果不想保存，那么可以选择&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;“q”&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;直接退出。&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fdisk&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是一款强大的磁盘操作工具，来自&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;util-linux&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;软件包，我们在这里只说他如何查看磁盘分区表及分区结构；参数&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;-l&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;-l&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数，能获得机器中所有磁盘的个数，也能列出所有磁盘分区情况；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;[root@localhost beinan]# fdisk -l&lt;br /&gt;
Disk /dev/hda: 80.0 GB, 80026361856 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 9729 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Device Boot&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blocks&amp;nbsp;&amp;nbsp; Id&amp;nbsp; System&lt;br /&gt;
/dev/hda1&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 765&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6144831&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp; HPFS/NTFS&lt;br /&gt;
/dev/hda2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 766&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2805&amp;nbsp;&amp;nbsp;&amp;nbsp; 16386300&amp;nbsp;&amp;nbsp;&amp;nbsp; c&amp;nbsp; W95 FAT32 (LBA)&lt;br /&gt;
/dev/hda3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2806&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7751&amp;nbsp;&amp;nbsp;&amp;nbsp; 39728745&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp; Extended&lt;br /&gt;
/dev/hda5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2806&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3825&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8193118+&amp;nbsp; 83&amp;nbsp; Linux&lt;br /&gt;
/dev/hda6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3826&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5100&amp;nbsp;&amp;nbsp;&amp;nbsp; 10241406&amp;nbsp;&amp;nbsp; 83&amp;nbsp; Linux&lt;br /&gt;
/dev/hda7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5198&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 787153+&amp;nbsp; 82&amp;nbsp; Linux swap / Solaris&lt;br /&gt;
/dev/hda8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5199&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6657&amp;nbsp;&amp;nbsp;&amp;nbsp; 11719386&amp;nbsp;&amp;nbsp; 83&amp;nbsp; Linux&lt;br /&gt;
/dev/hda9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6658&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7751&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8787523+&amp;nbsp; 83&amp;nbsp; Linux&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;在上面&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Blocks&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中，表示的是分区的大小，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;Blocks&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的单位是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;byte&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，我们可以换算成&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，比如第一个分区&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的大小如果换算成&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，应该是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;6144831/1024=6000M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，也就是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;6G&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;左右，其实没有这么&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;麻烦，粗略的看一下把小数点向前移动三位，就知道大约的体积有多大了；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表示的文件系统，比如&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda1&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;NTFS&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;格式的；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda2&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;表示是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;fat32&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;格式的文件系统；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;在此例中，我们要特别注意的是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda3&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;分区，这是扩展分区；他下面包含着逻辑分区，其实这个分区相当于一个容器；从属于她的有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda5,hda6,hda7,hda8,hda9&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们还注意到一点，怎么没有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;呢？为什么&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;没有包含在扩展分区？一个磁盘最多有四个主分区；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda1-4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;算都是主分区；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;不可能包含在扩展分区里，另外扩展分区也算主分区；在本例中，没有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda4&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;这个分区，当然我们可以把其中的一个分区设&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;置为主分区，只是我当时分区的时候没有这么做而已；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;再仔细统计一下，我们看一看这个磁盘是不是还有空间？&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;hda1+hda2+hda3=&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;实际已经分区的体积，所以我们可以这样算&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;hda1+hda2+hda3=6144831+16386300+39728745 = 62259876 (b)&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，换算成&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;单位，小数点向前移三位，所以目前已经划分好的分区大约占用体积是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;62259.876(M)&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，其实最精确的计算&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;62259876/1024=60800.67&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）；而这个磁盘大小是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;80.0 GB&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;80026361856byte)&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，其实实际大小也就是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;78150.744&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;（&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;M&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;）；通过我们一系列的计算，我们可以得出这个硬盘目前还有使用的空间；大约还有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;18G&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;未分区的空间；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们也可以指定&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;fdisk -l&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来查看其中一个硬盘的分区情况；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;[root@localhost beinan]# fdisk -l /dev/sda&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sda: 60.0 GB, 60011642880 bytes&lt;br /&gt;
64 heads, 32 sectors/track, 57231 cylinders&lt;br /&gt;
Units = cylinders of 2048 * 512 = 1048576 bytes&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Device Boot&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blocks&amp;nbsp;&amp;nbsp; Id&amp;nbsp; System&lt;br /&gt;
/dev/sda1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 57231&amp;nbsp;&amp;nbsp;&amp;nbsp; 58604528&amp;nbsp;&amp;nbsp; 83&amp;nbsp; Linux&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;通过上面情况可以知道，在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/sda&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;这个磁盘中，只有一个分区；使用量差不多是百分百了；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们还可以来查看&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;/dev/hda&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;[root@localhost beinan]# fdisk -l /dev/hda&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;自己试试看？&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们也可以通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;: cat /proc/partitions&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;查看目前机器中的所有磁盘及分区情况&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;df&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;命令；&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;
df&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是来自&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;coreutils&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;软件包，系统安装时，就自带的；我们通过这个命令可以查看磁盘的使用情况以及文件系统被挂载的位置；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;举例：&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;[root@localhost beinan]# df -lh&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;Filesystem&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;容量&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;已用&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;可用&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: 宋体;&quot;&gt;已用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;%&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;挂载点&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;11G&amp;nbsp;&amp;nbsp;6.0G&amp;nbsp;&amp;nbsp;4.4G&amp;nbsp;&amp;nbsp;58% /&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/dev/shm&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;236M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&amp;nbsp;&amp;nbsp;236M&amp;nbsp;&amp;nbsp;&amp;nbsp;0% /dev/shm&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;/dev/sda1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;56G&amp;nbsp;&amp;nbsp;&amp;nbsp;22G&amp;nbsp;&amp;nbsp;&amp;nbsp;35G&amp;nbsp;&amp;nbsp;39% /mnt/sda1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-indent: 21pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;我们从中可以看到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;系统安装在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/hda8&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;；还有一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;56G&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的磁盘分区&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;/dev/sda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;挂载在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;/mnt/sda1&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中；&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;其它的参数请参考&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;man df&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;通过以上两个方面的学习，相信对于初学者来说，分区已经不再是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Linux&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;进阶中的绊脚石了。&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/6631353136863235243/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2012/10/linux.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6631353136863235243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/6631353136863235243'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2012/10/linux.html' title='linux磁盘分区详解'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3965681782468029509</id><published>2012-10-06T00:50:00.002+08:00</published><updated>2012-10-06T00:50:51.696+08:00</updated><title type='text'>udev的实现原理</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;udev实现原理&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;转载时请注明出处和作者联系方式：&lt;span lang=&quot;EN-US&quot;&gt;&lt;a href=&quot;http://blog.csdn.net/absurd&quot; style=&quot;color: #336699; text-decoration: none;&quot;&gt;http://blog.csdn.net/absurd&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;作者联系方式：&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;李先静&lt;/span&gt;&amp;lt;xianjimli at hotmail dot com&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;更新时间：&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;2007-4-29&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;相对于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;linux&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来说，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;还是一个新事物。然而，尽管它&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;03&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;年才出现，尽管它很低调&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;J&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，但它无疑已经成为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;linux&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;下不可或缺的组件了。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是什么？它是如何实现的？最近研究&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;Linux&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设备管理时，花了一些时间去研究&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的实现。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是什么？&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;u&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是指&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;user space&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;dev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是指&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;device&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是用户空间的设备驱动程序吗？最初我也这样认为，调试内核空间的程序要比调试用户空间的程序复杂得多，内核空间的程序的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;BUG&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;所引起的后果也严重得多，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;device driver&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是内核空间中所占比较最大的代码，如果把这些&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;device driver&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中硬件无关的代码，从内核空间移动到用户空间，自然是一个不错的想法。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;但我的想法并不正确，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的文档是这样说的，&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;dynamic replacement for /dev&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。作为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;devfs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的替代者，传统的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;devfs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;不能动态分配&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;major&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;minor&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的值，而&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;major&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;minor&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;非常有限，很快就会用完了。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;能够像&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;DHCP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;动态分配&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;IP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;地址一样去动态分配&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;major&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;minor&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;device naming&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。提供设备命名持久化的机制。传统设备命名方式不具直观性，像&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/dev/hda1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;这样的名字肯定没有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;boot_disk&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;这样的名字直观。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;能够像&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;DNS&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;解析域名一样去给设备指定一个有意义的名称。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;API to access info about current system devices&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。提供了一组易用的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;API&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;去操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;sysfs&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，避免重复实现同样的代码，这没有什么好说的。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;我们知道，用户空间的程序与设备通信的方法，主要有以下几种方式，&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;ioperm&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;获取操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;IO&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;端口的权限，然后用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;inb/inw/ inl/ outb/outw/outl&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等函数，避开设备驱动程序，直接去操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;IO&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;端口。（没有用过）&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;ioctl&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;函数去操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/dev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;目录下对应的设备，这是设备驱动程序提供的接口。像键盘、鼠标和触摸屏等输入设备一般都是这样做的。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;write/read/mmap&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;去操作&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/dev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;目录下对应的设备，这也是设备驱动程序提供的接口。像&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;framebuffer&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;等都是这样做的。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;上面的方法在大多数情况下，都可以正常工作，但是对于热插拨&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;(hotplug)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的设备，比如像&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;U&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;盘，就有点困难了，因为你不知道：什么时候设备插上了，什么时候设备拔掉了。这就是所谓的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;问题了。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;处理&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;传统的方法是，在内核中执行一个称为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的程序，相关参数通过环境变量传递过来，再由&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;通知其它关注&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;事件的应用程序。这样做不但效率低下，而且感觉也不那么优雅。新的方法是采用&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;NETLINK&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;实现的，这是一种特殊类型的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，专门用于内核空间与用户空间的异步通信。下面的这个简单的例子，可以监听来自内核&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的事件。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; border-collapse: collapse; border: medium none; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: transparent; border: 0.5pt solid windowtext; padding: 0cm 5.4pt; width: 426.1pt;&quot; valign=&quot;top&quot; width=&quot;568&quot;&gt;&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;stdio&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;stdlib.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;string&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;ctype&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;sys/un.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;sys/ioctl.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;sys/&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;socket&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;linux/types.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;linux/netlink.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;errno&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;static&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;init_hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;struct&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;sockaddr_nl&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;const&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buffersize&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;= 16 * 1024 * 1024;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;retval&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;memset&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;, 0x00,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;sizeof&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;struct&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;sockaddr_nl));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.nl_family = AF_NETLINK;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.nl_pid =&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;getpid&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;.nl_groups = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;socket&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(PF_NETLINK,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;SOCK_DGRAM&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;, NETLINK_KOBJECT_UEVENT);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;== -1) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;printf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #000077; font-size: 10pt;&quot;&gt;&quot;error getting socket: %s&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;strerror&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;errno&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;return&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;-1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #009900; font-size: 10pt;&quot;&gt;/* set receive buffersize */&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;setsockopt&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;SOL_SOCKET&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;, SO_RCVBUFFORCE, &amp;amp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buffersize&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;sizeof&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buffersize&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;retval&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;bind&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;, (&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;struct&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;sockaddr&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;*) &amp;amp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;snl&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;sizeof&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;struct&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;sockaddr_nl));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;retval&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;lt; 0) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;printf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #000077; font-size: 10pt;&quot;&gt;&quot;bind failed: %s&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;strerror&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;errno&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;close&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;= -1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;return&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;-1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;return&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;#define&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;UEVENT_BUFFER_SIZE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2048&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;main&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;argc&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;char&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;*&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;argv&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;[])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;init_hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;while&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;char&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;[&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a000a0; font-size: 10pt;&quot;&gt;UEVENT_BUFFER_SIZE&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;*2] = {0};&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;recv&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;hotplug_sock&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;, &amp;amp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;sizeof&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;), 0);&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #880000; font-size: 10pt;&quot;&gt;printf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #000077; font-size: 10pt;&quot;&gt;&quot;%s/n&quot;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: grey; font-size: 10pt;&quot;&gt;buf&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-size: 10pt;&quot;&gt;return&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&amp;nbsp;0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;编译：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;gcc -g hotplug.c -o hotplug_monitor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;运行后插&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;拔&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;U&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;盘，可以看到：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; border-collapse: collapse; border: medium none; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: transparent; border: 0.5pt solid windowtext; padding: 0cm 5.4pt; width: 426.1pt;&quot; valign=&quot;top&quot; width=&quot;568&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/usbdev2.2_ep00&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/class/scsi_host/host2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep81&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep02&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep83&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/class/usb_device/usbdev2.2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/class/scsi_disk/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/block/sda&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/block/sda/sda1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/class/scsi_device/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;add@/class/scsi_generic/sg0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep81&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep02&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/usbdev2.2_ep83&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/class/scsi_generic/sg0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/class/scsi_device/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/class/scsi_disk/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/block/sda/sda1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/block/sda&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/class/scsi_host/host2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/2-1:1.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/class/usb_device/usbdev2.2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1/usbdev2.2_ep00&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;remove@/devices/pci0000:00/0000:00:1d.1/usb2/2-1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的主体部分在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udevd.c&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;文件中，它主要监控来自&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个文件描述符的事件&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;消息，并做出处理：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来自客户端的控制消息。这通常由&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udevcontrol&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;命令通过地址为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/org/kernel/udev/udevd&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的本地&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，向&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udevd&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;发送的控制消息。其中消息类型有：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_STOP_EXEC_QUEUE&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;停止处理消息队列。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_START_EXEC_QUEUE&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;开始处理消息队列。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_SET_LOG_LEVEL&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设置&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;LOG&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的级别。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_SET_MAX_CHILDS&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设置最大子进程数限制。好像没有用。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_SET_MAX_CHILDS_RUNNING&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;设置最大运行子进程数限制&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;遍历&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;proc&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;目录下所有进程，根据&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;session&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的值判断&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 42pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Wingdings;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;l&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;UDEVD_CTRL_RELOAD_RULES&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;重新加载配置文件。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来自内核的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;事件。如果有事件来源于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，它读取该事件，创建一个&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udevd_uevent_msg&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;对象，记录当前的消息序列号，设置消息的状态为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;EVENT_QUEUED,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;然后并放入&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;running_list&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;和&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;exec_list&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;两个队列中，稍后再进行处理。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来自&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;signal handler&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中的事件。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;signal handler&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;是异步执行的，即使有&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;signal&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;产生，主进程的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;select&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;并不会唤醒，为了唤醒主进程的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;select&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，它建立了一个管道，在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;signal handler&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;中，向该管道写入长度为&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;个子节的数据，这样就可以唤醒主进程的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;select&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;了。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt 21pt; text-indent: -21pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;来自配置文件变化的事件。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;通过文件系统&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;inotify&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;功能，监控其配置文件目录&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;/etc/udev/rules.d&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，一旦该目录中文件有变化，它就重新加载配置文件。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;其中最主要的事件，当然是来自内核的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hotplug&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;事件，如何处理这些事件是&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的关键。&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;本身并不知道如何处理这些事件，也没有必要知道，因为它只实现机制，而不实现策略。事件的处理是由配置文件决定的，这些配置文件即所谓的&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;rule&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;关于&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;rule&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的编写方法可以参考《&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;writing_udev_rules&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;》，&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udev_rules.c&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;实现了对规则的解析。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;在规则中，可以让外部应用程序处理某个事件，这有两种方式，一种是直接执行命令，通常是让&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;modprobe&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;去加载驱动程序，或者让&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;mount&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;去加载分区。另外一种是通过本地&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;发送消息给某个应用程序。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;在&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;udevd.c:udev_event_process&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;函数中，我们可以看到，如果&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;RUN&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;参数以&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;”socket:”&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;开头则认为是发到&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;，否则认为是执行指定的程序。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-family: 宋体;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;下面的规则是执行指定程序：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;60-pcmcia.rules:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RUN+=&quot;/sbin/modprobe pcmcia&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;下面的规则是通过&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;socket&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;发送消息：&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;90-hal.rules:RUN+=&quot;socket:/org/freedesktop/hal/udev_event&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;hal&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;正是我们下一步要关心的，接下来我会分析&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;HAL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: 宋体;&quot;&gt;的实现原理。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; margin: 0cm 0cm 0pt;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;font-family: Times New Roman; font-size: small;&quot;&gt;~~end~~&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3965681782468029509/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2012/10/udev.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3965681782468029509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3965681782468029509'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2012/10/udev.html' title='udev的实现原理'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3514432694761149208</id><published>2012-10-06T00:49:00.002+08:00</published><updated>2012-10-06T00:49:55.319+08:00</updated><title type='text'>对linux交换分区swap的一些认识总结</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　swap是所有linuxer都会接触，但是大部分人都不会关注的东西。实际上，小东西也有大学问，这不，一个关于swap的问题就在cu.&lt;a class=&quot;keyword_link&quot; href=&quot;http://www.chinabyte.com/keyword/Linux/&quot; style=&quot;border-bottom-color: rgb(7, 129, 199); border-bottom-style: dotted; border-bottom-width: 1px; color: #333333; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;linux&lt;/a&gt;上讨论得热火朝天的，我在这里总结在一起，绝对对各位大有帮助。要看具体讨论，请去这里。详细内容如下：&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　在debian 和&lt;a class=&quot;keyword_link&quot; href=&quot;http://www.chinabyte.com/keyword/Fedora/&quot; style=&quot;border-bottom-color: rgb(7, 129, 199); border-bottom-style: dotted; border-bottom-width: 1px; color: #333333; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;fedora&lt;/a&gt;的文档中，都看到有说明，swap分区最好不要超过2G。实际上，对于linux 2.6以上的内核，可以直接支持不大于64G的内存。ext3等日志型文件系统，也可以直接支持超过2G的单个文件，所以，对于64G以内的swap，在 文件系统支持的情况下，建立成一个单独的分区或文件，不会影响系统的performace。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Linus曾经在一个mail讨论中指出：&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　In the course of discussion, it became clear that Linux 2.4.x required more swap than previous versions. Rik van Riel mentioned, “2.4 keeps dirty pages in the swap cache, so you will need more swap to run the same programs…” He asked Linus Torvalds, “is this something we want to keep or should we give the user the option to run in a mode where swap space is freed when we swap in something non-shared ?” Linus replied:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　I’d prefer just documenting it and keeping it. I’d hate to have two fairly different modes of behaviour. It’s always been the suggested “twice the amount of RAM”, although there’s historically been the “Linux doesn’t really need that much” that we just killed with 2.4.x.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　If you have 512MB of RAM, you can probably afford another 40GB or so of harddisk. They are disgustingly cheap these days.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Zlatko Calusic worried that more data in swap would degrade performance because the disk head would need more seek time to find data. He asked if Linus was sure this would be okay, and Linus replied, “I’m not _sure_, obviously. However, one thing I _am_ sure of is that the sticky page-cache simplifies some things enormously, and make some things possible that simply weren’t possible before.” . But in a nearby post he admitted, “the sticky allocation _might_ make the IO we do be more spread out.” He felt it was important to consider these kinds of potential downsides, though he felt that in this case the benefits outweighed the drawbacks; and at one point Eric W. Biederman explained succinctly, “The tradeoff when implemented correctly is that writes will tend to be more spread out and reads should be better clustered together.”&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Zlatko ran some tests, and could not find any problems with the 2.4.0 memory management logic, though he added, “I have found that new kernel allocates 4 times more swap space under some circumstances. That may or may not be alarming, it remains to be seen.” At one point, Linus gave his overall take on 2.2/2.4 performance issues. He said:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　I personally think 2.4.x is going to be as fast or faster at just about anything. We do have some MM issues still to hash out, and tuning to do, but I’m absolutely convinced that 2.4.x is going to be a _lot_ easier to tune than 2.2.x ever was. The “scan the page tables without doing any IO” thing just makes the 2.4.x memory management several orders of magnitude more flexible than 2.2.x ever was.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　(This is why I worked so hard at getting the PageDirty semantics right in the last two months or so - and why I released 2.4.0 when I did. Getting PageDirty right was the big step to make all of the VM stuff possible in the first place. Even if it probably looked a bit foolhardy to change the semantics of “writepage()” quite radically just before 2.4 was released).&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Elsewhere, he considered the case of swapless or low-swap machines:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　If you don’t have any swap, or if you run out of swap, the major difference between 2.2.x and 2.4.x is probably going to be the oom handling: I suspect that 2.4.x might be more likely to kill things off sooner (but it tries to be graceful about which processes to kill).&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Not having any swap is going to be a performance issue for both 2.2.x and 2.4.x - Linux likes to push inactive dirty pages out to swap where they can lie around without bothering anybody, even if there is no _major_ memory crunch going on.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　If you do have swap, but it’s smaller than your available physical RAM, I suspect that the Linux-2.4 swap pre-allocate may cause that kind of performance degradation earlier than 2.2.x would have. Another way of putting this: in 2.2.x you could use a fairly small swap partition to pick up some of the slack, and in 2.4.x a really small swap-partition doesn’t really buy you much anything.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　在讨论中，Linus明确的说明了，在Linux2.4.x中，内存管理(MM)策略的改变。就如 Windows98向Windows2000转变一样，&lt;a class=&quot;keyword_link&quot; href=&quot;http://com.chinabyte.com/microsoft/&quot; style=&quot;border-bottom-color: rgb(7, 129, 199); border-bottom-style: dotted; border-bottom-width: 1px; color: #333333; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;微软&lt;/a&gt;在内存和交换区中保存了更多的脏页，而不是及时回收内存，大幅提高了系统的效率。(见 Widnows核心编程第18章的论述)。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　Linus还指出，即使是512M内存，也可以分配高达40G的交换区，以提高系统的性能。Zlatko 在向Linus提出性能的质疑后，自己进行了验证。实验表明大交换区策略，没有增加&lt;a class=&quot;keyword_link&quot; href=&quot;http://www.chinabyte.com/keyword/%E7%A3%81%E7%9B%98/&quot; style=&quot;border-bottom-color: rgb(7, 129, 199); border-bottom-style: dotted; border-bottom-width: 1px; color: #333333; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;磁盘&lt;/a&gt;I/O的流量。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　那么，swap是不是必须的?很多人认为是，其实，普通意义上所谓的swap是内存的2倍只是一个给新手使用的经验值，实际使用swap的大小是根据程序对内存使用状况需要调整的。如果机器在运行时对内存的需求量不大，就没有必要要swap。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　这个问题就变成了 我不知道所有任务最大内存需求是多少，那怎么办?&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　可以1步1步来:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　1 用swapoff 关掉所有swap 然后正常运行任务，如果出现内存不足的提示，就需要逐步增加swap。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　2 一般来讲,物理内存达到256m，在安装时即可不用划分交换分区。&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: 宋体, &#39;Arial Narrow&#39;, tahoma, arial, 宋体, sans-serif; font-size: 14px; line-height: 25px; margin-bottom: 15px; margin-left: 3px; margin-right: 3px; padding: 0px;&quot;&gt;
　　3 可以在安装后建立交换分区，或者建立交换文件。&lt;/div&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3514432694761149208/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2012/10/linuxswap.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3514432694761149208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3514432694761149208'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2012/10/linuxswap.html' title='对linux交换分区swap的一些认识总结'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-3419152508866597362</id><published>2012-08-09T11:35:00.000+08:00</published><updated>2012-08-09T11:35:03.439+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VPN"/><category scheme="http://www.blogger.com/atom/ns#" term="翻墙"/><category scheme="http://www.blogger.com/atom/ns#" term="自动翻墙 VPN"/><title type='text'>公司的自动翻墙 VPN</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;最近做了很多 IT 的活。比如这个项目。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;需求:&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;1. 希望能够尽量透明地免设置地实现自动翻墙&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;2. 尽量不影响墙内站点的访问速度&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;span id=&quot;more-10854&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;3. 尽可能地节省成本（主要是流量成本）&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;4. 尽可能地便于维护和更新&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;参考:&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;1.&amp;nbsp;&lt;a href=&quot;https://autoproxy.org/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot; target=&quot;_blank&quot; title=&quot;autoproxy&quot;&gt;autoproxy&lt;/a&gt;&amp;nbsp;主要用了他家的&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/autoproxy-gfwlist/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot; target=&quot;_blank&quot; title=&quot;autoproxy-gfwlist&quot;&gt;gfwlist&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;2.&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/chnroutes/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot; target=&quot;_blank&quot; title=&quot;chnroutes&quot;&gt;chnroutes&lt;/a&gt;&amp;nbsp;参考了他家的配置&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;3.&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/autoddvpn/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot; target=&quot;_blank&quot; title=&quot;autoddvpn&quot;&gt;autoddvpn&lt;/a&gt;&amp;nbsp;参考了他家的生成路由表的脚本&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;设计：&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;为了尽量透明和免设置，也为了速度能够好一点，没有考虑用代理的方式而是用了 VPN 的方式。这带来了不少的麻烦，因为 autoproxy-gfwlist 是基于代理的而不是基于 VPN 的，后面会提到一些细节。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;为了节省流量成本（也为了能够让墙内网站访问快一点），没有使用 chnroutes 那种将全部国外网站都走 VPN 的简单易维护的方式，而是准备使用类似于 autoddvpn gracemode 的方式。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;公司有很多很多个网络出口。经过考虑，挑选了三个链接速度比较快的出口（广州联通，北京联通，杭州 BGP ）做了三个 VPN, 并且同时在这三个出口做了 NAT, 其他出口则设置路由表将墙外 IP 路由到这三个出口之一。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;为了能够保证 GSLB, 特别是 DNS based GSLB 的有效性，不考虑将 DNS 整个走 VPN 来防止污染，而需要自建 DNS server 来确保没有被污染的域名走本地查询只有被污染的域名才 forward 到墙外去查询。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;因此整个分为这么几快:&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;1. 墙外的 openvpn server, 自动更新墙外路由表并且 push 到墙内的三个出口&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;2. 墙内的三个出口处的 oenvpn client, 自动接收 openvpn server push 来的路由表并且应用。同时做 NAT&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;3. 墙内的其他出口，根据地理位置同步墙内的三个出口之一的路由表并且指向该出口&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;4. 防止 DNS 污染的 DNS recursive server, 广州，北京，杭州各一个&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;5. 监控&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;为了便于实现路由表的更新，我没有用 autoddvpn gracemode 里面的那种在 vpnup.sh 脚本里面添加路由表的方式，而是使用了 client-config-dir （需要比较新的 openvpn, 支持 client-config-dir 也就是 ccd 以及 push-continuation, 没有仔细查 changelog 来看最低版本要求，总之我用了 openvpn 2.2），将需要 push 的路由表放入 ccd 之中，配合 management console, 在更新了 ccd 之中的路由表之后在 console 里面踢掉所有 client, 这样 client 就会自动重连并且得到新的路由表， client 和 server 均无需重启。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;client 和其他出口同步路由表，用脚本搞定&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;用 BIND 建了三个 DNS server（用 bind 不用 dnsmasq 的原因稍后再提）将被污染的域 forward 到 openvpn server 中 /etc/resolv.conf 里面的 DNS server 而其他域在本地做 recursive 查询。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;整个架构是简单的。最大的难点在于: 1. 如何获得墙外 IP 列表并做出路由表给 openvpn ccd 使用 2. 如何获取被 DNS 污染的域名列表并做出 forward 列表给 BIND 使用。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;这里我们唯一的资源只有 autoproxy-gfwlist, 但是这个 list 是为了代理使用的。没有区分 IP 屏蔽和 DNS 污染，也没有给出每个域名的 IP 具体是什么。因此在 autoddvpn 里面，使用了一个&lt;a href=&quot;http://autoddvpn.googlecode.com/svn/trunk/grace.d/gfwListgen.py&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot; target=&quot;_blank&quot; title=&quot;autoddvpn gfwListgen 脚本&quot;&gt;脚本&lt;/a&gt;来扫 autoproxy-gfwlist 里面的全部域名，一个一个查询其 IP, 并且将相关的 IP 段整个加入路由表中，同时将 autoproxy-gfwlist 里面所有的域名均加入 BIND 的 forward list 中。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;这样得到的两个列表，首先存在大量的冗余，因为只有 DNS 污染的也被加到路由表了，其次都是有问题需要修正的。但是又没有更好的方法去生成列表了。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;修正:&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;1. redirect 和 其他资源&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;autoddvpn 的脚本没有考虑重定向的问题。例如 http://imdb.com/ 会被301重定向到 http://www.imdb.com/ 而 www.imdb.com 和 imdb.com 的 IP 是不同的。因此重定向之后不会走 VPN 而导致被重置，需要将 www.imdb.com 的 IP 加入路由表。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;另外如果网页之中引用的其他资源（ css, js, frame, etc… ）不会被脚本所跟踪到。例如 http://zinio.com/ 中的全部图片是放置在 img.zinio.com 这个域的，而 zinio.com 和 img.zinio.com 的 IP 是不同的，需要将 img.zinio.com 的 IP 加入路由表。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;一个更复杂的例子是 facebook. http://facebook.com/ 首先重定向到 http://www.facebook.com/, 然后引用了位于 static.ak.fbcdn.net 和 s-static.ak.fbcdn.net 的资源，这些资源同时还受到 DNS 污染。（还有更复杂的，那就是这些资源均指向了 CDN, CDN 的问题后面再说。）&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;解决这个问题，有个办法是修改脚本，让脚本能够跟踪重定向和跟踪引用的资源，但是这样大大增加了脚本运行的时间，而且大大增加了生成列表的冗余（脚本默认已经给了超过一千的路由表和域）。我目前采取的办法是根据同事的报告手工修正 -_-|||…&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;2. 关键词&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;目前的架构可以解决 IP 封锁和 DNS 污染两个问题，但是对于关键词的封锁没有太好的办法（除非像 chnroutes 那样将全部国外 IP 均路由到 VPN, 但这样影响速度，并且将导致极大的流量，是不可接受的）。对于非常重要和经常出现问题的几个站点，例如 google, wikipedia 等，我将他们的 IP 全部加入了 VPN, 这样虽然增加了流量（目前 google 的流量占了全部 VPN 流量的一半以上），但是方便了很多。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;3. google.cn&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;google 是一个非常麻烦的例子。在将全部 google IP 加入 VPN 之后，出现了 google.cn 中的谷歌音乐拒绝来自国外 IP 访问的情况。必须将 google.cn 和 g.cn 的 IP 指向一个不走 VPN 的 IP. 但是 google 的 IP 都是通用服务（通过 host 来判断，每个 IP 都可以提供几乎所有服务），目前我采取的方法是将 google.cn 和 g.cn 均在 bind 里面强制指向了谷歌在国内的 IP, 这样就不走路由表并且还增加了速度。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;4. CDN&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;CDN 是一个非常复杂的例子。因为 CDN 都是同时给大量网站提供服务，一旦 CDN 的 IP 进入路由表就会带来大量流量并且让不少墙内网站拖慢速度，而且 CDN 是很少被 IP 封锁的（影响太大），因此在 CDN 里面的 IP 我都尽量从路由表中去掉了。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;但是 CDN 虽然不被 IP 封锁，被 DNS 污染却是很正常的。这里有个非常糟糕的事情是，为了能够照顾到 CDN 的 DNS based GSLB, 我们是不可能将 CDN 的域去 forward 到墙外查询的。因此出现这种情况只能特别处理。&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;例如对于 Facebook 的例子。 Facebook 引用了位于 static.ak.fbcdn.net 和 s-static.ak.fbcdn.net 的资源。 fbcdn.net 是被 DNS 和关键词污染的，因此需要将 fbcdn.net 加入 bind forwarder.&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;然后这两个域均指向了 CDN:&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;static.ak.fbcdn.net. IN CNAME static.ak.facebook.com.edgesuite.net.&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;s-static.ak.fbcdn.net. IN CNAME s-static.ak.fbcdn.net.edgekey.net.&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;这里我们不能将 edgesuite.net 和 edgekey.net 加入 forward list, 而需要加 facebook.com.edgesuite.net 和 fbcdn.net.edgekey.net&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;这样去解决 DNS 污染的问题&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;但是指向 CDN 的网站还会出现关键词污染的问题。 facebook 的例子中不存在这样的问题因为 facebook 全部资源均使用了 ssl （感谢上帝）， twitter 也一样（感谢上帝）。对于不使用 SSL 同时使用 CDN 的网站，还真没有什么好的办法，因为还是完全不能考虑将 CDN 的 IP 加入路由表。在 CDN 使用 SSL 还是有点麻烦的，感谢这些网站都做了实现。。。&lt;/div&gt;&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;原文&lt;/strong&gt;：&lt;a href=&quot;https://blog.steamedfish.org/2012/05/22/auto-break-wall-vpn/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;https://blog.steamedfish.org/2012/05/22/auto-break-wall-vpn/&lt;/a&gt;&lt;/div&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-1377224785365482&quot;;
/* adsense */
google_ad_slot = &quot;8909065052&quot;;
google_ad_width = 728;
google_ad_height = 90;
//--&gt;
&lt;/script&gt; &lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/3419152508866597362/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2012/08/vpn.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3419152508866597362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/3419152508866597362'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2012/08/vpn.html' title='公司的自动翻墙 VPN'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2449219125291160382.post-8570805306565530303</id><published>2012-08-09T10:56:00.000+08:00</published><updated>2012-08-09T10:56:31.905+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DNSmasq"/><category scheme="http://www.blogger.com/atom/ns#" term="resolvconf"/><title type='text'>如何不受DNS污染</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 0px;&quot;&gt;
这个话题，也是一直想写，现在有点时间了，就顺便写下吧，备忘和科普用吧。PS：使用此技能必须有个可用的VPN。没有的话，污染无解。还有我是针对Linux的，windows用户拜拜！&lt;/div&gt;
&lt;div id=&quot;outline-container-1&quot; style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;h3 id=&quot;sec-1&quot; style=&quot;font-size: 16px; margin: 0px; padding: 0px;&quot;&gt;
&lt;span id=&quot;more-10856&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;什么是DNS污染&lt;/h3&gt;
&lt;div id=&quot;text-1&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
回答这个问题之前，如果你不知道DNS的作用是什么，我可以简单的说，DNS的中文是域名系统，英文是Domain Name System，简称DNS，是因特网的一项业务服务，它作为可以将域名和IP地址相互映射的一个分布式数据库，能够使人更方便的访问互联网，而不用去记住 能够被机器直接读取的IP数串。（抄自&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D%E7%B3%BB%E7%BB%9F&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;域名系统&lt;/a&gt;）&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;然后，DNS污染简单来说就是让找不到正确的IP，然后就没有然后，上不了网了，开着VPN也没用。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
下面举个例子吧，下面同样域名得到差异很大的结果。如果我们使用国内的DNS服务器或者ISP提供的DNS服务器，就算开着VPN，我们也不能正常的DNS解析的。&lt;/div&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: #f0f6e9; border: 1px dashed rgb(178, 210, 129); font-family: &#39;Courier New&#39;, Courier, monospace, Fixed; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 5px 10px;&quot;&gt;[23:13:07] roowe@roowe-gentoo /tmp$ nslookup twitter.com 8.8.8.8
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   twitter.com
Address: 199.59.148.82
Name:   twitter.com
Address: 199.59.149.230
Name:   twitter.com
Address: 199.59.150.39

[23:14:37] roowe@roowe-gentoo /tmp$ nslookup twitter.com 114.114.114.114
Server:         114.114.114.114
Address:        114.114.114.114#53

Non-authoritative answer:
Name:   twitter.com
Address: 46.82.174.68&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-2&quot; style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;h3 id=&quot;sec-2&quot; style=&quot;font-size: 16px; margin: 0px; padding: 0px;&quot;&gt;
How To Break&lt;/h3&gt;
&lt;div id=&quot;text-2&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
使用dnsmasq和resolvconf，每个Linux的发行版的源应该都有这两个工具，安装方法就不说了。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
具体选项自己去看man吧。dnsmasq的配置大概如下，就是让国内的域名交给国内的114去解析。&lt;/div&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: #f0f6e9; border: 1px dashed rgb(178, 210, 129); font-family: &#39;Courier New&#39;, Courier, monospace, Fixed; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 5px 10px;&quot;&gt;no-resolv
no-poll
server=8.8.8.8
server=8.8.4.4
no-dhcp-interface=eth0
expand-hosts
server=/115.com/114.114.114.114
server=/126.com/114.114.114.114
server=/163.com/114.114.114.114
server=/17cdn.com/114.114.114.114
server=/51.la/114.114.114.114
server=/6rooms.com/114.114.114.114
server=/acfun.tv/114.114.114.114
server=/alimama.com/114.114.114.114
server=/alipay.com/114.114.114.114
server=/atpanel.com/114.114.114.114
server=/baidu.com/114.114.114.114
server=/bdimg.com/114.114.114.114
server=/bilibili.tv/114.114.114.114
server=/cn/114.114.114.114
server=/douban.com/114.114.114.114
server=/douban.fm/114.114.114.114
server=/gfan.com/114.114.114.114
server=/hoopchina.com/114.114.114.114
server=/iask.com/114.114.114.114
server=/ifeng.com/218.104.111.114
server=/ifengimg.com/218.104.111.114
server=/ku6.com/114.114.114.114
server=/ku6cdn.com/114.114.114.114
server=/lxdns.com/114.114.114.114
server=/microsoft.com/114.114.114.114
server=/mydrivers.com/114.114.114.114
server=/qq.com/114.114.114.114
server=/qstatic.com/114.114.114.114
server=/renren.com/114.114.114.114
server=/sogou.com/114.114.114.114
server=/sohu.com/114.114.114.114
server=/soso.com/114.114.114.114
server=/tanx.com/114.114.114.114
server=/taobao.com/114.114.114.114
server=/taobaocdn.com/114.114.114.114
server=/tbcache.com/114.114.114.114
server=/tdimg.com/114.114.114.114
server=/tencent.com/114.114.114.114
server=/thawte.com/114.114.114.114
server=/tmall.com/114.114.114.114
server=/tudou.com/114.114.114.114
server=/tudouui.com/114.114.114.114
server=/weibo.com/114.114.114.114
server=/wrating.com/114.114.114.114
server=/xiami.com/114.114.114.114
server=/xiami.net/114.114.114.114
server=/xunlei.com/114.114.114.114
server=/ykimg.com/114.114.114.114
server=/youku.com/114.114.114.114&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
resolvconf的作用就是 managing multiple DNS configurations，要不然resolv.conf配置全乱了，第一个都不是我们想要的127.0.0.1。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
resolvconf配置如下。&lt;/div&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: #f0f6e9; border: 1px dashed rgb(178, 210, 129); font-family: &#39;Courier New&#39;, Courier, monospace, Fixed; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 5px 10px;&quot;&gt;resolv_conf=/etc/resolv.conf
name_servers=127.0.0.1&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
用了resolvconf之后，我们自动生成的resolv.conf配置大概如下：&lt;/div&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: #f0f6e9; border: 1px dashed rgb(178, 210, 129); font-family: &#39;Courier New&#39;, Courier, monospace, Fixed; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 5px 10px;&quot;&gt;[23:46:30] roowe@roowe-gentoo /tmp$ cat /etc/resolv.conf 
# Generated by resolvconf
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
最后/etc/init.d/dnsmasq start下，就可以用了。也可以作为服务项加入自启动里面。&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-3&quot; style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;h3 id=&quot;sec-3&quot; style=&quot;font-size: 16px; margin: 0px; padding: 0px;&quot;&gt;
后话&lt;/h3&gt;
&lt;div id=&quot;text-3&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
科学上网，为国争光。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
现在我们nslookup的结果大概如下。&lt;/div&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: #f0f6e9; border: 1px dashed rgb(178, 210, 129); font-family: &#39;Courier New&#39;, Courier, monospace, Fixed; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 5px 10px;&quot;&gt;[23:52:46] roowe@roowe-gentoo /tmp$ nslookup twitter.com
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   twitter.com
Address: 199.59.150.39
Name:   twitter.com
Address: 199.59.150.7
Name:   twitter.com
Address: 199.59.148.10&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-4&quot; style=&quot;background-color: #fcfff6; color: #333333; font-family: 微软雅黑, 宋体, Arial, Verdana, arial, serif; font-size: 14px; line-height: 20px; margin: 0px; padding: 0px;&quot;&gt;
&lt;h3 id=&quot;sec-4&quot; style=&quot;font-size: 16px; margin: 0px; padding: 0px;&quot;&gt;
Update:&lt;/h3&gt;
&lt;div id=&quot;text-4&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div id=&quot;outline-container-4-1&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;h4 id=&quot;sec-4-1&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
2012-07-05 Thu&lt;/h4&gt;
&lt;div id=&quot;text-4-1&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
由于换工作室了，我又舍不得将自己的电脑搬过来，因为周六日回去华师宿舍的时候，没有电脑玩是很蛋疼的事情，这个时候就突然想拥有台笔记本咯。在这边的工 作室，我就用着我们之前作为服务器的机子，机子虽破，少开几个google-chrome的TAB和不打开eclipse，应该还是能用的。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
说回正题，这边服务器是之前安装的fedora16,用了gentoo之后，发现fedora很多包都更新得很慢，我虽然不是很热衷于新版本，但是现在有 些新版本的feture是我需要呀，比如Xfce按住Alt+Tab之后的左右方向键在xfce-4.9是有效，但是在4.8版本是没有用的，囧！还有 Emacs还没有升级到24呀。想到这里，我就想马上搬我的电脑过来用gentoo。除了更新慢之外,还有些包没有，比如resolvconf这个包竟然 没有。所以就没法管理resolv.conf了，但是为了使用dnsmasq，还是有办法的，在 /etc/sysconfig/network-scripts/ifcfg-p33p1（这个文件是我的，找你相应的）这个文件后面添加 DNS1=127.0.0.1，然后/etc/init.d/network restart下就好了。PS：我没用NetworkManager，这货坑爹的，直接用network来管理。&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 10px; padding: 0px;&quot;&gt;
&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;原文&lt;/strong&gt;：&lt;a href=&quot;http://www.iroowe.com/fuck_the_dns_pullution/&quot; style=&quot;color: #0b75b6; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;http://www.iroowe.com/fuck_the_dns_pullution/&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xmzhao.blogspot.com/feeds/8570805306565530303/comments/default' title='博文评论'/><link rel='replies' type='text/html' href='http://xmzhao.blogspot.com/2012/08/dns.html#comment-form' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/8570805306565530303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2449219125291160382/posts/default/8570805306565530303'/><link rel='alternate' type='text/html' href='http://xmzhao.blogspot.com/2012/08/dns.html' title='如何不受DNS污染'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14535573121238076510</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>中国陕西省延安市延长县二道街</georss:featurename><georss:point>36.580051 110.01183</georss:point><georss:box>36.172057499999994 109.380116 36.9880445 110.643544</georss:box></entry></feed>