{"id":1034,"date":"2022-01-24T11:27:13","date_gmt":"2022-01-24T03:27:13","guid":{"rendered":"https:\/\/aichh.com\/?p=1034"},"modified":"2022-02-09T09:25:20","modified_gmt":"2022-02-09T01:25:20","slug":"1034","status":"publish","type":"post","link":"https:\/\/aichh.com\/1034.html","title":{"rendered":"openwrt\u4f7f\u7528\u5916\u90e8\u5b58\u50a8extroot,\u6269\u5bb9\u8f6f\u4ef6\u5b89\u88c5\u7a7a\u95f4"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u4e00\u3001\u6211\u9700\u8981\u8fd9\u4e2a\u529f\u80fd\u5417\uff1f<br \/>\n\u5982\u679c\u4f60\u5bf9\u8dd1openwrt\u7684\u8bbe\u5907\u7684\u8981\u6c42\u4ec5\u4ec5\u662f\u53ef\u4ee5\u4e0a\u4e0a\u7f51\uff0c\u90a3\u4e0b\u9762\u7684\u53ef\u4ee5\u4e0d\u7528\u770b\u4e86\u3002<br \/>\nopenwrt\u8fd0\u884c\u5728USB\u8bbe\u5907\u4e0a\u7684\u597d\u5904\uff1a<br \/>\n\u53ef\u4ee5\u5b89\u88c5openwrt\u5b98\u65b9\u7684N\u591a\u8f6f\u4ef6\u4e86\uff08\u4f46\u5b98\u65b9\u6682\u65f6\u6ca1\u6709mysql\uff0c\u90c1\u95f7\uff09\uff0c\u8c61P2P\u7c7b\u7684transmision-daemon\u3001amule\u3001 web\u670d\u52a1\u5668\u7c7b\u7684lighttpd\/apache\u3001ftp\u670d\u52a1\u5668\u7c7b\u7684vsftpd\u7b49\u7b49\uff0c\u8fd8\u53ef\u4ee5\u518d\u5b89\u88c5\u5176\u4ed6\u9a71\u52a8\u7a0b\u5e8f\u5305\u9a71\u52a8\u6444\u50cf\u5934\u3001USB\u58f0\u5361\u3001\u663e\u5361\u7b49\u7b49\u3002\u8fd9 \u90e8\u5206\u529f\u80fdoptware\u4e5f\u53ef\u4ee5\u5b9e\u73b0\uff0c\u5404\u8bba\u575b\u7684\u6559\u7a0b\u591a\u6570\u662f\u57fa\u4e8eoptware\u7684\u3002<\/p>\n<p>\u4e8c\u3001\u9700\u8981\u7684\u8bbe\u5907\u53ca\u73af\u5883\uff1a<br \/>\n1\u3001\u53ef\u4ee5\u8fd0\u884copenwrt\u7684\u8bbe\u5907\uff1b<br \/>\n2\u3001\u5e26USB\u63a5\u53e3\uff1b<br \/>\n3\u3001openwrt\u8981\u7248\u672c\u6bd4\u8f83\u65b0\uff0c\u5f80\u524d\u54ea\u4e2a\u7248\u672c\u53ef\u4ee5\uff0c\u6211\u4e0d\u77e5\u9053\uff0c\u65b0\u7248\u672c\u7684trunk\u7248\uff08\u6700\u65b0\u7684\u5f00\u53d1\u7248\uff09\u3001Backfire\u7248\uff08\u6700\u65b0\u7684\u7a33\u5b9a\u7248\uff09\u90fd\u53ef\u4ee5\u3002<\/p>\n<p>\u4e09\u3001\u6b65\u9aa4\uff1a<br \/>\n1\u3001\u5b9e\u73b0USB\u5b58\u50a8\u652f\u6301\uff0c\u5df2\u5b9e\u73b0\u6b64\u529f\u80fd\u7684\u6b64\u6b65\u9aa4\u53ef\u7565\u3002\u9700\u8981\u7528\u5230\u7684\u5305\uff1a<\/p>\n<pre>\r\nkmod-usb-ohci\u3001kmod-usb2\u3001kmod-usb-uhci\u3001kmod-usb-storage\r\n<\/pre>\n<p>\u8bf4\u660e\uff1a<br \/>\nkmod-usb-ohci\u5bf9\u5e94usb1.1<br \/>\nkmod-usb2\u5bf9\u5e94USB2.0<br \/>\nkmod-usb-uhci\u5bf9\u5e94\u90e8\u5206intel\u548cVIA\u7684usb\u63a7\u5236\u5668<br \/>\n\uff08\u8fd93\u4e2a\u53ef\u80fd\u4e0d\u5fc5\u5168\u90e8\u90fd\u5b89\u88c5\uff0c\u50cf7231-4P\u7b49\u53ea\u652f\u6301USB1.1\u7684\u8bbe\u5907\u5e94\u8be5\u53ea\u5b89\u88c5kmod-usb-ohci\u5373\u53ef\uff09<br \/>\nkmod-usb-stroage\u5bf9\u5e94USB\u786c\u76d8\u8bbe\u5907\uff0c\u5982U\u76d8\u3001USB\u79fb\u52a8\u786c\u76d8\u3002<br \/>\n\u4e3a\u4e86\u65b9\u4fbf\u65b0\u624b\uff08\u5176\u5b9e\u6211\u4e5f\u662f\u4e2a\u65b0\u624b\uff0c\u6c57\u2026\u2026\uff09\uff0c\u5c06\u8be6\u7ec6\u547d\u4ee4\u4e5f\u5199\u4e00\u4e0b\uff1a<\/p>\n<pre>\r\nopkg update\r\nopkg install kmod-usb-storage kmod-usb-ohci kmod-usb2 kmod-usb-uhci\r\n<\/pre>\n<p>2\u3001\u5b9e\u73b0USB\u5b58\u50a8\u8bbe\u5907\u81ea\u52a8\u6302\u8f7d\u5e76\u4eceUSB\u542f\u52a8\uff0c\u9700\u8981\u7528\u5230\u7684\u5305\uff1ablock-mount\u3001block-hotplug\uff08\u8fd9\u4e24\u4e2a\u662f\u81ea\u52a8\u6302\u8f7d\u7528\u7684\uff09\u548cblock-extroot\uff08\u8fd9\u4e2a\u662fUSB\u542f\u52a8\u7528\u7684\uff09<\/p>\n<pre>\r\nopkg update\r\nopkg install block-mount block-hotplug block-extroot\r\n<\/pre>\n<p>3\u3001 \u5b89\u88c5linux\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\uff0cext2\u3001ext3\u3001ext4\u4ee5\u53ca\u5176\u4ed6\u6587\u4ef6\u7cfb\u7edf\u4f17\u591a\uff0c\u7528\u54ea\u4e2a\u770b\u4e2a\u4eba\u7231\u597d\u4e86\uff0c\u63a8\u8350\u7ecf\u5178\u4f20\u7edf\u7684ext2\/ext3\u3002\u6211\u7528ext4 \u9047\u5230\u8fc7\u95ee\u9898\uff0c\u540e\u6765\u4e0aopenwrt\u679c\u7136\u6709\u4eba\u62a5\u5230\u8fd9\u4e2abug\u3002\u53e6\uff0c\u5728linux\u4e0b\uff0c\u5c3d\u91cf\u5c11\u7528\u6216\u8005\u653e\u5f03fat32\/ntfs<\/p>\n<pre>\r\nopkg install kmod-fs-ext3\r\n<\/pre>\n<p>\u8bf4\u660e\uff1a\u4e0d\u5b89\u88c5\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\u7684\u8bdd\uff0c\u5206\u533a\u4e0d\u80fdmount\u3002<\/p>\n<p>\u6709\u4eba\u4f1a\u95ee\uff0c\u4f60\u4e3a\u4f55\u4e0d\u4e00\u4e0b\u5b50opkg install\u4e86\uff0c\u5f53\u7136\u53ef\u4ee5\uff0c\u6211\u5206\u5f00\u6765\u662f\u4e3a\u4e86\u5e2e\u52a9\u65b0\u624b\u4e86\u89e3\u4e00\u4e0blinux\u4e0b\u8bbe\u5907\u9a71\u52a8\u3001\u529f\u80fd\u5305\u3001\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\u7684\u4e00\u4e9b\u7b80\u5355\u6982\u5ff5\u3002<\/p>\n<p>\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0copenwrt\u9ed8\u8ba4\u8bbe\u7f6e\u4e0b\uff0cU\u76d8\u63d2\u4e0a\u8fd8\u4e0d\u80fd\u8bc6\u522b\uff0copenwrt\u6709\u9ed8\u8ba4\u8bbe\u7f6e\u6a21\u677f\uff0c\u4f46\u6b64\u65f6\u8fd8\u662f\u5173\u95edU\u76d8\u81ea\u52a8\u6302\u8f7d\u529f\u80fd\u7684\u3002<\/p>\n<p>4\u3001\u51c6\u5907USB\u786c\u76d8\u53ca\u62f7\u8d1d\u6839\u76ee\u5f55\u6240\u6709\u6587\u4ef6\u3002\u4ee5\u4e0b\u5747\u4ee5\u63d2\u4e00\u4e2aU\u76d8\u7684\u60c5\u51b5\u4e3a\u4f8b\uff1a<br \/>\n4.1\u524d3\u4e2a\u6b65\u9aa4\u5b8c\u6210\u540e\uff0c\u4f60\u6700\u597d\u91cd\u542f\u4e00\u4e0b\u8bbe\u5907\uff0c\u63d2\u4e0aU\u76d8\uff08USB\u79fb\u52a8\u786c\u76d8\uff09\u3002<\/p>\n<p>4.2\u3000\u51c6\u5907U\u76d8\u4e3alinux\u5206\u533a\u53calinux\u6587\u4ef6\u7cfb\u7edf\uff0c\u9700\u8981\u7528\u5230\u7684\u5305\uff1ae2fsprogs\uff0c\u5982\u679c\u4f60\u5728\u5176\u4ed6\u7cfb\u7edf\u91cc\u51c6\u5907\u5206\u533a\u5e76\u683c\u5f0f\u5316\u4e3aext2\/ext3\uff0c\u5e94\u8be5\u4e5f\u53ef\u4ee5<br \/>\n\u51c6\u5907\u5206\u533a\u8fd9\u4e2a\u6b65\u9aa4\u7565\u8fc7\u4e0d\u8868\u4e86\uff0c\u9ed8\u8ba4\u4e00\u4e2a\u5206\u533a\u4e5f\u53ef\u4ee5\u7528\uff0c\u5982\u679c\u6709\u4eba\u60f3\u591a\u5206\u51e0\u4e2a\u533a\uff0c\u8bf7\u770b\u5176\u4ed6\u6559\u7a0b\u3002<\/p>\n<pre>\r\nopkg update\r\nopkg install e2fsprogs\r\n<\/pre>\n<p>ls \/dev\/sd*\uff0c\u5e94\u8be5\u6709sda sda1 \u5b57\u6837\uff08\u8fd9\u662f\u53ea\u6709\u4e00\u4e2aU\u76d8\u4e00\u4e2a\u5206\u533a\u7684\u60c5\u51b5\uff0c\u5982\u679c\u6709\u591a\u4e2aU\u76d8\uff0c\u4f1a\u6709sdb sdc\u2026\u2026\uff09<\/p>\n<pre>\r\nfdisk -l \/dev\/sd*\r\n<\/pre>\n<p>\u8f93\u5165\u547d\u4ee4<\/p>\n<pre>lsblk<\/pre>\n<p>\u67e5\u770b\u786c\u76d8\u7a7a\u95f4\u5206\u5e03,\u6211\u8fd9\u63d2\u5165\u4e86\u4e00\u4e2asda 16G\u7684\u5361<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u60a8\u6709\u54ea\u4e9b\u5206\u533a\uff0c\u6ca1\u670916G\u7684\u5206\u533a\uff1a<\/p>\n<pre>block info<\/pre>\n<p>\u5206\u533a<br \/>\n\u5c06\u4f7f\u7528\/dev\/sda \u8fd9\u575716G\u5927\u5c0f\u7684\u78c1\u76d8\u8fdb\u884c\u5206\u533a\uff0c\u5206\u4e3a\/dev\/sda1<\/p>\n<p>\u5148\u5907\u4efd\u6570\u636e\uff1b<br \/>\n\u4f7f\u7528fdisk \/dev\/sda\u53ef\u4ee5\u8fdb\u5165\u5206\u533a\u7f16\u8f91\u754c\u9762\uff1b<br \/>\n\u4e3b\u8981\u4f7f\u7528d\u5b50\u547d\u4ee4\u5220\u9664\u4e00\u4e2a\u5206\u533a\uff0c\u518d\u7528n\u65b0\u5efa\u5206\u533a\uff0c\u7528p\u67e5\u770b\u7f16\u8f91\u540e\u7684\u5206\u533a\uff1b<br \/>\n\u4f7f\u7528w\u5c06\u5206\u533a\u8868\u7684\u66f4\u6539\u5199\u5165\u78c1\u76d8\u3002<br \/>\n\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u5f53\u524d\u6587\u4ef6\u7cfb\u7edf\u6b63\u5728\u4f7f\u7528\uff0c\u65b0\u7684\u5206\u533a\u8868\u9700\u8981\u91cd\u542f\u540e\u624d\u80fd\u751f\u6548\u3002<\/p>\n<p>\u5206\u533a\u5b8c\u540e\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u683c\u5f0f\u5316\u5206\u533a\u624d\u80fd\u4f7f\u7528\uff0c\u5b98\u65b9 WiKi \u4e2d\u6709\u8bf4\u660e\u4ec5 ext4 \u683c\u5f0f\u7684\u6587\u4ef6\u7cfb\u7edf\u6709\u6548\uff1a<\/p>\n<pre>\r\n> mkfs.ext4 \/dev\/sda1\r\n<\/pre>\n<p>\u8fc1\u79fb\u6587\u4ef6<br \/>\n\u8fd9\u4e00\u6b65\u4e3b\u8981\u662f\u5c06\u539f\/overlay\u4e2d\u7684\u6587\u4ef6\u62f7\u8d1d\u5230\u65b0\u7684\u4e2d\uff1a<\/p>\n<pre>\r\n> mount \/dev\/sda1 \/mnt ; tar -C \/overlay -cvf - . | tar -C \/mnt -xf - ; umount \/mnt\r\n<\/pre>\n<p>\u7f16\u8f91 fstab<br \/>\n\u81ea\u52a8\u5c06\u7cfb\u7edf\u68c0\u6d4b\u5230\u7684\u53ef\u6302\u8f7d\u6587\u4ef6\u7cfb\u7edf\u914d\u7f6e\u5199\u5165\/etc\/config\/fstab\u3002OpenWRT \u4e2d\u90fd\u662f\u4f7f\u7528 UCI \u66f4\u6539\u7cfb\u7edf\u914d\u7f6e\u3002\u5982\u679c\u6309\u7167\u4e00\u822c\u65b9\u5f0f\u76f4\u63a5\u7f16\u8f91\u6587\u4ef6\uff0c\u5982\/etc\/fstab\uff0c\u4f1a\u88ab UCI \u8986\u76d6\uff0c\u8fd9\u4e00\u70b9\u9700\u8981\u6ce8\u610f\u3002<\/p>\n<pre>\r\nblock detect > \/etc\/config\/fstab; \r\n   sed -i s\/option$'t'enabled$'t''0'\/option$'t'enabled$'t''1'\/ \/etc\/config\/fstab; \r\n   sed -i s\r\n   cat \/etc\/config\/fstab;\r\n<\/pre>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u66f4\u6539\/etc\/config\/fstab\u4e2d\u9700\u8981\u542f\u7528\u6302\u8f7d\u7684option enable\u9879\u503c\u4e3a'1'\uff1b\u518d\u9009\u62e9\u9009\u62e9\u4f5c\u4e3aextroot\u7684\u5206\u533a\uff0c\u66f4\u6539\u6302\u8f7d\u76ee\u6807option target\u503c\u4e3a'\/overlay'\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>\r\nconfig 'mount'\r\n        option  target  '\/overlay'\r\n        option  uuid    'c91232a0-c50a-4eae-adb9-14b4d3ce3de1'\r\n        option  fstype  'ext4'\r\n        option  enabled '1'\r\n<\/pre>\n<p>\u4e4b\u540e\u6211\u4eec\u5c31\u53ef\u4ee5\u91cd\u542f\u6765\u9a8c\u8bc1\u914d\u7f6e\u662f\u5426\u6210\u529f\u4e86\u3002<\/p>\n<pre>\r\nroot@Joe-OpenWrt:~# df -h\r\nFilesystem                Size      Used Available Use% Mounted on\r\n\/dev\/root                 9.5M      9.5M         0 100% \/rom\r\ntmpfs                    61.0M    644.0K     60.4M   1% \/tmp\r\n\/dev\/sda1               188.7M     20.7M    154.0M  12% \/overlay\r\noverlayfs:\/overlay      188.7M     20.7M    154.0M  12% \/\r\ntmpfs                   512.0K         0    512.0K   0% \/dev\r\n\/dev\/sda2                23.2G    150.5M     21.9G   1% \/mnt\/tmp\r\n\/dev\/sda3                23.2G    150.5M     21.9G   1% \/mnt\r\n<\/pre>\n<p>\u8089\u773c\u53ef\u89c1\/\u7684\u53ef\u7528\u7a7a\u95f4\u53d8\u5927\u4e86\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879<br \/>\n\u4e0d\u8981\u5728 extroot \u4e2d\u4f7f\u7528 upgrade<br \/>\n\u4f1a\u5bfc\u81f4\u72b6\u6001\u4e0d\u4e00\u81f4\u6709\u53d8\u7816\u7684\u98ce\u9669\u3002<\/p>\n<p>The main reason is that the uClibc ABI (Application Binary Interface) is unstable and changes from revision to revision, so binaries for one version of uClibc may be incompatible with versions from another.<br \/>\nAnother problem that can arise is if you try to upgrade the kernel packages, then flash and reboot, but your operation is interrupted in any way, then you will have a kernel and module mismatch and likely a brick.<br \/>\nFinally, if you upgrade all packages but the kernel and the kernel modules, some packages like iptables will be broken.<br \/>\n\u8bbf\u95ee\u539f\u6765\u7684\/overlay<br \/>\n\u5982\u679c\u8981\u8bbf\u95ee\u539f\u6765\u7684\/overlay\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u91cd\u65b0\u6302\u8f7d\u5230\u5176\u5b83\u76ee\u5f55\u7684\u65b9\u5f0f\u3002<\/p>\n<pre>\r\nconfig mount\r\n    option target   \/overlay-boot\r\n    option device   \/dev\/mtdblock6\r\n    option fstype   jffs2\r\n    option options  rw,sync\r\n    option enabled  1\r\n    option enabled_fsck 0\r\n<\/pre>\n<p>\u53c2\u8003\u8d44\u6599<br \/>\nhttps:\/\/wiki.openwrt.org\/doc\/howto\/extroot<br \/>\nhttps:\/\/wiki.openwrt.org\/doc\/howto\/extroot\/extroot.theory<br \/>\nhttps:\/\/wiki.mbirth.de\/know-how\/software\/openwrt\/sysupgrade-with-extroot.html<br \/>\nhttps:\/\/dreamcreator108.com\/dreams\/openwrt-extroot\/<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u6211\u9700\u8981\u8fd9\u4e2a\u529f\u80fd\u5417\uff1f \u5982\u679c\u4f60\u5bf9\u8dd1openwrt\u7684\u8bbe\u5907\u7684\u8981\u6c42\u4ec5\u4ec5\u662f\u53ef\u4ee5\u4e0a\u4e0a\u7f51\uff0c\u90a3\u4e0b\u9762\u7684\u53ef\u4ee5\u4e0d\u7528\u770b\u4e86\u3002 openwrt\u8fd0\u884c\u5728USB\u8bbe\u5907\u4e0a\u7684\u597d\u5904\uff1a \u53ef\u4ee5\u5b89\u88c5openwrt\u5b98\u65b9\u7684N\u591a\u8f6f\u4ef6\u4e86\uff08\u4f46\u5b98\u65b9\u6682\u65f6\u6ca1\u6709m \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[133,147,273],"class_list":["post-1034","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","tag-openwrt","tag-usb","tag-273"],"views":2071,"_links":{"self":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/comments?post=1034"}],"version-history":[{"count":4,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1034\/revisions"}],"predecessor-version":[{"id":1044,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1034\/revisions\/1044"}],"wp:attachment":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/media?parent=1034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/categories?post=1034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/tags?post=1034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}