Move data partition to SSD (USB)

Hello everyone and happy new year :slightly_smiling_face:
As stated, I am trying to move my data partition from my pi4 sdcard to my new ssd connected via usb using datactl.

So connected directly to my pi, I am using the command: datactl move /dev/sda
I get this:

Then after rebooting, I tried to see if there where any changes and I got this which seems to be as if nothing happened:

When using the datactl comand, there is a line saying that my ssd is too small.
My sdcard is 128gb (using approx 5% of that) and my ssd is 120gb.

Could this be the problem and is there a way I can move the data partition to my ssd?

2 Likes

Hey, I probably have the same problem. As it is recommended to use an SD Card for boot on RP4, i tried to migrate from my USB-Boot. As of now I am apparently back to everything on SD Card because datactl move fails. I deleted the only partition befor i started datactl.

# datactl move /dev/sda
WARNING: All partitions on /dev/sda will be deleted!
Enter "yes" to confirm: yes
Checking that no-one is using this disk right now ... OK

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: 00SSD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9E25DE29-81CE-7A43-A264-51E325B028D1

Old situation:

Device     Start       End   Sectors   Size Type
/dev/sda1   2048 976773134 976771087 465.8G Linux filesystem

>>> Script header accepted.
>>> Created a new GPT disklabel (GUID: 56503DFD-3DDC-E24F-A54B-436866D4E271).
/dev/sda1: Created a new partition 1 of type 'Linux filesystem' and of size 465.8 GiB.
/dev/sda2: Done.

New situation:
Disklabel type: gpt
Disk identifier: 56503DFD-3DDC-E24F-A54B-436866D4E271

Device     Start       End   Sectors   Size Type
/dev/sda1   2048 976773134 976771087 465.8G Linux filesystem

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Disk /dev/sda has been prepared to be used as data drive and the data
move has been scheduled for the next reboot. Please reboot the device now and
make sure to leave the disk connected to the system from now on.

I then reboot HomeassistantOS and get this:

# systemctl status hassos-data.service
â—Ź hassos-data.service - Home Assistant OS data partition migration
     Loaded: loaded (/usr/lib/systemd/system/hassos-data.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2020-12-16 17:26:47 UTC; 1 months 0 days ago
    Process: 216 ExecStartPre=/usr/bin/rm -f /mnt/overlay/move-data (code=exited, status=0/SUCCESS)
    Process: 217 ExecStart=/usr/libexec/hassos-data (code=exited, status=1/FAILURE)
   Main PID: 217 (code=exited, status=1/FAILURE)

Dec 16 17:25:17 homeassistant systemd[1]: Starting Home Assistant OS data partition migration...
Dec 16 17:26:47 homeassistant hassos-data[219]: Job for dev-disk-by\x2dpartlabel-hassos\x2ddata\x2dexternal.device timed out.
Dec 16 17:26:47 homeassistant hassos-data[217]: [ERROR] External data device  not found!
Dec 16 17:26:47 homeassistant systemd[1]: hassos-data.service: Main process exited, code=exited, status=1/FAILURE
Dec 16 17:26:47 homeassistant systemd[1]: hassos-data.service: Failed with result 'exit-code'.
Dec 16 17:26:47 homeassistant systemd[1]: Failed to start Home Assistant OS data partition migration.

Anybody got an idea?

So I received my new sd card. Only 64gb so now it’s smaller than my ssd. Retry and it worked.

1 Like

Your problem isn’t the same here.
Your datactl move /dev/sda was able to prepare everything, but when rebooting, it failed to applied.

Seems that you had a time out caused by a missing ssd.
Maybe try again.
The ssd was found before the reboot, so it’s maybe only a hiccup.

1 Like

Glad it worked out for you!
Also thanks for the tips, i tried to move the data partition again several times, also on different USB Ports, just to be sure, still the same result.
My SD Card is 32GB, the SSD is 512GB, so sd is also smaller than ssd…

The weird thing is, that it worked before with USB boot, so the USBAdapter shouldn’t be the problem either…

Just FYI, I am back in SSD Boot, the USB SSD was somehow never found in reboot. Preperation done three times, but same error as above.
I am staying in SSD Boot AS long as it is working without problems, never change a running system :wink:

How did things go 3 years later?

I am now running Home Assistant on a NUC in Docker.
Works fine!