1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-05-01 06:02:23 +01:00
Files
operating-system/buildroot-external/rootfs-overlay/usr/lib/systemd/system/hassos-data.service
Stefan Agner 46bb12844f Rewrite datactl command (#1046)
* Rewrite datactl command

Prepare the target partition as part of the datactl command. Rely on
partlabel for the target disk since we are always using GPT on the
target disk. Use systemd and partlabel mechanism to wait and find
the target data disk. Keep using the file system label to identify
the source disk.

Also use e2image instead of raw dd to move data. This should
speed up the processes significantly.

* Fix corner case when reusing same disk again
2020-12-03 20:05:02 +01:00

19 lines
691 B
Desktop File

[Unit]
Description=Home Assistant OS data partition migration
DefaultDependencies=no
RefuseManualStart=true
RefuseManualStop=true
Requires=mnt-overlay.mount dev-disk-by\x2dlabel-hassos\x2ddata.device dev-disk-by\x2dpartlabel-hassos\x2ddata\x2dexternal.service
Wants=hassos-expand.service
After=mnt-overlay.mount dev-disk-by\x2dlabel-hassos\x2ddata.device systemd-fsck@dev-disk-by\x2dlabel-hassos\x2ddata.service dev-disk-by\x2dpartlabel-hassos\x2ddata\x2dexternal.service
Before=hassos-expand.service
ConditionPathExists=/mnt/overlay/move-data
[Service]
Type=oneshot
ExecStartPre=-/usr/bin/rm -f /mnt/overlay/move-data
ExecStart=/usr/libexec/hassos-data
[Install]
WantedBy=local-fs.target