This tutorial is outdated.
With newer version of Raspbian you can install an USB SSD the same way as a sd card.
A lot of openHAB users are concerned about the reliability of sd cards. Under certain circumstances while using persistence services and with a lot of read/write cycles through openHAB and system logging they tend to worn out.
For the RPi3 there is a new USB mass storage boot mode which allows to boot the operating system from a harddisk, preferable an SSD harddisk, without the need of any sd card at all. You just need a sd card once to setup the boot mode. This will not work with older RPi1 or RPi2 models! After successful setup completion the sd card is removed and is not needed any more to boot the system.
Note: the new USB boot mode is provided through beta firmware and may not work with all USB harddisks.
More information and a general overview about the new boot modes can be found here:
I tested it with two old noname USB flash drives (8GB and 16GB) and they both worked. I then bought a 128GB USB 3.0 SSD harddisk and since two month Iâm using this setup without any problems.
Note: there is one step missing in that tutorial:
before entering the command sudo mkfs.vfat -n BOOT -F 32 /dev/sda1
you have to exit parted with quit
Update: a plain sudo apt-get update && upgrade is sufficient now, see also: https://www.raspberrypi.org/forums/viewtopic.php?p=1172476#p1172476 Note:
Because the new USB mass storage boot mode is provided through beta firmware you canât upgrade your system with apt-get upgrade
anymore. This will disable the USB mass storage boot mode and you have to start from scratch again.
Solution for this:
rename file /boot/.firmware_revision to something else, f.e. old_.firmware_revision
perform sudo apt-get update && sudo apt-get -y dist-upgrade && sudo BRANCH=next rpi-update
and voila, system and openHAB (if installed through apt-get) is up to date.
@sihui: When do I have to do this step? After preparing (and copy to) the ssd? Or before? Or after the removal of the sd and the first ssd boot? Or doesnât it matter? And I have noticed that after the apt-get steps the .firmware_revision file is created again. Is that correct?
Addition: you only have to do this if you already have successfully prepared your ssd for USB boot and want to upgrade your operating system.
Itâs not a step which has to be performed while first preparing and enabling the USB Boot mode.
One last question: I think the boot sequence (until I can log in to ssh) now takes longer (perhaps 10 sec.?!). Even though I am using a SSD drive. Do you know if this is normal?
I also have the impression that booting from an alternative device (e.g. USB stick) takes a bit longer, so Iâm guessing itâs normal. I presume that it checks for other boot devices first (e.g. SD) and only boots from the USB stick after the appropriate timeout.
Is it or will it be possible to move everything from SD card to USB SSD via the openhabian-config method or will that only move the data to the SSD and keep /boot on the SD card? I wouldnât necessarily want to install from scratch.
Noone? Do I have to do a fresh install of everything to boot / run completely from SSD? Or is there a way to port a running installation from microSD to SSD (e.g. via openhabian-config feature to boot from USB)?
Iâm no sure but when I did this a couple of weeks ago, I wasnât sure whether my SD image was corrupt so I backed up my user-data and conf files and made a new image on the SSD card. It didnât take long.
I copied the instructions from threads on here because I can never find anything easily a second time (so apologies for the plagarism).
Prepare SSD card
⢠Get new openHABian âŚ..img.zx zip file to PC.
⢠Extract on PC using [7-ZIP.exe]( http://www.7-zip.org/)
http://www.7-zip.org/
⢠Copy file to SSD using Win32DiskImager (Etcher doesn't seem to see SSD card)
Prepare RPI
(one way process for PI to enable it to boot from SSD)
Stop openHAB service (if running)
sudo apt-get update && sudo apt-get upgrade
echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
This adds program_usb_boot_mode=1 to the end of /boot/config.txt.
Reboot the Raspberry Pi with sudo reboot, then check that the OTP has been programmed:
vcgencmd otp_dump | grep 17:
17:3020000a
Ensure the output 0x3020000a is shown. If it is not, then the OTP bit has not been successfully programmed.
Remove the program_usb_boot_mode line from config.txt, so that if you put the SD card in another Raspberry Pi, it wonât program USB boot mode. Make sure there is no blank line at the end of config.txt. You can edit config.txt using the nano editor using the command sudo nano /boot/config.txt, for example.
Power down and remove SD card.
sudo shutdown -h now
Boot from SSD card
Copy back conf and user data files
Install any other stuff like Mosquitto (using openhabian)
If i set the bit to usb mode, then i can not boot this raspi 3 with a sdcard anymore? I only can use the sd-card as external drive for data storage, but never ever again for booting? Is this right?
So in other words the raspi gets âdamagedâ in any way (wrong word, but you know what i mean)?
No, although what you have set is OTP (One time programmable) so you canât unset it, the Pi still goes through a boot sequence - first it looks for a SD card to boot from and then an external USB drive.
So, with no SSD or USB plugged in but with an SD card fitted, it should still boot from SD.
Iâd try it with mine to confirm but Iâm on a soak test and donât want to switch it off!
I have set up a new system with a rpi3 B+ and a SSD.
I flashed the SSD with openhabian 2.3 image , conected it to the pi and started the system.
The installation was performed witout problems and the system is running.
OK to update the system in openhabian-config.
Have no errors in openhab log viewer but have noticed the following behavior on the pi:
The green status led repeatedly blinks fast 3 times make a pause of about 1 second and start over.
Is this a normal behavior or not?