{"id":3289,"date":"2016-05-27T21:22:13","date_gmt":"2016-05-27T17:22:13","guid":{"rendered":"https:\/\/nayarweb.com\/blog\/?p=3289"},"modified":"2016-05-27T21:22:13","modified_gmt":"2016-05-27T17:22:13","slug":"mounting-pendrives-at-boot-on-raspberry-pi-or-not","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2016\/mounting-pendrives-at-boot-on-raspberry-pi-or-not\/","title":{"rendered":"Mounting Pendrives at Boot on Raspberry Pi (or Not)"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3291\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2016\/05\/Photo-on-27-05-2016-at-9.20-PM-1024x683.jpg\" alt=\"Raspberry Pi with Pendrive\" width=\"640\" height=\"427\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2016\/05\/Photo-on-27-05-2016-at-9.20-PM-1024x683.jpg 1024w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2016\/05\/Photo-on-27-05-2016-at-9.20-PM-300x200.jpg 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2016\/05\/Photo-on-27-05-2016-at-9.20-PM-768x512.jpg 768w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2016\/05\/Photo-on-27-05-2016-at-9.20-PM.jpg 1080w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/>Well, I got a pendrive that I want to be automounted on my Raspberry Pi. Simple as hell. Do an $ lsblk command. Find the drive name. Mine was \/dev\/sda1.<\/p>\n<p>I edited the \/etc\/fstab file to automount it at boot<\/p>\n<blockquote>\n<p class=\"p1\"><span class=\"s1\">\/dev\/sda1 <span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 <\/span>\/mnt\/externaldrive<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 <\/span>auto<span class=\"Apple-converted-space\">\u00a0 \u00a0 defaults<\/span>\u00a0<span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>0 <span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 <\/span>0<\/span><\/p>\n<\/blockquote>\n<p class=\"p1\">Problem is that when the pendrive was not on the raspberry pi, the latter would refuse to boot properly. Even the WiFi or ethernet doesn&#8217;t work. Had to actually plug in my TV&#8217;s HDMI cable to view the boot error messages.<\/p>\n<p class=\"p1\">Some googling after, found this page:\u00a0http:\/\/askubuntu.com\/questions\/14365\/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in<\/p>\n<p class=\"p1\">Edited my \/etc\/fstab like this now. Notice the nofail option.<\/p>\n<blockquote>\n<p class=\"p1\"><span class=\"s1\">\/dev\/sda1 \/mnt\/externaldrive auto nofail,auto 0 0<\/span><\/p>\n<\/blockquote>\n<p class=\"p1\">Now I can boot with either a pendrive in or not. \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I got a pendrive that I want to be automounted on my Raspberry Pi. Simple as hell. Do an $ lsblk command. Find the drive name. Mine was \/dev\/sda1. I edited the \/etc\/fstab file to automount it at boot \/dev\/sda1 \u00a0 \u00a0 \u00a0 \/mnt\/externaldrive\u00a0 \u00a0 \u00a0 auto\u00a0 \u00a0 defaults\u00a0\u00a0 \u00a0 0 \u00a0 \u00a0 \u00a0 &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2016\/mounting-pendrives-at-boot-on-raspberry-pi-or-not\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">Mounting Pendrives at Boot on Raspberry Pi (or Not)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210],"tags":[],"class_list":["post-3289","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=3289"}],"version-history":[{"count":2,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3289\/revisions"}],"predecessor-version":[{"id":3292,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3289\/revisions\/3292"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=3289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=3289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=3289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}