Deleted my User file now locked out

Hi folks forgive me as this is day one with HA for me on an Odroid… It came with HA pre-installed.
I set up a few things from the initial wizard but then when I thought I was deleted my Home Map zone I think I have deleted myself as the only admin user.
And now can’t get past the HA username/password screen.
I have not added any devices yet so happy to do a ‘Factory Reset’ - what is the simplest way to do this?
I have plugged in a keyboard / HDMI screen into Odroid but still can’t get past the login.
Any help greatly appreciated as I get my head around a new OS!!
cheers, Jon

Why did you do that?? You may need to reimage the caes and restore your data from your off-card backup.

Where does that ask you for login? I’d expect it to show you a command line interface with a prompt like this: ha >.

There’s some general advice here:

1 Like

Hi Ondra thanks for your reply - I used root as login and can now see the ha command line interface…
Can you tell me what I enter to delete the config file to force a ‘factory reset’ new onboarding process?
thanks

Hi Prodigyplace - no idea why I did it! Was only a few minutes into HA and clicked the wrong thing…
I have now accessed the command line interface so is there a line of ha code that will force a reset back to as if new?
Thanks

I guess this should work:

ha core stop
login
cd /mnt/data/supervisor/homeassistant/.storage
rm auth auth_provider.homeassistant onboarding hassio cloud
exit
ha core start

Thanks Ondra - I entered the code and it all looked good.
It brought up the onboarding screen but then after entering new user / pw details it would not advance when the ‘Create Account’ button was clicked…
Any thoughts on next step?
Thanks again, Jon

Interestingly on the iOS app is still sees the name of the old ha server.
When I did the code you gave me it said it could not delete cloud as it did not exist so perhaps it didn’t delete everything?

It wasn’t really supposed to delete everything, it should have just started a new onboarding process.

I’ve fired up a VM (virtual machine) to verify that this won’t break your system even more, but it seems to be OK - Home Assistant should recreate the files. To delete everything:

ha core stop
login
cd /mnt/data/supervisor/homeassistant/
# Don't forget to run the cd command above first!
# This command deletes all files in current working directory.
# This will probably say "can't remove '.' or '..'", that's normal
rm -rf ./* ./.*
exit
ha core start

Thanks Ondra for your help. That helped and all back on track now. Cheers

Hi ondras can you please give me some advice?
I accidently run this command rm -rf ./* ./.* without switching into the cd /mnt/data/supervisor/homeassistant/ directory.
Is it possible to undo it somehow? It wont even start up :frowning:

I have this: https://ameridroid.com/products/odroid-n2-plus?ref=eeb6nfw07e

Thanks

You seem to have deleted all files on your system :frowning:
(I have edited my previous post to clarify that it’s crucial to run the cd command first, to hopefully prevent this from happening again.)
You’ll need to reinstall the OS

1 Like

On the plus side - every single one of us who have ever made this mistake, will never make it again!

1 Like