{"id":642,"date":"2020-07-03T14:32:24","date_gmt":"2020-07-03T06:32:24","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=642"},"modified":"2020-07-03T14:32:24","modified_gmt":"2020-07-03T06:32:24","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e8%87%aa%e5%8a%a8%e6%8c%82%e8%bd%bdusb%e7%a7%bb%e5%8a%a8%e5%ad%98%e5%82%a8%e8%ae%be%e5%a4%87","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=642","title":{"rendered":"\u6811\u8393\u6d3e\u81ea\u52a8\u6302\u8f7dusb\u79fb\u52a8\u5b58\u50a8\u8bbe\u5907"},"content":{"rendered":"\n<p>\u9996\u5148\u63d2\u4e0aU\u76d8\u6216\u8005\u79fb\u52a8\u786c\u76d8\u5230PI\uff0c\u671f\u95f4PI\u56e0\u4e3a\u7a81\u7136\u6709\u63a5\u53e3\u63d2\u5165\u4f1a\u56e0\u4e3a\u7535\u6d41\u4e0d\u7a33\u5b9a\u800c\u91cd\u542f\uff01<\/p>\n\n\n\n<p>\u91cd\u542f\u540essh\u767b\u9646\u5728\u7ec8\u7aef\u8f93\u5165 sudo fdisk -l \u4f1a\u663e\u793a\u51fa\u5df2\u7ecf\u6302\u8f7d\u7684\u5b58\u50a8\u8bbe\u5907\u3002<\/p>\n\n\n\n<p>\u4f60\u5e94\u8be5\u770b\u5230\u7c7b\u4f3c\u4e8e\u8fd9\u6837\u7684\u753b\u9762\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pi@raspberrypi ~ $ sudo fdisk -l Disk \/dev\/mmcblk0: 7948 MB, 7948206080 bytes4 heads, 16 sectors\/track, 242560 cylinders, total 15523840 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical\/physical): 512 bytes \/ 512 bytesI\/O size (minimum\/optimal): 512 bytes \/ 512 bytesDisk identifier: 0x000981cb         Device Boot      Start         End      Blocks   Id  System\/dev\/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)\/dev\/mmcblk0p2          122880    15523839     7700480   83  Linux Disk \/dev\/sda: 16.0 GB, 16008609792 bytes69 heads, 42 sectors\/track, 10789 cylinders, total 31266816 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical\/physical): 512 bytes \/ 512 bytesI\/O size (minimum\/optimal): 512 bytes \/ 512 bytesDisk identifier: 0x29d229d1 Device Boot      Start         End      Blocks   Id  System\/dev\/sda1   *      753408    31266815    15256704    c  W95 FAT32 (LBA)<\/code><\/pre>\n\n\n\n<p>\/dev\/mmc\u662f\u6811\u8393\u6d3e\u7cfb\u7edf\u7684\u5206\u533a\uff0cmmc\u6307\u7684\u662fSD\u5361\u3002<\/p>\n\n\n\n<p>\/dev\/sda1\u548c\/dev\/sdb1\u548cSD\u5361\u6ca1\u6709\u5173\u7cfb\uff0c\u8fd9\u4e9b\u662f\u4f60\u63d2\u4e0a\u53bb\u7684USB\u786c\u76d8\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5ntfs-3g\u6a21\u5757\uff0c\u4e8e\u662f\u6211\u4eec\u5c31\u80fd\u8bfb\u5199NTFS\u683c\u5f0f\u7684\u786c\u76d8\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install ntfs-3g\n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u4ee5\u8fd9\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u6302\u8f7d\u70b9\u6302\u8f7d\u786c\u76d8\uff0c\u628a\u79fb\u52a8\u8bbe\u5907\u6302\u8f7d\u4e0a\u53bb\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/mediasudo sudo mount \/dev\/sda1 \/media<\/code><\/pre>\n\n\n\n<p>\u7136\u540edf -lh\u5c31\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u6302\u8f7d\u6210\u529f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pi@raspberrypi ~ $ df -lhFilesystem      Size  Used Avail Use% Mounted onrootfs          7.2G  2.1G  4.8G  31% \/\/dev\/root       7.2G  2.1G  4.8G  31% \/devtmpfs        211M     0  211M   0% \/devtmpfs            44M  232K   44M   1% \/runtmpfs           5.0M     0  5.0M   0% \/run\/lock\/dev\/sda1        15G  269M   15G   2% \/media\/__\u00eb__U__tmpfs            88M     0   88M   0% \/run\/shm\/dev\/mmcblk0p1   56M   19M   38M  34% \/boot<\/code><\/pre>\n\n\n\n<p>\u6bcf\u6b21\u5f00\u673a\u90fd\u8981\u624b\u52a8\u6572\u547d\u4ee4\u6765\u8ba9\u6811\u8393\u6d3e\u81ea\u52a8\u6302\u8f7dU\u76d8\uff0c\u662f\u4e00\u4ef6\u5f88\u4e0d\u6109\u5feb\u7684\u4e8b\u60c5\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u5728udev\u8bbe\u5907\u7ba1\u7406\u5668\u65b0\u5efa\u89c4\u5219\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pi@raspberrypi ~ $ sudo vi \/etc\/udev\/rules.d\/10-usbstorage.rules KERNEL!=\"sd*\", GOTO=\"media_by_label_auto_mount_end\" SUBSYSTEM!=\"block\",GOTO=\"media_by_label_auto_mount_end\"IMPORT{program}=\"\/sbin\/blkid -o udev -p %N\" ENV{ID_FS_TYPE}==\"\", GOTO=\"media_by_label_auto_mount_end\"ENV{ID_FS_LABEL}!=\"\", ENV{dir_name}=\"%E{ID_FS_LABEL}\" ENV{ID_FS_LABEL}==\"\", ENV{dir_name}=\"Untitled-%k\" ACTION==\"add\", ENV{mount_options}=\"relatime,sync\" ACTION==\"add\", ENV{ID_FS_TYPE}==\"vfat\", ENV{mount_options}=\"iocharset=utf8,umask=000\" ACTION==\"add\", ENV{ID_FS_TYPE}==\"ntfs\", ENV{mount_options}=\"iocharset=utf8,umask=000\" ACTION==\"add\", RUN+=\"\/bin\/mkdir -p \/media\/%E{dir_name}\", RUN+=\"\/bin\/mount -o $env{mount_options} \/dev\/%k \/media\/%E{dir_name}\"  ACTION==\"remove\", ENV{dir_name}!=\"\", RUN+=\"\/bin\/umount -l \/media\/%E{dir_name}\", RUN+=\"\/bin\/rmdir \/media\/%E{dir_name}\" LABEL=\"media_by_label_auto_mount_end\"<\/code><\/pre>\n\n\n\n<p>\u53d1\u73b0usb\u79fb\u52a8\u5b58\u50a8\u8bbe\u5907\u4f1a\u81ea\u52a8\u6302\u8f7d\u5230 \/media \u76ee\u5f55\u4e0b,\u53ef\u81ea\u884c\u4fee\u6539\u8def\u5f84, \u6302\u8f7d\u5230\u5176\u4ed6\u76ee\u5f55\u3002<\/p>\n\n\n\n<p>\u539f\u6587\uff1a<a href=\"http:\/\/rpi.linux48.com\/usbstorage.html\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/rpi.linux48.com\/usbstorage.html<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"642\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u63d2\u4e0aU\u76d8\u6216\u8005\u79fb\u52a8\u786c\u76d8\u5230PI\uff0c\u671f\u95f4PI\u56e0\u4e3a\u7a81\u7136\u6709\u63a5\u53e3\u63d2\u5165\u4f1a\u56e0\u4e3a\u7535\u6d41\u4e0d\u7a33\u5b9a\u800c\u91cd\u542f\uff01 \u91cd\u542f\u540essh\u767b\u9646\u5728\u7ec8\u7aef\u8f93\u5165 sudo fdis &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-642","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=642"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/642\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}