{"id":357,"date":"2025-11-10T12:00:56","date_gmt":"2025-11-10T04:00:56","guid":{"rendered":"https:\/\/qkd.koudaipc.com\/?p=357"},"modified":"2025-11-10T12:00:56","modified_gmt":"2025-11-10T04:00:56","slug":"%e4%b8%baopenwrt%e6%b7%bb%e5%8a%a0%e5%a4%96%e6%8e%a5%e7%a1%ac%e7%9b%98","status":"publish","type":"post","link":"https:\/\/qkd.koudaipc.com\/en\/2025\/11\/10\/%e4%b8%baopenwrt%e6%b7%bb%e5%8a%a0%e5%a4%96%e6%8e%a5%e7%a1%ac%e7%9b%98\/","title":{"rendered":"\u4e3aOpenWrt\u6dfb\u52a0\u5916\u63a5\u786c\u76d8"},"content":{"rendered":"<p>\u4e3aOpenWrt\u6dfb\u52a0\u5916\u63a5\u786c\u76d8\uff0c\u80fd\u8ba9\u8def\u7531\u5668\u53d8\u8eab\u8f7b\u91cf\u7ea7\u7684\u5bb6\u5eadNAS\u3002\u64cd\u4f5c\u524d\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684OpenWrt\u8bbe\u5907<strong>USB\u63a5\u53e3\u548c\u4f9b\u7535\u5145\u8db3<\/strong>\uff08\u79fb\u52a8\u786c\u76d8\u53ef\u80fd\u9700\u8981\u989d\u5916\u4f9b\u7535\uff09\uff0c\u5e76\u5df2<strong>\u5b89\u88c5\u5fc5\u8981\u9a71\u52a8\u548c\u8f6f\u4ef6\u5305<\/strong>\u3002<\/p>\n<p>\u4e0b\u9762\u8868\u683c\u6c47\u603b\u4e86\u4e3b\u8981\u6b65\u9aa4\u548c\u8981\u70b9\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">\u6b65\u9aa4<\/th>\n<th style=\"text-align: left;\">\u6838\u5fc3\u64cd\u4f5c<\/th>\n<th style=\"text-align: left;\">\u5173\u952e\u70b9\/\u547d\u4ee4<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>1. \u5b89\u88c5\u57fa\u7840\u7ec4\u4ef6<\/strong><\/td>\n<td style=\"text-align: left;\">\u5b89\u88c5USB\u3001\u6587\u4ef6\u7cfb\u7edf\u3001\u6302\u8f7d\u5de5\u5177<\/td>\n<td style=\"text-align: left;\"><code>kmod-usb-core<\/code>, <code>kmod-usb-storage<\/code>, <code>kmod-fs-xxx<\/code> (\u5982<code>kmod-fs-ext4<\/code>, <code>kmod-fs-ntfs3<\/code>), <code>block-mount<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>2. \u8fde\u63a5\u4e0e\u8bc6\u522b\u786c\u76d8<\/strong><\/td>\n<td style=\"text-align: left;\">\u8fde\u63a5\u786c\u76d8\uff0c\u68c0\u67e5\u7cfb\u7edf\u662f\u5426\u8bc6\u522b<\/td>\n<td style=\"text-align: left;\"><code>ls \/dev\/sd*<\/code> \u6216 <code>fdisk -l<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>3. \u624b\u52a8\u6302\u8f7d\u6d4b\u8bd5<\/strong><\/td>\n<td style=\"text-align: left;\">\u521b\u5efa\u76ee\u5f55\u5e76\u6302\u8f7d\uff0c\u6d4b\u8bd5\u57fa\u7840\u529f\u80fd<\/td>\n<td style=\"text-align: left;\"><code>mkdir -p \/mnt\/usb<\/code> <br \/> <code>mount \/dev\/sda1 \/mnt\/usb<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>4. \u914d\u7f6e\u81ea\u52a8\u6302\u8f7d<\/strong><\/td>\n<td style=\"text-align: left;\">\u901a\u8fc7Web\u754c\u9762\u6216\u811a\u672c\u5b9e\u73b0\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/td>\n<td style=\"text-align: left;\"><strong>Web\u754c\u9762 (\u63a8\u8350)<\/strong>: &quot;\u7cfb\u7edf&quot; -&gt; &quot;\u6302\u8f7d\u70b9&quot;  <br \/> <strong>\u811a\u672c\u65b9\u5f0f<\/strong>: \u7f16\u8f91 <code>\/etc\/hotplug.d\/block\/10-mount<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>5. \u9ad8\u7ea7\u5e94\u7528 (\u53ef\u9009)<\/strong><\/td>\n<td style=\"text-align: left;\">\u914d\u7f6e\u4ea4\u6362\u5206\u533a\u6216Samba\u5171\u4eab<\/td>\n<td style=\"text-align: left;\"><strong>\u4ea4\u6362\u6587\u4ef6<\/strong>: <code>dd<\/code>\u521b\u5efa\u6587\u4ef6 -&gt; <code>mkswap<\/code> -&gt; <code>swapon<\/code>  <br \/> <strong>Samba\u5171\u4eab<\/strong>: \u5b89\u88c5 <code>samba4-server<\/code> \u548c Luci\u5e94\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\ud83d\udd27 \u64cd\u4f5c\u6307\u5357<\/h3>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305<\/strong><br \/>\n\u9996\u5148\uff0c\u9700\u8981\u901a\u8fc7SSH\u8fde\u63a5\u5230OpenWrt\uff0c\u66f4\u65b0\u8f6f\u4ef6\u5217\u8868\u5e76\u5b89\u88c5\u57fa\u7840\u5305\u3002\u4e0d\u540c\u6587\u4ef6\u7cfb\u7edf\u9700\u8981\u4e0d\u540c\u7684\u5185\u6838\u6a21\u5757\uff1a<\/p>\n<ul>\n<li><strong>EXT4<\/strong>: <code>kmod-fs-ext4<\/code><\/li>\n<li><strong>NTFS<\/strong>: <code>kmod-fs-ntfs<\/code> \u6216\u6027\u80fd\u66f4\u597d\u7684 <code>kmod-fs-ntfs3<\/code> <\/li>\n<li><strong>FAT\/VFAT<\/strong>: <code>kmod-fs-vfat<\/code> <\/li>\n<li><strong>exFAT<\/strong>: <code>kmod-fs-exfat<\/code> <\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fde\u63a5\u786c\u76d8\u5e76\u68c0\u67e5\u8bc6\u522b<\/strong><br \/>\n\u8fde\u63a5\u786c\u76d8\u540e\uff0c\u4f7f\u7528 <code>fdisk -l<\/code> \u547d\u4ee4\u6765\u67e5\u770b\u6240\u6709\u5b58\u50a8\u8bbe\u5907\uff0c\u627e\u5230\u4f60\u7684\u5916\u63a5\u786c\u76d8\u53ca\u5176\u5206\u533a\uff08\u4f8b\u5982 <code>\/dev\/sda1<\/code>\uff09\u3002\u4f7f\u7528 <code>ls \/dev\/sd*<\/code> \u662f\u66f4\u5feb\u6377\u7684\u67e5\u770b\u65b9\u6cd5 \u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u624b\u52a8\u6302\u8f7d\u6d4b\u8bd5<\/strong><br \/>\n\u5efa\u8bae\u5148\u624b\u52a8\u6302\u8f7d\uff0c\u9a8c\u8bc1\u4e00\u5207\u6b63\u5e38\uff1a<\/p>\n<pre><code class=\"language-bash\"># \u521b\u5efa\u6302\u8f7d\u70b9\u76ee\u5f55\nmkdir -p \/mnt\/usb\n# \u624b\u52a8\u6302\u8f7d\u786c\u76d8\nmount \/dev\/sda1 \/mnt\/usb\n# \u68c0\u67e5\u662f\u5426\u6302\u8f7d\u6210\u529f\ndf -h<\/code><\/pre>\n<p>\u5982\u679c\u80fd\u770b\u5230 <code>\/mnt\/usb<\/code> \u5e76\u663e\u793a\u5bb9\u91cf\uff0c\u8bf4\u660e\u6302\u8f7d\u6210\u529f \u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u81ea\u52a8\u6302\u8f7d (\u4e24\u79cd\u65b9\u6cd5)<\/strong><\/p>\n<ul>\n<li><strong>\u901a\u8fc7Web\u754c\u9762 (\u6700\u7b80\u4fbf) <\/strong>:<br \/>\n\u8fdb\u5165OpenWrt\u7684Web\u7ba1\u7406\u754c\u9762\uff0c\u627e\u5230&quot;\u7cfb\u7edf&quot; -&gt; &quot;\u6302\u8f7d\u70b9&quot;\u3002\u5728&quot;\u6302\u8f7d\u70b9&quot;\u533a\u57df\u70b9\u51fb&quot;\u6dfb\u52a0&quot;\uff0c\u5728&quot;UUID&quot;\u5904\u9009\u62e9\u4f60\u7684\u786c\u76d8\u5206\u533a\uff0c\u5728&quot;\u6302\u8f7d\u70b9&quot;\u5904\u586b\u5199\u81ea\u5b9a\u4e49\u8def\u5f84\uff08\u5982 <code>\/mnt\/usb<\/code>\uff09\uff0c\u7136\u540e\u52fe\u9009&quot;\u5df2\u542f\u7528&quot;\uff0c\u6700\u540e&quot;\u4fdd\u5b58\u5e76\u5e94\u7528&quot;\u3002<br \/>\n<strong>\u5c0f\u6280\u5de7<\/strong>\uff1a\u5bf9\u4e8eNTFS\u6587\u4ef6\u7cfb\u7edf\uff0c\u5982\u679c\u9047\u5230\u65ad\u7535\u540e\u786c\u76d8\u56e0&quot;\u810f\u72b6\u6001&quot;\u65e0\u6cd5\u81ea\u52a8\u6302\u8f7d\uff0c\u53ef\u4ee5\u5728\u6302\u8f7d\u9009\u9879\u91cc\u586b\u5199 <code>force,iocharset=utf8<\/code> \u6765\u89e3\u51b3\u5e76\u786e\u4fdd\u4e2d\u6587\u663e\u793a\u6b63\u5e38 \u3002<\/li>\n<li><strong>\u901a\u8fc7\u811a\u672c (\u66f4\u7075\u6d3b) <\/strong>:<br \/>\n\u5bf9\u4e8e\u4e0d\u652f\u6301Web\u754c\u9762\u914d\u7f6e\u7684\u8001\u7248\u672c\uff0c\u53ef\u4ee5\u7f16\u8f91 <code>\/etc\/hotplug.d\/block\/10-mount<\/code> \u8fd9\u4e2a\u6587\u4ef6\uff0c\u5b9e\u73b0\u786c\u76d8\u63d2\u4e0a\u65f6\u81ea\u52a8\u6302\u8f7d\uff0c\u62d4\u51fa\u65f6\u81ea\u52a8\u5378\u8f7d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\ud83d\ude80 \u9ad8\u7ea7\u5e94\u7528<\/h3>\n<ul>\n<li>\n<p><strong>\u542f\u7528\u4ea4\u6362\u5206\u533a\/\u6587\u4ef6<\/strong>\uff1a\u5982\u679c\u4f60\u7684\u8def\u7531\u5668\u5185\u5b58\u8f83\u5c0f\uff0c\u53ef\u4ee5\u5728\u786c\u76d8\u4e0a\u521b\u5efa\u4ea4\u6362\u6587\u4ef6\u6765\u6269\u5c55\u865a\u62df\u5185\u5b58 \u3002<\/p>\n<pre><code class=\"language-bash\"># \u521b\u5efa\u4e00\u4e2a512MB\u7684\u4ea4\u6362\u6587\u4ef6\ndd if=\/dev\/zero of=\/mnt\/usb\/swapfile bs=1M count=512\n# \u683c\u5f0f\u5316\u6b64\u6587\u4ef6\u4e3a\u4ea4\u6362\u5206\u533a\nmkswap \/mnt\/usb\/swapfile\n# \u7acb\u5373\u542f\u7528\u4ea4\u6362\u6587\u4ef6\nswapon \/mnt\/usb\/swapfile<\/code><\/pre>\n<p>\u4e4b\u540e\uff0c\u540c\u6837\u53ef\u4ee5\u5728Web\u754c\u9762&quot;\u7cfb\u7edf&quot;-&gt;&quot;\u6302\u8f7d\u70b9&quot;-&gt;&quot;\u4ea4\u6362\u5206\u533a&quot;\u4e2d\u6dfb\u52a0 <code>\/mnt\/usb\/swapfile<\/code> \u4f7f\u5176\u5f00\u673a\u81ea\u52a8\u542f\u7528 \u3002<\/p>\n<blockquote>\n<p>\u6ce8\uff1a\u4f7f\u7528\u786c\u76d8\u4e0a\u7684\u4ea4\u6362\u6587\u4ef6\u53ef\u80fd\u4f1a\u5f71\u54cd\u786c\u76d8\u4f11\u7720 \u3002<\/p>\n<\/blockquote>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6eSamba\u7f51\u7edc\u5171\u4eab<\/strong>\uff1a\u8fd9\u662f\u5c06\u786c\u76d8\u53d8\u6210\u5c40\u57df\u7f51\u5171\u4eab\u5b58\u50a8\u7684\u5173\u952e\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5Samba\u8f6f\u4ef6\u5305\uff1a<code>samba4-server<\/code> \u548c\u5bf9\u5e94\u7684Luci\u914d\u7f6e\u754c\u9762 <code>luci-app-samba4<\/code> \u3002<\/li>\n<li>\u5728Web\u754c\u9762&quot;\u670d\u52a1&quot;-&gt;&quot;\u7f51\u7edc\u5171\u4eab&quot;\u4e2d\u6dfb\u52a0\u5171\u4eab\u76ee\u5f55\uff0c\u6307\u5b9a\u8def\u5f84\u4e3a\u4f60\u7684\u6302\u8f7d\u70b9\uff08\u5982 <code>\/mnt\/usb<\/code>\uff09\uff0c\u5e76\u8bbe\u7f6e\u5141\u8bb8\u8bbf\u95ee\u7684\u7528\u6237 \u3002<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<h3>\ud83d\udca1 \u5b9e\u7528\u547d\u4ee4\u4e0e\u63d0\u793a<\/h3>\n<ul>\n<li><strong>\u67e5\u770b\u78c1\u76d8\u4fe1\u606f<\/strong>\uff1a<code>lsblk<\/code> \u6216 <code>blkid \/dev\/sda1<\/code> (\u67e5\u770bUUID) <\/li>\n<li><strong>\u5378\u8f7d\u786c\u76d8<\/strong>\uff1a<code>umount \/mnt\/usb<\/code><\/li>\n<li><strong>\u91cd\u8981\u5efa\u8bae<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528 <strong>UUID<\/strong> \u800c\u975e\u8bbe\u5907\u540d\uff08\u5982 <code>\/dev\/sda1<\/code>\uff09\u8fdb\u884c\u6302\u8f7d\u914d\u7f6e\uff0c\u56e0\u4e3a\u8bbe\u5907\u540d\u53ef\u80fd\u5728\u91cd\u542f\u540e\u53d1\u751f\u53d8\u5316\uff0c\u800cUUID\u662f\u552f\u4e00\u7684 \u3002<\/li>\n<li>\u786e\u4fdd\u4f60\u7684OpenWrt\u8bbe\u5907\u80fd\u4e3a\u5916\u63a5\u786c\u76d8\u63d0\u4f9b<strong>\u5145\u8db3\u7684\u4f9b\u7535<\/strong>\uff0c\u5426\u5219\u53ef\u80fd\u5bfc\u81f4\u786c\u76d8\u65e0\u6cd5\u8bc6\u522b\u6216\u5de5\u4f5c\u4e0d\u7a33\u5b9a\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u5e0c\u671b\u8fd9\u4efd\u6307\u5357\u80fd\u5e2e\u52a9\u4f60\u987a\u5229\u6269\u5c55OpenWrt\u7684\u5b58\u50a8\u80fd\u529b\u3002\u5982\u679c\u4f60\u5728\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u9047\u5230\u5177\u4f53\u95ee\u9898\uff0c\u4f8b\u5982\u67d0\u4e2a\u6b65\u9aa4\u62a5\u9519\uff0c\u6b22\u8fce\u968f\u65f6\u8ffd\u95ee\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u4e3aOpenWrt\u6dfb\u52a0\u5916\u63a5\u786c\u76d8\uff0c\u80fd\u8ba9\u8def\u7531\u5668\u53d8\u8eab\u8f7b\u91cf\u7ea7\u7684\u5bb6\u5eadNAS\u3002\u64cd\u4f5c\u524d\uff0c\u8bf7\u786e\u4fdd\u4f60\u7684OpenWrt\u8bbe\u5907USB\u63a5\u53e3 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","footnotes":""},"categories":[23],"tags":[],"class_list":["post-357","post","type-post","status-publish","format-standard","hentry","category-kpcos","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":1,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"predecessor-version":[{"id":358,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/357\/revisions\/358"}],"wp:attachment":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}