{"id":3680,"date":"2024-11-21T16:14:36","date_gmt":"2024-11-21T07:14:36","guid":{"rendered":"https:\/\/okamoto3.com\/?p=3680"},"modified":"2024-11-25T18:01:34","modified_gmt":"2024-11-25T09:01:34","slug":"raspi-copy","status":"publish","type":"post","link":"https:\/\/okamoto3.com\/index.php\/2024\/11\/21\/raspi-copy\/3680\/","title":{"rendered":"rpi-clone Error: \/dev\/nvme0n1: unrecognised disk label NVMe M.2 SSD\u5bfe\u5fdc\u30d1\u30c3\u30c1"},"content":{"rendered":"<p>sda\u304b\u3089NVMe M.2 SSD\u306brpi-clone\u3057\u3066\u307f\u305f\u3089\u3067\u304d\u306a\u304b\u3063\u305f\u3002\u305d\u306e\u5bfe\u7b56\u3002<\/p><h2 class=\"wp-block-heading\">\u308f\u3057\u306e\u69cb\u6210<\/h2><p>$ lsblk<br \/>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS<br \/>sda 8:0 0 119.2G 0 disk<br \/>\u251c\u2500sda1 8:1 0 512M 0 part \/boot\/firmware<br \/>\u2514\u2500sda2 8:2 0 118.7G 0 part \/<br \/><strong>mmcblk0<\/strong> 179:0 0 14.5G 0 disk<br \/>\u251c\u2500mmcblk<strong>0p1<\/strong> 179:1 0 512M 0 part<br \/>\u2514\u2500mmcblk<strong>0p2<\/strong> 179:2 0 14G 0 part<br \/>nvme0n1 259:0 0 119.2G 0 disk<\/p><h2 class=\"wp-block-heading\">sudo rpi-clone nvme0n1<\/h2><p>Target disk nvme0n1 ends with a digit so may be a partition.<br \/>rpi-clone requires disk names like &#8216;sda&#8217; and not partition names like &#8216;sda1&#8217;.<\/p><p>Continue anyway? (yes\/no): yes<br \/><strong>Error: \/dev\/nvme0n1: unrecognised disk label<\/strong><\/p><p>\u30a8\u30e9\u30fc\uff1f\uff1f\uff1f\u9006\u306f\uff1f<\/p><h2 class=\"wp-block-heading\">sudo rpi-clone sdb<\/h2><p><strong>Error: Could not stat device \/dev\/nvme0n1p &#8211; No such file or directory.<\/strong><\/p><p>\u3053\u308c\u3082\u30a8\u30e9\u30fc\uff1f<\/p><h2 class=\"wp-block-heading\">\u539f\u56e0<\/h2><p>rpi-clone\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3001NVMe \u30c7\u30d0\u30a4\u30b9\u306e\u540d\u524d\u306e\u672b\u5c3e\u3001 <code>n1p1<\/code>, <code>n1p2<\/code>\u306e\u5834\u5408\u3092\u8003\u616e\u3057\u3066\u3044\u306a\u3044\u3002\u305d\u308a\u3083\u3001\u7121\u304b\u3063\u305f\u304b\u3089\u4ed5\u65b9\u306a\u3044\u3002\u8ab0\u3082\u60aa\u304f\u306a\u3044\u3067\u3059\u3002<\/p><p>rpi-clone\u306f\u3059\u3070\u3089\u3057\u3044\u30c4\u30fc\u30eb\u3067\u3059\u3002\u611f\u8b1d\u3057\u3066\u3044\u307e\u3059\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002<\/p><h2 class=\"wp-block-heading\">\u76f4\u3059\u3068\u3053\u308d<\/h2><p>\u901a\u5e38\u306f\u3053\u306e\u5834\u6240<\/p><ul class=\"wp-block-list\"><li>sudo nano \/usr\/local\/sbin\/rpi-clone<\/li><\/ul><p>\u5fc5\u8981\u306a\u3089\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3001\u307e\u3042\u3001github\u306b\u3042\u308b\u304b\u3089\u3048\u3048\u304b\u3002<\/p><p>\u304a\u6c7a\u307e\u308a\u3001\u81ea\u5df1\u8cac\u4efb\u3067\u304a\u306d\u304c\u3044\u3057\u307e\u3059\u3002\u3082\u3057\u9593\u9055\u3048\u3066\u3082\u3001\u76f4\u3057\u305d\u3053\u306d\u305f\u90e8\u5206\u3092chatgpt\u306b\u6295\u3052\u308c\u3070\u3001\u30a8\u30e9\u30fc\u3092\u76f4\u3057\u3066\u304f\u308c\u308b\u306f\u305a\u3002<\/p><p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d6\u30ed\u30c3\u30af\u3054\u3068\u30b3\u30d4\u30da\u3001\u30bd\u30fc\u30b9\u306e\u5143\u306e\u30b3\u30fc\u30c9\u3092\u5bfe\u7b56\u3057\u305f\u30b3\u30fc\u30c9\u306b\u7f6e\u304d\u63db\u3048\u3001\u4fdd\u5b58\u3067OK\u3002<\/p><h3 class=\"wp-block-heading\">destination\u90e8\u5206\u306e\u5bfe\u5fdc<\/h3><h3 class=\"wp-block-heading\">\u5143\u306e\u30b3\u30fc\u30c9<\/h3><p>if [[ ${chk_disk: -1} =~ ^[0-9]$ ]]<br \/>then<br \/> if [[ $dst_disk == <em>&#8220;mmcblk&#8221;<\/em> ]]<br \/> then<br \/> SD_slot_dst=1<br \/> dst_part_base=${dst_disk}p<br \/> if [ &#8220;$edit_fstab_name&#8221; == &#8220;&#8221; ] \\&amp;&amp; ! grep -q &#8220;^PARTUUID=&#8221; \/etc\/fstab<br \/> then<br \/> edit_fstab_name=$dst_part_base<br \/> assumed_fstab_edit=1<br \/> else<br \/> assumed_fstab_edit=0<br \/> fi<br \/>else<br \/> qecho $&#8221;<br \/>Target disk $dst_disk ends with a digit so may be a partition.<br \/>$PGM requires disk names like &#8216;sda&#8217; and not partition names like &#8216;sda1&#8217;.&#8221;confirm &#8220;Continue anyway?&#8221; &#8220;abort&#8221;<br \/> fi<br \/>fi<\/p><h3 class=\"wp-block-heading\">\u5bfe\u7b56\u3057\u305f\u30b3\u30fc\u30c9<\/h3><p>if [[ ${chk_disk: -1} =~ ^[0-9]$ ]]<br \/>then<br \/>if [[ $dst_disk == <em>&#8220;mmcblk&#8221;<\/em> ]]<br \/>then<br \/>SD_slot_dst=1<br \/>dst_part_base=${dst_disk}p<br \/>if [ &#8220;$edit_fstab_name&#8221; == &#8220;&#8221; ] \\<br \/>&amp;&amp; ! grep -q &#8220;^PARTUUID=&#8221; \/etc\/fstab<br \/>then<br \/>edit_fstab_name=$dst_part_base<br \/>assumed_fstab_edit=1<br \/>else<br \/>assumed_fstab_edit=0<br \/>fi<br \/><strong>elif [[ $dst_disk == <\/strong><strong><em>&#8220;nvme&#8221;<\/em><\/strong><strong> ]]<\/strong><br \/><strong>then<\/strong><br \/><strong># NVMe \u30c7\u30d0\u30a4\u30b9\u306e\u5834\u5408<\/strong><br \/><strong>dst_part_base=${dst_disk}p<\/strong><br \/>else<br \/>qecho $&#8221;<br \/>Target disk $dst_disk ends with a digit so may be a partition.<br \/>$PGM requires disk names like &#8216;sda&#8217; and not partition names like &#8216;sda1&#8217;.&#8221;confirm &#8220;Continue anyway?&#8221; &#8220;abort&#8221;<br \/>fi<br \/>fi<\/p><h2 class=\"wp-block-heading\">source\u90e8\u5206\u306e\u5bfe\u5fdc<\/h2><h3 class=\"wp-block-heading\">\u5143\u306e\u30b3\u30fc\u30c9<\/h3><p>get_src_disk()<br \/>{<br \/>partition=${1#\/dev\/}<br \/>disk=${partition:: -1}<br \/>num=&#8221;${partition: -1}&#8221;<br \/>if [[ $disk == <em>&#8220;mmcblk&#8221;<\/em> ]]<br \/>then<br \/>SD_slot_boot=1<br \/>disk=${disk:0:7}<br \/>src_part_base=${disk}p<br \/>fi<br \/>printf -v &#8220;${2}&#8221; &#8220;%s&#8221; &#8220;$disk&#8221;<br \/>printf -v &#8220;${3}&#8221; &#8220;%s&#8221; &#8220;$num&#8221;<br \/>}<\/p><h3 class=\"wp-block-heading\">\u5bfe\u7b56\u3057\u305f\u30b3\u30fc\u30c9<\/h3><p>get_src_disk()<br \/>{<br \/>partition=${1#\/dev\/} # \u5f15\u6570\u304b\u3089 &#8220;\/dev\/&#8221; \u3092\u9664\u53bb<br \/><strong>if [[ $partition == <\/strong><strong><em>&#8220;nvme&#8221;<\/em><\/strong><strong> ]]<\/strong><br \/><strong>then<\/strong><br \/><strong># NVMe \u30c7\u30d0\u30a4\u30b9\u306e\u5834\u5408\u3001 &#8220;nvme0n1p1&#8221; \u306e\u5f62\u5f0f\u3092\u89e3\u6790<\/strong><br \/><strong>disk=${partition:: -2} # \u672b\u5c3e\u306e &#8220;pX&#8221; \u3092\u9664\u53bb\u3057\u3066 &#8220;nvme0n1&#8221; \u3092\u53d6\u5f97<\/strong><br \/><strong>num=&#8221;${partition: -1}&#8221; # \u6700\u5f8c\u306e\u6570\u5b57\u3092\u53d6\u5f97<\/strong><br \/><strong>src_part_base=${disk}p # \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u540d\u3092\u8a2d\u5b9a<\/strong><br \/><strong>elif [[ $partition == <\/strong><strong><em>&#8220;mmcblk&#8221;<\/em><\/strong><strong> ]]<\/strong><br \/><strong>then<\/strong><br \/><strong># SD \u30ab\u30fc\u30c9\u30b9\u30ed\u30c3\u30c8\u306e\u5834\u5408<\/strong><br \/><strong>SD_slot_boot=1<\/strong><br \/><strong>disk=${partition:0:7} # &#8220;mmcblkX&#8221; \u306e\u5f62\u5f0f<\/strong><br \/><strong>num=&#8221;${partition: -1}&#8221; # \u6700\u5f8c\u306e\u6570\u5b57\u3092\u53d6\u5f97<\/strong><br \/><strong>src_part_base=${disk}p # \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u540d\u3092\u8a2d\u5b9a<\/strong><br \/><strong>else<\/strong><br \/><strong># \u305d\u306e\u4ed6\u306e\u30c7\u30d0\u30a4\u30b9 (\u4f8b: sda, sdb)<\/strong><br \/><strong>disk=${partition:: -1} # \u30c7\u30d0\u30a4\u30b9\u540d\u3092\u53d6\u5f97 (\u672b\u5c3e\u306e\u6570\u5b57\u3092\u9664\u53bb)<\/strong><br \/><strong>num=&#8221;${partition: -1}&#8221; # \u6700\u5f8c\u306e\u6570\u5b57\u3092\u53d6\u5f97<\/strong><br \/><strong>src_part_base=${disk} # \u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u540d\u3092\u8a2d\u5b9a<\/strong><br \/>fi<br \/># \u30c7\u30a3\u30b9\u30af\u540d\u3068\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u756a\u53f7\u3092\u8fd4\u3059<br \/>printf -v &#8220;${2}&#8221; &#8220;%s&#8221; &#8220;$disk&#8221;<br \/>printf -v &#8220;${3}&#8221; &#8220;%s&#8221; &#8220;$num&#8221;<br \/>}<\/p><p>\u3053\u3053\u76f4\u3057\u3066\u304f\u308c\u3068\u3001\u30bd\u30fc\u30b9\u3092chatgpt\u306b\u6295\u3052\u305f\u3089\u3001\u3053\u3093\u306a\u3093\u51fa\u307e\u3057\u305f\u3002<\/p><h2 class=\"wp-block-heading\">\u4f7f\u3044\u65b9\u4f8b<\/h2><p>\u666e\u901a\u306e\u30c7\u30d0\u30a4\u30b9\u304b\u3089NVMe \u30c7\u30d0\u30a4\u30b9\u3078<\/p><ul class=\"wp-block-list\"><li>sudo rpi-clone nvme0n1<\/li><\/ul><p>NVMe \u30c7\u30d0\u30a4\u30b9\u306e\u30eb\u30fc\u30c8\u304b\u3089sdb\u3078<\/p><ul class=\"wp-block-list\"><li>sudo rpi-clone sdb<\/li><\/ul><h2 class=\"wp-block-heading\">NVMe\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u8d77\u52d5\u3057\u306a\u3044\u6642<\/h2><p>\u305d\u308c\u306f\u3001\u6050\u3089\u304f\u3001SD\u30ab\u30fc\u30c9\u3092\u8d77\u52d5\u30c7\u30a4\u30b9\u30af\u306b\u3057\u3066\u3001SSD\u3092\u30eb\u30fc\u30c8\u306b\u3057\u3066\u308braspi\u3092rpi-clone\u3057\u3066\u3044\u307e\u305b\u3093\u304b\uff1f\u305d\u306e\u5834\u5408\u3001NVMe\u30c7\u30d0\u30a4\u30b9\u306ePARTUUID\u304cNVMe\u30c7\u30d0\u30a4\u30b9\u306b\u306f\u306a\u3089\u306a\u3044\u307f\u305f\u3044\u3002(SD\u30ab\u30fc\u30c9\u306e\u307e\u307e?)fstab\u306f\u5909\u66f4\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u5909\u66f4\u306f\u4e0d\u8981\u3002<\/p><p>NVMe\u30c7\u30d0\u30a4\u30b9\u4e0a\u306e\/boot\/cmdline.txt\u306b\u3042\u308bPARTUUID=xxxxxxx-02\u3092\u304a\u4f7f\u3044\u306e\u3084\u3064\u306b\u304b\u3048\u308b\u3068\u8d77\u52d5\u3057\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001raspi\u306bNVMe\u304b\u3089\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u306a\u3044\u3068\u30c0\u30e1\u3067\u3059\u304c\u3002<\/p><p>sudo blkid<\/p><p>\u3067\u3001\u8abf\u3079\u3066\u307f\u3066\u4e0b\u3055\u3044\u3002<\/p><p class=\"has-text-align-left\">\u4ee5\u4e0a<\/p><hr class=\"wp-block-separator has-css-opacity\"\/><div class=\"wp-block-image is-style-rounded\"><figure class=\"aligncenter size-thumbnail\"><a href=\"https:\/\/youtube.com\/user\/hishigeki3\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/i0.wp.com\/okamoto3.com\/wp-content\/uploads\/2021\/10\/Screenshot_2021-10-25-07-00-51-667_com.google.android.youtube-01_copy_270x246.jpeg?resize=150%2C150&#038;ssl=1\" alt=\"\" class=\"wp-image-658\" srcset=\"https:\/\/i0.wp.com\/okamoto3.com\/wp-content\/uploads\/2021\/10\/Screenshot_2021-10-25-07-00-51-667_com.google.android.youtube-01_copy_270x246.jpeg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/okamoto3.com\/wp-content\/uploads\/2021\/10\/Screenshot_2021-10-25-07-00-51-667_com.google.android.youtube-01_copy_270x246.jpeg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a><figcaption class=\"wp-element-caption\">\u3088\u308d\u3057\u3051\u308c\u3070\u30c1\u30e3\u30f3\u30cd\u30eb\u767b\u9332\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u7533\u3057\u4e0a\u3052\u307e\u3059\uff01<\/figcaption><\/figure><\/div><hr class=\"wp-block-separator has-css-opacity\"\/>","protected":false},"excerpt":{"rendered":"<p>sda\u304b\u3089NVMe M.2 SSD\u306brpi-clone\u3057\u3066\u307f\u305f\u3089\u3067\u304d\u306a\u304b\u3063\u305f\u3002\u305d\u306e\u5bfe\u7b56\u3002 \u308f\u3057\u306e\u69cb\u6210 $ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSsda 8:0 0 11&hellip; <a class=\"more-link\" href=\"https:\/\/okamoto3.com\/index.php\/2024\/11\/21\/raspi-copy\/3680\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">rpi-clone Error: \/dev\/nvme0n1: unrecognised disk label NVMe M.2 SSD\u5bfe\u5fdc\u30d1\u30c3\u30c1<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3284,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[23,213],"tags":[],"class_list":["post-3680","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi","category-all-articles","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/okamoto3.com\/wp-content\/uploads\/2023\/06\/RaspberryPiImagerv1.7.32023_02_0616_55_49.jpg?fit=680%2C420&ssl=1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/posts\/3680","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/comments?post=3680"}],"version-history":[{"count":19,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/posts\/3680\/revisions"}],"predecessor-version":[{"id":3701,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/posts\/3680\/revisions\/3701"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/media\/3284"}],"wp:attachment":[{"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/media?parent=3680"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/categories?post=3680"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/okamoto3.com\/index.php\/wp-json\/wp\/v2\/tags?post=3680"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}