USB Boot on Raspberry Pi 3

I’ve done this before with no luck. Was this after you had a working install on an SD card and then copied it to the USB drive? I have zero issues using USB drives with Raspbian but have never been able to get hass.io to boot even doing exactly as you said above. FWIW, that’s what I had to do after copying my existing HASS SD card to a USB stick.

Edit: let me try again. I’m almost certain I did this on all 4 files but I’ll try again. My next problem is getting my existing config working on hass.io but that’s for another thread lol

That is great news, will try as soon as I am near my RPI3 again. Thanks for sharing!
:slight_smile:

/edit
It is currently ‘Preparing Hass.io’, booted from USB drive with a fresh image and changes made as described above.
I could not get a (backup) image of my current SD card installation to work sadly, so we start over…
:smiley:

Thanks again Sanya, much appreciated!

  1. I burned a raspbian lite to my SD card, and enable USB boot mode

  2. I burned hassio rpi3 image to my USB stick

  3. try to boot with only USB device -> no boot :frowning:

  4. boot from SD card with USB stick is plugged in -> rasbian started :frowning:

  5. I changed the cmdline.txt on SD card and USB stick

  6. boot from SD card with USB stick is plugged in -> resin OS started (but docker has an error) :wink:
    I used ssh to see logs:

    .............$ ssh [email protected] -p 22222
    [email protected]:~# docker ps
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    
  7. remove SD card and boot again -> resin OS and docker is running :blush:

  8. wating

  9. hass.io has an error: disk full :frowning:

    [email protected]:~# journalctl -f
    ...
    Aug 13 12:14:20 hassio dockerd[766]: 2017/08/13 14:14:20 [alert] 27#27: *2 write() to "/var/lib/nginx/logs/access.log" was incomplete: 117 of 215 while logging request, client: ::ffff:192.168.100.114, server: , request: "GET / HTTP/1.1", host: "hassio.local:8123", referrer: "http://hassio.local:8123/"
    Aug 13 12:15:02 hassio dockerd[766]: time="2017-08-13T12:15:02.567164650Z" level=error msg="Not continuing with pull after error: failed to register layer: Error processing tar file(exit status 1): write /usr/lib/perl5/core_perl/auto/Encode/JP/JP.so: no space left on device"
    ...
    
  10. shutdown with ssh

  11. I used gparted to resize resin-data partition

  12. boot from USB

  13. wating

  14. Home Assistant is now runnning :slight_smile:

5 Likes

I got this also working. Thanks for the advices.

Here is what I did:

  1. flashed hass.io image to usb thumb drive
  2. used gparted to increase the resin-data partion (I added ~1GB more space)
    2.1 modified the files like instructed
  3. connected the usb drive to rpi and bootted it up

Some challenges with debug ssh access thou. When trying to connect, I get following error:
Disconnected: No supported authentication methods available (server sent: publickey)

I have created a public key with putty and copied (id_rsa.pub) that to the root of resin-boot partition.

Did you add your Private Key to be used by Putty as well? You have to add that in the left pane of putty under SSH - Auth.

Yes, I did. I will create new pair of keys and try it again.

I now see in your post that you copied the key file itself to the resin-boot partition. You have to create a file called ’ authorized_keys’ there and paste the key in it.

1 Like

Excuse me but does anyone take a Look to my post Hass.io Features proposal ?

The rebus a script poster to raspberry forum tha may help u

I have used this method sucessfully with hasbian but with hasio i get the following error

core-ssh:~/Adafruit-Pi-ExternalRoot-Helper# ./adafruit-pi-externalroot-helper -d /dev/sda
Target drive = /dev/sda
[error] Target /dev/sda must be existing device (use -d /dev/foo to specify)

tried sda1 as well but it doesnt seem to work. Anyone having any ideas?

Hi. I tried using gparted to increase resin-data (sda6) and it wouldn’t let me go beyond 1027Mb (from 1024) even though I had >11GB of unused space. Stuck now.

First you have to resize the main partition and after that you can increase the size of subpartitions. Some cases you have to even change the order of different subparttions but if remember right resin-data partition was the last subparttion. I hope this helps.

Are you sure that usb is mounted to sda? When I have multiple usb drives hooked to my rpi, every one is mounted to different path, like sdb, sdc, etc. This is just pure guessing…

Thanks but the other 5 partitions are all tiny so there is not much to steal from in order to make the data partition go from 1GB to say 2GB. I’m doing it with a gparted live USB drive under Windows.

@Jullimullins

Below is the file system of a Hassio image flashed to a 16GB thumb drive. Wondering if you can advise where you stole the space from?

First increase the size /dev/sdb4 and after that you can increase size of /dev/sdb6.

Thanks! Although that made no sense, it worked a treat as I have a 8.6GB data partition. Now to try and boot!

@Jullimullins

Thanks for all your help. Got it working tonight using the following steps for anyone else trying to piece it all together.

  1. Installed Raspbian Lite (2017-04-10) on a MicroSD card and followed the instructions here to enable USB boot mode.
  2. Rebooted Pi then shut down a few minutes later.
  3. Burned hassio Pi3 image to a 16GB USB drive.
  4. Booted PC into Gparted to re-partition hassio image.
  5. Increased /dev/sdb4 from 1GB to around 4GB (must do first otherwise you can’t expand the resin-data partition).
  6. Increased /dev/sdb6 from 1GB to pretty much whatever was left.

  1. With the modified thumb drive back in my PC, I added the following located in the resin-boot drive and also in the resin-rootA partition inside the resin-boot folder:
    I changed the “root” option in cmdline.txt to:
    root=/dev/sda2
    and I added the usb boot line below to config.txt, right at the end:
    program_usb_boot_mode=1

  2. I then put the reworked thumb drive back in my Pi3 without the MicroSD card and after about 1 minute, the Home Assistant logo appeared so I knew we were underway. 20 mins later, working Hassio system with no MicroSD card. Yay.

19 Likes

Hi Guys!

@sanyatuning Your guide run only on a rip 3 on the 2, 1 or 0 you need always the sd card. So I think that rootwait param is necessary to wait until all usb devices is correctly recognized

Does sb4 partion size should be 4gb or can do whatever you want to set. In my case i have 32gb flash drive can i do more than 10gb ?

Arbitrary. Can be any size whatever allows you to extend resin-data beyond 2GB.