{"id":643,"date":"2016-11-29T16:11:01","date_gmt":"2016-11-29T16:11:01","guid":{"rendered":"http:\/\/mclements.net\/blogWP\/?p=643"},"modified":"2017-01-05T00:51:01","modified_gmt":"2017-01-05T00:51:01","slug":"vfat-uuid-sd-cards-android-mount","status":"publish","type":"post","link":"http:\/\/mclements.net\/blogWP\/index.php\/2016\/11\/29\/vfat-uuid-sd-cards-android-mount\/","title":{"rendered":"VFAT, UUID, SD Cards, Android Mount"},"content":{"rendered":"<p>Last night I was setting up a new Android tablet to match an old one. Both have SD cards with apps that store data on it. To make things easier, I wanted the SD card to mount to the same point in the filesystem. But Android 6 mounts the SD card to a directory whose name is the card&#8217;s serial number (UUID). That is:<strong> \/storage\/XXXX-XXXX<\/strong>. We&#8217;re talking about the serial number, not the volume label &#8211; so it&#8217;s not easy to change &#8211; <strong>tune2fs<\/strong> can&#8217;t do it because it&#8217;s <strong>fvat<\/strong>, not <strong>ext<\/strong>.<\/p>\n<p>Eventually I succeeded but there were a few twists along the way.<\/p>\n<p>Ubuntu help forums online have <a href=\"https:\/\/ubuntuforums.org\/showthread.php?t=1240146\">a procedure to do this with <strong>dd<\/strong> commands<\/a>, but I want to avoid performing block level I\/O on the filesystem. I found a simpler, cleaner, safer way to do this:<\/p>\n<p>First, install mtools. It&#8217;s in Ubuntu&#8217;s standard repos: <strong>sudo apt-get install mtools<\/strong><\/p>\n<p>Next, connect the SD card and check which device it is &#8211; in my case <strong>\/dev\/sdc1<\/strong> but this will vary. Make sure it&#8217;s unmounted, but not ejected.<\/p>\n<p>Next use mlabel to set the UUID: <strong>sudo mlabel -i \/dev\/sdc1 -N XXXXXXXX ::VOL-LABEL<\/strong><\/p>\n<p>NOTE: mlabel&#8217;s <strong>-i<\/strong> param is undocumented. It&#8217;s how you specify the device. You can omit the <strong>VOL-LABEL<\/strong>, but leave the :: in place.<\/p>\n<p>NOTE: after doing this if you check the UUID using <strong>blkid<\/strong> or other commands, they will report it unchanged &#8211; even if you remove and reinstall the SD card. This is incorrect; the UUID did actually change. Apparently, you must reboot before Linux will recognize a changed UUID for a filesystem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last night I was setting up a new Android tablet to match an old one. Both have SD cards with apps that store data on it. To make things easier, I wanted the SD card to mount to the same point in the filesystem. But Android 6 mounts the SD card to a directory whose &hellip; <a href=\"http:\/\/mclements.net\/blogWP\/index.php\/2016\/11\/29\/vfat-uuid-sd-cards-android-mount\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">VFAT, UUID, SD Cards, Android Mount<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-643","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":4,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"predecessor-version":[{"id":653,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/posts\/643\/revisions\/653"}],"wp:attachment":[{"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/categories?post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mclements.net\/blogWP\/index.php\/wp-json\/wp\/v2\/tags?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}