<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>samba &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/samba/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Thu, 15 Apr 2021 06:28:39 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Windows 10 存取 Ubuntu Samba 問題</title>
		<link>https://richliu.com/2021/04/15/4453/windows-10-%e5%ad%98%e5%8f%96-ubuntu-samba-%e5%95%8f%e9%a1%8c/</link>
					<comments>https://richliu.com/2021/04/15/4453/windows-10-%e5%ad%98%e5%8f%96-ubuntu-samba-%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 15 Apr 2021 06:28:38 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ntlm]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[windows 10]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4453</guid>

					<description><![CDATA[<p>不知道是不是公司控管電腦的問題，我公司的電腦一直沒辦法存取 Samba 的目錄 今天終於下定決定找一找可能是什 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/04/15/4453/windows-10-%e5%ad%98%e5%8f%96-ubuntu-samba-%e5%95%8f%e9%a1%8c/">Windows 10 存取 Ubuntu Samba 問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>不知道是不是公司控管電腦的問題，我公司的電腦一直沒辦法存取 Samba 的目錄<br /><br />今天終於下定決定找一找可能是什麼問題</p>



<span id="more-4453"></span>



<p>先在 /etc/sambs/smb.conf 加上</p>



<pre class="wp-block-code"><code>log level = 3 </code></pre>



<p>之後，重啟 nmb/smb server</p>



<pre class="wp-block-code"><code>systemctl restart nmbd
systemctl restart nmbd</code></pre>



<p>看到了  /var/log/samba/log.smbd 中的一段錯誤訊息</p>



<p>2021/04/15 12:11:11.313142, 3] ../lib/util/access.c:365(allow_access)<br />Allowed connection from 192.168.1.184 (192.168.1.184)<br />[2021/04/15 12:11:11.323575, 3] ../source3/lib/util_procid.c:54(pid_to_procid)<br />pid_to_procid: messaging_dgm_get_unique failed: No such file or directory<br />[2021/04/15 12:11:17.274381, 3] ../lib/util/access.c:365(allow_access)<br />Allowed connection from 192.168.1.184 (192.168.1.184)<br />[2021/04/15 12:11:17.289554, 3] ../source3/lib/util_procid.c:54(pid_to_procid)<br />pid_to_procid: messaging_dgm_get_unique failed: No such file or directory</p>



<p>跟劇此線索找到了有人提到，要修改 Windows Local Security Policy (secpol.msc) , 找到 Security Settings->Local Policies->Security Options->”Network security: LAN Manager authentication level.” Set it to “Send LM &amp; NTLM – use NTLMv2 session security if negotiated.” 或是改 register file <br /></p>



<pre class="wp-block-code"><code>Windows Registry Editor Version 5.00

&#91;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"LmCompatibilityLevel"=dword:00000001</code></pre>



<p>註：ntlm auth = yes 也要開，修改 /etc/samba/smb.conf ，然後重啟 nmbd/smbd</p>



<pre class="wp-block-code"><code>&#91;global]
ntlm auth = yes</code></pre>



<p>ref.<br />Samba and ntlm for Windows clients</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/04/15/4453/windows-10-%e5%ad%98%e5%8f%96-ubuntu-samba-%e5%95%8f%e9%a1%8c/">Windows 10 存取 Ubuntu Samba 問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/04/15/4453/windows-10-%e5%ad%98%e5%8f%96-ubuntu-samba-%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] 裝 Brother HL-2240D Driver + Samba 分享</title>
		<link>https://richliu.com/2014/10/13/1681/gentoo-%e8%a3%9d-brother-hl-2240d-driver-samba-%e5%88%86%e4%ba%ab/</link>
					<comments>https://richliu.com/2014/10/13/1681/gentoo-%e8%a3%9d-brother-hl-2240d-driver-samba-%e5%88%86%e4%ba%ab/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 12 Oct 2014 16:28:33 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[HL-2240D]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[samba]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=1681</guid>

					<description><![CDATA[<p>Linux 支援 Brother HD-2240D driver 可以用 Samba + CUPS 提供服務. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2014/10/13/1681/gentoo-%e8%a3%9d-brother-hl-2240d-driver-samba-%e5%88%86%e4%ba%ab/">[Gentoo] 裝 Brother HL-2240D Driver + Samba 分享</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Linux 支援 Brother HD-2240D driver 可以用 Samba + CUPS 提供服務.</p>
<p><span id="more-1681"></span></p>
<p>1. 首先打開 Linux kernel 對 USB print driver 的支援<br />
我是用 genkernel , 所以預設是沒有支援的</p>
<p>Device Drivers &#8212;&gt;<br />
[*] USB support &#8212;&gt;<br />
&lt;m&gt; USB Printer support ==&gt; 選擇<br />
重編 kernel<br />
# genkernel &#8211;no-clean &#8211;no-mrproper all</p>
<p>2. 開機預設 insert usblp driver<br />
# vim /etc/conf.d/modules<br />
加上 usblp</p>
<p>3. 編輯 /etc/portage/package.use 替 CUPS 加上 usb support, 替 samba 加上 cups 支援</p>
<p>sys-print/cups -php usb<br />
net-fs/samba cups</p>
<p># emerge samba cups</p>
<p>記得重啟 cups 和 samba</p>
<p>4. 下載 HL-2240D Driver<br />
<a href="http://support.brother.com/g/b/downloadtop.aspx?c=eu_ot&amp;lang=en&amp;prod=hl2240d_all" target="_blank" rel="noopener">HL-2240D Driver Download</a><br />
我是下載 source code</p>
<p>5. 將印表機開機並插上 Linux 機器,<br />
執行 lpinfo -v</p>
<p># lpinfo -v<br />
network https<br />
network socket<br />
network ipp<br />
network http<br />
network lpd<br />
network ipps<br />
direct usb://Brother/HL-2240D%20series<br />
network smb</p>
<p>如果沒有出現 direct usb://Brother/HL-2240D%20series, 可以看看 usblp 和 cups usb 支援有沒有設好.</p>
<p>6. 解開 Driver 後執行 cupswrapperHL2240D-2.0.4, 這個程式會安裝 HL2240D.ppd 到 /usr/share/cups/model<br />
並且設定好 HL2240D 的印表機.</p>
<p>如果手動設定無效, 可以試試看到/usr/share/cups/model 下執行<br />
# lpadmin -p HL2240D -E -v usb://Brother/HL-2240D%20series -P HL2240D.ppd</p>
<p>7. 查看結果<br />
# lpstat -a<br />
HL2240D accepting requests since Sun Oct 12 22:21:45 2014</p>
<p>8. 編輯 /etc/samba/smb.conf 加上<br />
[printers]<br />
comment = Brother printers<br />
path = /var/spool/samba<br />
browseable = no<br />
guest ok = no<br />
writable = no<br />
printable = yes<br />
public = yes<br />
printer name = HL2240D</p>
<p>重啟 samba.</p>
<p>9. 在 windows 下載 Driver, 解壓之後內有 driver<br />
<a href="http://support.brother.com/g/b/downloadtop.aspx?c=eu_ot&amp;lang=en&amp;prod=hl2240d_all" target="_blank" rel="noopener">HL-2240D Driver Download</a></p>
<p>在網芳可以看到 hl-2240d 的目錄, 可以選連線後選擇要安裝的 Driver.</p>
<p>ref.<br />
<a href="http://wiki.gentoo.org/wiki/Printing" target="_blank" rel="noopener">Gentoo Print Guide </a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2014/10/13/1681/gentoo-%e8%a3%9d-brother-hl-2240d-driver-samba-%e5%88%86%e4%ba%ab/">[Gentoo] 裝 Brother HL-2240D Driver + Samba 分享</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2014/10/13/1681/gentoo-%e8%a3%9d-brother-hl-2240d-driver-samba-%e5%88%86%e4%ba%ab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu Disable Broadcast Packet</title>
		<link>https://richliu.com/2012/05/08/1220/ubuntu-disable-broadcast-packet/</link>
					<comments>https://richliu.com/2012/05/08/1220/ubuntu-disable-broadcast-packet/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 08 May 2012 03:33:51 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[17500]]></category>
		<category><![CDATA[broadcast]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[udp]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=1220</guid>

					<description><![CDATA[<p>一直以來都錯怪 Ubuntu 了&#8230; 一般狀況之下, 我都以為 Ubuntu broadcast 是 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2012/05/08/1220/ubuntu-disable-broadcast-packet/">Ubuntu Disable Broadcast Packet</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>一直以來都錯怪 Ubuntu 了&#8230;</p>
<p>一般狀況之下, 我都以為 Ubuntu broadcast 是不能關的(不知道怎麼關),<br />
今天花了一點時間才發現, 人不是 Ubuntu 殺的.</p>
<p><span id="more-1220"></span></p>
<p>首先是這個 UDP Port 17500 的 Packet.<br />
這其實是 Dropbox Local Sync 的 Packet, 只要關掉 Dropbox local sync 的 function 就可以關掉這種封包.</p>
<p><a title="UDP17500 by richliu(有錢劉), on Flickr" href="http://www.flickr.com/photos/richliu_tw/7155729976/" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" src="http://farm9.staticflickr.com/8141/7155729976_3c9827553d.jpg" alt="UDP17500" width="500" height="193" /></a></p>
<p>另一種是 SAMBA Broadcast 封包, 像這樣.<br />
<a title="SAMBA4 by richliu(有錢劉), on Flickr" href="http://www.flickr.com/photos/richliu_tw/7155755816/" target="_blank" rel="noopener"><img decoding="async" src="http://farm8.staticflickr.com/7225/7155755816_38d2610b76.jpg" alt="SAMBA4" width="500" height="213" /></a></p>
<p>這個我是關掉 Samba 的 Interface 和 LAN manager function<br />
編輯檔案 /etc/samba/smb.conf, 在 [Global] 區域內加上</p>
<p>[TEXT]<br />
[Global]<br />
lm announce = no<br />
interfaces = eth0 eth2 -> 拿掉你不想要 broadcast 的 interface.<br />
[/TEXT]</p>
<p>如果不想要執行 Samba , 可以試試看用指令<br />
[BASH]<br />
# service samba stop<br />
or<br />
# service samba4 stop<br />
[/BASH]<br />
讓 Samba 停下來, 不過在我的 ubuntu 8.04 內是停不下來的&#8230;.</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2012/05/08/1220/ubuntu-disable-broadcast-packet/">Ubuntu Disable Broadcast Packet</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2012/05/08/1220/ubuntu-disable-broadcast-packet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Windows 7 存取 Linux Samba 網芳的小問題.</title>
		<link>https://richliu.com/2010/07/21/968/windows-7-%e5%ad%98%e5%8f%96-linux-samba-%e7%b6%b2%e8%8a%b3%e7%9a%84%e5%b0%8f%e5%95%8f%e9%a1%8c/</link>
					<comments>https://richliu.com/2010/07/21/968/windows-7-%e5%ad%98%e5%8f%96-linux-samba-%e7%b6%b2%e8%8a%b3%e7%9a%84%e5%b0%8f%e5%95%8f%e9%a1%8c/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 21 Jul 2010 01:21:08 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[netbios name]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[workgroup]]></category>
		<category><![CDATA[網路芳鄰]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=968</guid>

					<description><![CDATA[<p>改用 Windows 7 之後, 使用網芳直接用 netbios name 去存取 Server 會有問題.  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/07/21/968/windows-7-%e5%ad%98%e5%8f%96-linux-samba-%e7%b6%b2%e8%8a%b3%e7%9a%84%e5%b0%8f%e5%95%8f%e9%a1%8c/">Windows 7 存取 Linux Samba 網芳的小問題.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>改用 Windows 7 之後, 使用網芳直接用 netbios name 去存取 Server 會有問題. </p>
<p>雖然在網路上看的到名稱, 但是卻無法直接存取, 會出現錯誤訊息</p>
<p>例如<br />
\\SERVER : Fail<br />
\\10.1.1.254 : OK</p>
<p>這個時候就要直接去改 /etc/samba/smb.conf<br />
加上一行 netbios name 就可以,<br />
[TEXT]<br />
   workgroup = WORKGROUP<br />
   netbios name = SERVER<br />
[/TEXT]</p>
<p>順便寫一下我的版本<br />
Windows 7 64bit<br />
Samba 3.5.4</p>
<p>好小的問題 -_-!</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/07/21/968/windows-7-%e5%ad%98%e5%8f%96-linux-samba-%e7%b6%b2%e8%8a%b3%e7%9a%84%e5%b0%8f%e5%95%8f%e9%a1%8c/">Windows 7 存取 Linux Samba 網芳的小問題.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2010/07/21/968/windows-7-%e5%ad%98%e5%8f%96-linux-samba-%e7%b6%b2%e8%8a%b3%e7%9a%84%e5%b0%8f%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[Mac] TimeMachine 備份到 Samba Disk 上.</title>
		<link>https://richliu.com/2010/05/16/930/mac-timemachine-%e5%82%99%e4%bb%bd%e5%88%b0-samba-disk-%e4%b8%8a/</link>
					<comments>https://richliu.com/2010/05/16/930/mac-timemachine-%e5%82%99%e4%bb%bd%e5%88%b0-samba-disk-%e4%b8%8a/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 15 May 2010 20:10:44 +0000</pubDate>
				<category><![CDATA[MAC]]></category>
		<category><![CDATA[network disk]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[TimeMachine]]></category>
		<category><![CDATA[網芳]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=930</guid>

					<description><![CDATA[<p>TimeMachine 預設只能備份到外接硬碟和 Time Capsule 上. 對我們這種人不好用, 只要開 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/05/16/930/mac-timemachine-%e5%82%99%e4%bb%bd%e5%88%b0-samba-disk-%e4%b8%8a/">[Mac] TimeMachine 備份到 Samba Disk 上.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>TimeMachine 預設只能備份到外接硬碟和 Time Capsule 上.</p>
<p>對我們這種人不好用, 只要開 Console 然後執行以下這一行<br />
[Text]<br />
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1<br />
[/Text]</p>
<p>就可以拿網路磁碟機做 TimeMachine 備份磁碟<br />
<span id="more-930"></span><br />
不過不知道什麼原因，並不像網路上寫的這樣，事實上可能還是需要更多步驟的<br />
如果無法自動備份, 在 console(xxxx) 出現類似的字串<br />
[Text]<br />
2010/5/15 下午11:42:55	com.apple.backupd[1628]	Failed to create disk image /Volumes/TimeMachine-1/rl-mbp.sparsebundle, status: -5000<br />
2010/5/15 下午11:43:00	com.apple.backupd[1628]	Backup failed with error: 20<br />
[/Text]</p>
<p>可以按照這個步驟進行</p>
<p>1. 修改機器名稱.<br />
在 System Preferences -＞Internet &#038; Wireless -> Sharing -> Computer Name<br />
改個簡單一點的，像是 rl-mbp 之類的. </p>
<p>2. 找出 Mac Address<br />
在 Terminal 下執行 Bash Command<br />
[Bash]<br />
$ ifconfig en0 | grep ether<br />
	ether 58:11:22:33:44:55<br />
[/Bash]</p>
<p>3. 建立 ＴimeMachine 用的目錄<br />
[Bash]<br />
$hdiutil create -size <maxsize> -fs HFS+J -type SPARSEBUNDLE <hostname>_<macaddr>.sparsebundle<br />
[/Bash]<br />
以我的為例<br />
[Bash]<br />
$hdiutil create -size 120G -fs HFS+J -type SPARSEBUNDLE rl-mbp_581122334455.sparsebundle<br />
[/Bash]</p>
<p>4. 用 Finder copy 到 Samba 上 TimeStamp 的那個目錄內.</p>
<p>5. 啟動 Time Stamp, 如果原來有不成功的 Time Stamp,  可以在磁碟上選 None 取消之後再重新設定</p>
<p>網路上找到的文章都說不用搞的這麼麻煩, 不過我確確實實還是女搞這一件事.<br />
看起來 Time Machine 有試著去建立目錄，但是失敗．</p>
<p>我想我是用 Snow Leopard 了, 不需要去 care 才對，沒想到還是碰上了</p>
<p>至於要排除那些目錄&#8230; 等有空再回來補完吧 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></macaddr></hostname></maxsize></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2010/05/16/930/mac-timemachine-%e5%82%99%e4%bb%bd%e5%88%b0-samba-disk-%e4%b8%8a/">[Mac] TimeMachine 備份到 Samba Disk 上.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2010/05/16/930/mac-timemachine-%e5%82%99%e4%bb%bd%e5%88%b0-samba-disk-%e4%b8%8a/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</title>
		<link>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/</link>
					<comments>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 11 Dec 2009 13:05:31 +0000</pubDate>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Jumbo Frame]]></category>
		<category><![CDATA[linux kernel]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[samba]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=822</guid>

					<description><![CDATA[<p>如果啟動了 Jumbo Frame 加上執行 Samba , 有可能會出現類似的訊息(系統抓下來似乎有點不全) [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/">[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>如果啟動了 Jumbo Frame 加上執行 Samba , 有可能會出現類似的訊息(系統抓下來似乎有點不全)</p>
<p><span id="more-822"></span></p>
<blockquote><p>smbd: page allocation failure. order:2, mode:0x20<br />
Backtrace:<br />
[&lt;c002fd30&gt;] (dump_backtrace+0x0/0x108) from [&lt;c02ac488&gt;] (dump_stack+0x18/0x1c)<br />
[&lt;c02ac470&gt;] (dump_stack+0x0/0x1c) from [&lt;c0075734&gt;] (__alloc_pages_nodemask+0x3d0/0x55c)<br />
[&lt;c0075364&gt;] (__alloc_pages_nodemask+0x0/0x55c) from [&lt;c008f5d8&gt;] (cache_alloc_refill+0x2b0/0x598)<br />
[&lt;c008f328&gt;] (cache_alloc_refill+0x0/0x598) from [&lt;c008f978&gt;] (__kmalloc+0xb8/0xd8)<br />
[&lt;c008f8c0&gt;] (__kmalloc+0x0/0xd8) from [&lt;c0227a6c&gt;] (__alloc_skb+0x54/0x138)<br />
[&lt;c0227a18&gt;] (__alloc_skb+0x0/0x138) from [&lt;c022879c&gt;] (dev_alloc_skb+0x20/0x44)<br />
[&lt;c022877c&gt;] (dev_alloc_skb+0x0/0x44) from [&lt;c01e643c&gt;] (cns3xxx_receive_packet+0x228/0x3c8)<br />
[&lt;c01e6214&gt;] (cns3xxx_receive_packet+0x0/0x3c8) from [&lt;c01e661c&gt;] (cns3xxx_poll+0x40/0xd4)<br />
[&lt;c01e65dc&gt;] (cns3xxx_poll+0x0/0xd4) from [&lt;c022f264&gt;] (net_rx_action+0xb4/0x184)<br />
[&lt;c022f1b0&gt;] (net_rx_action+0x0/0x184) from [&lt;c0048544&gt;] (__do_softirq+0x90/0x11c)<br />
[&lt;c00484b4&gt;] (__do_softirq+0x0/0x11c) from [&lt;c0048614&gt;] (irq_exit+0x44/0x4c)<br />
[&lt;c00485d0&gt;] (irq_exit+0x0/0x4c) from [&lt;c002b04c&gt;] (_text+0x4c/0x90)<br />
[&lt;c002b000&gt;] (_text+0x0/0x90) from [&lt;c002bab8&gt;] (__irq_svc+0x38/0x80)<br />
Exception stack(0xc7acbcc0 to 0xc7acbd08)<br />
bcc0: c7acbd1c c7829960 c7acbd28 00000000 00000001 c7b53980 c7b539e4 c7acbd1c<br />
bce0: 00000000 00000000 c7acbf08 c7acbd14 c7acbd28 c7acbd08 c0222314 c0057a0c<br />
bd00: 60000013 ffffffff<br />
[&lt;c00579b0&gt;] (finish_wait+0x0/0x6c) from [&lt;c0222314&gt;] (sk_wait_data+0xcc/0xec)<br />
[&lt;c0222248&gt;] (sk_wait_data+0x0/0xec) from [&lt;c0255fc0&gt;] (tcp_recvmsg+0x600/0x8a8)<br />
[&lt;c02559c0&gt;] (tcp_recvmsg+0x0/0x8a8) from [&lt;c0221208&gt;] (sock_common_recvmsg+0x48/0x5c)<br />
[&lt;c02211c0&gt;] (sock_common_recvmsg+0x0/0x5c) from [&lt;c021e7d8&gt;] (sock_aio_read+0x138/0x144)<br />
[&lt;c021e6a0&gt;] (sock_aio_read+0x0/0x144) from [&lt;c0092918&gt;] (do_sync_read+0xc4/0x110)<br />
[&lt;c0092854&gt;] (do_sync_read+0x0/0x110) from [&lt;c00936ac&gt;] (vfs_read+0x164/0x16c)<br />
[&lt;c0093548&gt;] (vfs_read+0x0/0x16c) from [&lt;c0093790&gt;] (sys_read+0x44/0x74)<br />
[&lt;c009374c&gt;] (sys_read+0x0/0x74) from [&lt;c002be40&gt;] (ret_fast_syscall+0x0/0x2c)<br />
Mem-info:<br />
Normal per-cpu:<br />
CPU    0: hi:   42, btch:   7 usd:  32<br />
Active_anon:570 active_file:9598 inactive_anon:576<br />
inactive_file:17657 unevictable:0 dirty:3503 writeback:0 unstable:0<br />
free:419 slab:2389 mapped:1587 pagetables:87 bounce:0<br />
Normal free:1676kB min:1440kB low:1800kB high:2160kB active_anon:2280kB inactive_anon:2304kB active_file:38392kB inactive_file:70628kB unevictable:0kB present:130048kB pages_scanned:0 all_unreclaimable? no<br />
lowmem_reserve[]: 0 0<br />
Normal: 345*4kB 25*8kB 6*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1676kB<br />
27277 total pagecache pages<br />
32768 pages of RAM<br />
543 free pages<br />
1251 reserved pages<br />
2389 slab pages<br />
29382 pages shared<br />
0 pages swap cached</p></blockquote>
<p>可以加大 kernel 預留的 Buffer, 我系統上原來是 1117, 可以用指令</p>
<p><strong>echo 8192 &gt; /proc/sys/vm/min_free_kbytes</strong><strong><br />
</strong></p>
<p>加大到 8Mbytes, 這樣可以減少 page allocation 失敗的機率, 在我們的測試內, 某些時候 8MByte 仍會出現, 可以考慮加大到 16Mbytes.</p>
<p>原因是因為在 interrupt 中, 向系統一次要求大塊的記憶體. 這時可以透過增加 min_free_kbytes 參數去避過這個問題.<br />
調整 slab 的參數或許也有用  ( echo x y z &gt; /proc/slab)</p>
<p>Ref.<br />
http://lime-technology.com/forum/index.php?topic=3999.0<br />
http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-01/0059.html</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/">[Linux][Kernel][Memory] smbd: page allocation failure. order:2, mode:0x20</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2009/12/11/822/%e8%a8%98%e6%86%b6%e9%ab%94%e5%95%8f%e9%a1%8c-smbd-page-allocation-failure-order2-mode0x20/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
