OpenHABian Boot From SSD on Raspberry Pi 4

Is there a good guide to moving to SSD from SD on a raspberry pi 4?

The firmware apparently does not/did not allow for this and needed /boot/cmdline.txt to be configured somehow.

After a couple hours of trial and error, googling and reading threads, I cannot cobble together the right sequence of events… and I can’t find an exact guide.

openhabian-config does not warn about the Pi 4 issue and just results in a non-bootable pi until you fix cmdline.txt

1 Like

Has anyone had any success with this? I’m trying to install OH on an ssd but it will not boot. There are remarks that i need an external power supply for the ssd enclosure, because the USB 3 port is not powered on first start.

Hey, you still need a MicroSD card to boot your pi4. But you can run Openhabian on an SSD. I’m running the same setup for Months now without any issues.
Just follow my previous post and you should be good.

I believe you’re into the XY problem, i.e. to use an SSD to avoid running into SD card corruption.
That you don’t need. Consider going ZRAM instead.

hi Edward, followed the directions to the letter and it still boots from the SD card. I’m just running OH on it. The last operation (13) doesn’t look quite right for the OH . everything else seemed to copy over OK, just appears though the command isn’t being seen.

the comand ‘sudo nano /boot/cmdlinetxt’ i think should be cmdline.txt. this enables it to boot from the ssd but it has a fatel error and hangs. I also cant ssh in.

@Mocca, Hi Michael, correct, it should be cmdline.txt, it’s just a type (as often in these blogs).
This is the content of my cmdline.txt:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait

Before I started I made sure that my Openhabian install was running as expected and all Bindings and addons where functional. I created a copy of the SD Card image while fully operational and running to a mounted NFS drive:

sudo dd if=/dev/mmcblk0 of=/mnt/backup/RASP05_pre_SSD_move.img bs=1M status=progress

And this is the short documentation of the actual steps I took:

# Add External SSD Disk 
# Tested and conducted on Raspberry pi 4
# Reference:,39782.html

# Assuming a new clean SSD (or other SATA disk)
sudo fdisk -l
sudo fdisk /dev/sda
	type p
	type d (to delete an exisiting partiion else skip)
	type n, p, type 1, enter, enter
	type w (write to disk)
sudo mkfs.ext4 /dev/sda1
sudo mkdir /mnt/ssd
sudo mount /dev/sda1 /mnt/sda1
sudo rsync -avx / /mnt/ssd
cp /boot/cmdline.txt
sudo vim /boot/cmdline.txt
	dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda1 rootfstype=ext4 elevator=deadline rootwait
sudo shutdown -r now

# After reboot:
sudo df -h
[15:54:36] openhabian@rasp05:~$ df -h
	Filesystem             Size  Used Avail Use% Mounted on
	/dev/root              110G  4.8G  100G   5% /
	devtmpfs               1.9G     0  1.9G   0% /dev
	tmpfs                  2.0G  360K  2.0G   1% /dev/shm
	tmpfs                  2.0G   18M  2.0G   1% /run
	tmpfs                  5.0M  4.0K  5.0M   1% /run/lock
	tmpfs                  2.0G     0  2.0G   0% /sys/fs/cgroup
	/dev/mmcblk0p1         253M   41M  212M  16% /boot  5.5T  4.8T  626G  89% /mnt/qnas
	tmpfs                  396M     0  396M   0% /run/user/999
	tmpfs                  396M     0  396M   0% /run/user/1000


Again, worked like a charm for me. I conducted these steps nearly 6 Months ago and the darn thing is still running flawlessly.
As for the SSH issue, could you access the PI using SSH before you took the move root step? I assume you are running the PI headless? And I assume you could mount the SSD?

Also probably worth mentioning is that I’m using this device to connect my SSD:


Hi Edward. The drive had some conflict with some files and was running so slow that the ssh timed out. let it sit on the bench running for a bit, then i rebooted it by pulling its plug and it booted fine this time. performed the usual upgrades and setting changes, rebooted again and no fault. running well and now i can ssh in. all i need to do now is move everything over from the pi3 don’t see a problem so far just running OH shell It also takes a heck of a lung time to boot. Like 5 mins. there must be something not right

Hi @Mocca Michael, the move from Pi3 to Pi4 should be easy. Make sure both are running the same OH and OS version, same Bindings and Add-ons (don’t configure Items and Things on the Pi 4). And then use openhab-cli backup on the Pi 3 and openhab-cli restore on the Pi 4.
If all is fine now please flag this post as Solved :slight_smile:

Hi Edward, unfortunately the ssd conversion isn’t going well as all. The connected screen to the pi4 has a constant screen of errors from the ssd on it. The drive is constantly flashing. it takes approximately 5 mini for the log in command to come up after a reboot. once the login command comes up, im able to ssh in but it is slow. really slow. think i might need to format the drive completely and start over. windows wont even look at the ssd drive if i plug it into my home pc. Its a little frustrating to say the least.

Hi Michael, consider reformatting the SSD from Windows (if that is your preferred OS) and run some extensive disk checks using the available tools on board or on the web. That would eliminate the chance that the issue is on the SSD itself.

windows doesn’t see it. what other programs do you recommend to format the drive in a usb3 case

Hey Michael, depending on what you have available. If you have a linux box or a Mac that’s fine and straight forward. If you are running Windows and don’t have a Linux install you could go for a Linux VM on Windows 10 (or Windows Server) using HyperV.
In that case use the Debian distro, Raspbian and Openhabian are based on Debian Buster.
But hey, you do have at least two Pi’s right? Just grab a new Micro SD card and do a fresh install of Raspbian. Then from the Pi do al the magic to wipe, partition and format the SSD.

Hi Edward. I have a couple of pi’s. I did a complete wipe and started again. The boot time is completely random, sometimes i can ssh in is 90 sec, other times it could be 5 min or so. I also get some random errors when it does boot. last one was the "failed to start Bluetooth modem’ which is odd because it was not enabled. I need to wait until the ssd light stops flashing before i ssh in otherwise it crashes. T he only part that i couldn’t do from your description was the line ‘type n, p, type 1, enter, enter’ it wouldn’t let me enter the ‘p’ command. just ‘n’ and then ‘1’.


Hi Edward,
thank you for your instructions. I have been trying to run openhabian from an SSD for a long time.
Your instructions are short and crispy, wonderful. But
is it possible that your script should not say “sudo mkdir / mnt / ssd” but “sudo mkdir / mnt / sda1”?
I’m a little unsure.

Greetings Dirk

Hi Dirk, my bad, it proofs nobody is perfect. You are correct, if you de a:

sudo mkdir /mnt/sda1

you obviously also need to do a:

sudo mount /dev/sda1 /mnt/sda1

It’s all about keeping the naming of your choice consistent.
Hope this helps, feel free to reach-out if you have additional queries :slight_smile:


Hall Edward,
thank you for your quick feedback. It may also help other users. :+1: