What hard drive cloning and partitioning tools are available for home assistant?

Hi, I have used Linux quite a lot in the past, but not for several years. As I recall, Linux has some incredibly powerful tools for hard drive partitioning, cloning and for restoring backups.

Well anyway, when I built my Home Assistant machine, I rather went with an ultimate configuration and included a 120GB MSATA SSD. I won’t bore you with the details of my build, but my chain of logic was that since Linux has some extremely powerful tools for making and restoring back-ups to another drive, it should be a piece of cake just to follow the most popular set up guide, install and configure home assistant on a MicroSD card and then clone this install to my SSD.

Is there a way this can be done? If so which tools are available? Or was my rational somehow flawed?

I like rsync for fs cloning, but that does not get the boot flag for partitions, I think you want dd… this is assuming you are talking about Home Assistant OS

Well this might be dumb. But to be honest I don’t know the distinction between Home assistant OS and anything else? All I did was follow the guide on the Home Assistant page to install Home Assistant to a MicroSD card. So assuming that was/is Home Assistant OS (and given that I have CL access through terminal), is dd available in Home Assistant? If not, can it be installed somehow?

Do a fresh install on the target drive then restore your latest snapshot.

Most definitely the easiest way to do it. I’ve done this a few times, if you use the same IP address with the new install it is almost flawless.

What hardware are you using?

I have spent several weeks configuring my current install on the MicroSD card. I would prefer to clone and restore from a backup if possible? I am not being critical and I very much appreciate the responses, but there seems to be a bit of a culture in the Home Assistant community of avoiding using standard Linux command line tools to achieve relatively common tasks?

That would require quite a lengthy amazon shopping list. But if you mean which computer? I’m using a Raspberry Pi 4.

Yeah I did mean that.

You have been given a method to backup and restore. If you don’t want to do that, use rsync, dd, cp, whatever. If a tool is not on the system, use (eg) apk add rsync

That’s exactly what I suggested, restoring a backup :thinking:

The first task I think should be that I want to see my hard drives and partitions and format them from the command line. Are there any tools available for this?

You’re making it hard for yourself

Great response nick, thanks.

I like playing with the command line. It was the first add on I installed when I set my system up. I feel it makes things easier, rather than more difficult.

To be fair, I missed this response. Unfortunately this would require disassembly of my entire build to get at the SSD. So using standard cloning tools would be preferable in this case.

I think fdisk will be there. But don’t forget you can partition and format your drive from any computer, or boot the pi into raspbian os on a spare sd card and proceed to partition and format from there.

Why would you need to do that. Read the post.

I am a bit rusty with Linux Nick. As I said, it has been several years.

So just to check, before I go destroying anything. Is my SD card home assistant install referred to as /dev/mmcblk0 in the attached lsblk partition list - and is the as yet unused SSD refereed to as SDA? What should I use to format the SSD and in what file system should it be formatted? (It turns out the SSD is smaller than I remember, but I collected all the parts for my home assistant build over about 4 months, so I guess I must have been confused.) I don’t think it’s formatted, but it should be 120GB, but is only 111GB.

You didn’t attach anything.

But yes that would be correct.

Use mkfs to format. ext3 or ext4 would be my choices.