From de67752a46bf5ede0d2f8b09c6155be346baae1a Mon Sep 17 00:00:00 2001 From: cogneato Date: Sun, 5 Jul 2020 03:58:42 -0600 Subject: [PATCH] Update datactl docs (#756) Co-authored-by: Franck Nijhof --- Documentation/partition.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Documentation/partition.md b/Documentation/partition.md index 1757c9dee..87e474fca 100644 --- a/Documentation/partition.md +++ b/Documentation/partition.md @@ -36,12 +36,33 @@ Sometime the bootloader part can look different because there can be firmware or ## Data -The data partition is the only partition with real I/O. It will be expanded automatic on boot time to the full size of the disk. +The data partition is the only partition with real I/O. It will be expanded automatically at boot to the full size of the disk. -This partition can be offloaded to a different drive with the utility: + +## Using datactl to move the data partition. + +In a Home Assistant OS installation, the data is stored on the `/mnt/data` partition of the SD card. This is the only read+write partition on the SD drive. Using the `datactl` move command, this partition can be moved off of the SD card onto an externally connected drive, leaving the rest of the read-only system on the SD. + +The storage capacity of the external drive must be larger than the storage capacity of the existing SD card. + +The command needs to be run from the host console by either connecting a keyboard and monitor or making use of the [debug ssh access](https://developers.home-assistant.io/docs/operating-system/debugging/) over port 22222. The command will not work from within an SSH add-on container. + +Log in as `root` to get to the Home Assistant CLI and then enter `login` to continue to the host. + +Confirm your USB SSD/HD is connected and recognized using `fdisk -l`. + +It is recommended to use fdisk to remove the existing partition(s) before proceeding. + +- Type `fdisk /dev/XXX` (replacing XXX with your drive) +- Type `d` to delete a partition. +- Continue if needed, then write the changes. + +Creating a new partition is not necessary. + +With the drive now prepared, use the below command (again, replacing XXX with your drive) ```sh $ datactl move /dev/xxx ``` -On next boot, the partition will be moved to the new drive. The drive needs to be bigger as the old one and we own the full new drive. +Hit any key to continue, and then the move will happen after the next reboot. Once complete, the external drive will be owned and used by the system.