Homeassistant error after moving home folder to external usb hdd

Creating a bug report/issue

Required Information

cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=10
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’

Bullseye

$G_DISTRO_NAME
bullseye
dietpi@Pi4-black:~$ uname -a
Linux Pi4-black 5.15.74-v8+ #1595 SMP PREEMPT Wed Oct 26 11:07:24 BST 2022 aarch64 GNU/Linux

$G_HW_MODEL_NAME
RPi 4 Model B (aarch64)

  • Power supply used | 5V 3A switched

  • SD card used | kingston 128GB v30 A2

Additional Information

  • Software title | HOMEASSISTANT
  • the software title installed by dietpi software manager
  • Can this issue be replicated on a fresh installation of DietPi? Yes, on fresh install it persists

Steps to reproduce

  1. …install homeassistant
    Verify correct install and accessing it from pi_ip:8123 normally

  2. … Move home folder to external flash drive or to external usb hdd, then homeassistant service fails to find correct folder for starting

  3. … When i move back home folder to installation sd card, it works fine again.

Extra details

I believe the home assistant has a hard coded (?) Folder path, and when drive manager moves the home folder to an other location, whatever it is (could be external drive or even smb share) it fails to update the correct path to the home assistant installation, which continues looking for the default path /home/homeassistant

Hello everybody, came across dietpi a few weeks ago and i must say it is by far the best install. I am impressed! Very well organized…
So, trying to install home assistant, i came across an error when desided to move my install folder from the internal sd card that boots my pi to an external usb hdd…
I tried copying the contents of home folder back to the sd card (after moving them to the hdd) but still no luck (anyway, i wouldn’t want to use the sd card with home assistant since it is somewhat heavy on writing logs, a fact no sd card likes :slight_smile: )
Any thoughts?

why not flashing the whole image directly to your HDD and boot from it completely? This way you can remove the entire SD card.

Hi,
This is a very good idea.

But, the hdd is for storing media and my backups. Much data, and i think i would prefer it to remain as a separate drive on the pi, maybe even plug/unplug (if it is ever needed, without breaking other software running on the sbc)

Thank you Joulinar

ok I did a test on a RPi4 64bit system without issues. HA was installed initially on SD card and I moved dietpi_userdata to a usb pen stick afterwards.

The path /home/homeassistant stays untouched because it will not be moved. This is totally fine.

root@DietPi4:~# ls -la /home/homeassistant
total 32
drwxr-xr-x  4 homeassistant homeassistant 4096 Nov 10 09:17 .
drwxr-xr-x  4 root          root          4096 Nov 10 09:06 ..
drwxr-xr-x  3 homeassistant homeassistant 4096 Nov 10 09:14 .cache
lrwxrwxrwx  1 root          root            34 Nov 10 09:17 .homeassistant -> /mnt/dietpi_userdata/homeassistant
drwxrwxr-x 13 homeassistant homeassistant 4096 Nov 10 09:06 .pyenv
-rw-r--r--  1 homeassistant homeassistant    7 Nov 10 09:13 .python-version
-rwxr-xr-x  1 root          root           102 Nov 10 09:17 homeassistant-start.sh
-rwxr-xr-x  1 root          root           140 Nov 10 09:17 homeassistant-update.sh
-rw-r--r--  1 root          root           347 Nov 10 09:06 pyenv-activate.sh
root@DietPi4:~#

However, it contains a link to the .homeassistant directory located inside dietpi_userdata. That’s fine too. Can you check if the directory and link are existing.

ls -la /home/homeassistant/.homeassistant
ls -la /mnt/dietpi_userdata/homeassistant

ok, i run it, this is the result…
It seems that my home folder is this : /mnt/5TB/dietpi_userdata/
should i modify the .homeassistant link ? is this possible/the solution?

dietpi@Pi4-black:~$ ls -la /home/homeassistant/.homeassistant
lrwxrwxrwx 1 root root 34 Nov  6 20:29 /home/homeassistant/.homeassistant -> /mnt/dietpi_userdata/homeassistant
dietpi@Pi4-black:~$ ls -la /mnt/dietpi_userdata/homeassistant
total 936
drwxr-xr-x 1 homeassistant homeassistant    454 Nov  6 22:01 .
drwxrwxr-x 1 dietpi        dietpi           110 Nov  6 20:29 ..
-rw-r--r-- 1 homeassistant homeassistant      2 Nov  6 20:33 automations.yaml
drwxr-xr-x 1 homeassistant homeassistant     32 Nov  6 20:34 blueprints
drwxr-xr-x 1 homeassistant homeassistant      6 Nov  6 20:25 .cache
drwxr-xr-x 1 homeassistant homeassistant      0 Nov  6 20:42 .cloud
-rw-r--r-- 1 homeassistant homeassistant    319 Nov  6 20:33 configuration.yaml
drwxr-xr-x 1 homeassistant homeassistant      8 Nov  6 20:30 custom_components
drwxr-xr-x 1 homeassistant homeassistant     22 Nov  6 20:34 deps
-rw-r--r-- 1 homeassistant homeassistant      9 Nov  6 20:33 .HA_VERSION
lrwxrwxrwx 1 root          root              34 Nov  6 22:00 .homeassistant -> /mnt/dietpi_userdata/homeassistant
-rw-r--r-- 1 homeassistant homeassistant   4086 Nov  6 21:15 home-assistant.log
-rw-r--r-- 1 homeassistant homeassistant   9924 Nov  6 20:48 home-assistant.log.1
-rw-r--r-- 1 homeassistant homeassistant 917504 Nov  6 21:51 home-assistant_v2.db
drwxrwxr-x 1 homeassistant homeassistant    436 Nov  6 20:16 .pyenv
-rw-r--r-- 1 homeassistant homeassistant      7 Nov  6 20:24 .python-version
-rw-r--r-- 1 homeassistant homeassistant      0 Nov  6 20:33 scenes.yaml
-rw-r--r-- 1 homeassistant homeassistant      0 Nov  6 20:33 scripts.yaml
-rw-r--r-- 1 homeassistant homeassistant    161 Nov  6 20:33 secrets.yaml
drwxr-xr-x 1 homeassistant homeassistant   1272 Nov  6 21:51 .storage
drwxr-xr-x 1 homeassistant homeassistant      0 Nov  6 20:42 tts
dietpi@Pi4-black:~$ ls -la /mnt/5TB/dietpi_userdata/homeassistant
total 936
drwxr-xr-x 1 homeassistant homeassistant    454 Nov  6 22:01 .
drwxrwxr-x 1 dietpi        dietpi           110 Nov  6 20:29 ..
-rw-r--r-- 1 homeassistant homeassistant      2 Nov  6 20:33 automations.yaml
drwxr-xr-x 1 homeassistant homeassistant     32 Nov  6 20:34 blueprints
drwxr-xr-x 1 homeassistant homeassistant      6 Nov  6 20:25 .cache
drwxr-xr-x 1 homeassistant homeassistant      0 Nov  6 20:42 .cloud
-rw-r--r-- 1 homeassistant homeassistant    319 Nov  6 20:33 configuration.yaml
drwxr-xr-x 1 homeassistant homeassistant      8 Nov  6 20:30 custom_components
drwxr-xr-x 1 homeassistant homeassistant     22 Nov  6 20:34 deps
-rw-r--r-- 1 homeassistant homeassistant      9 Nov  6 20:33 .HA_VERSION
lrwxrwxrwx 1 root          root              34 Nov  6 22:00 .homeassistant -> /mnt/dietpi_userdata/homeassistant
-rw-r--r-- 1 homeassistant homeassistant   4086 Nov  6 21:15 home-assistant.log
-rw-r--r-- 1 homeassistant homeassistant   9924 Nov  6 20:48 home-assistant.log.1
-rw-r--r-- 1 homeassistant homeassistant 917504 Nov  6 21:51 home-assistant_v2.db
drwxrwxr-x 1 homeassistant homeassistant    436 Nov  6 20:16 .pyenv
-rw-r--r-- 1 homeassistant homeassistant      7 Nov  6 20:24 .python-version
-rw-r--r-- 1 homeassistant homeassistant      0 Nov  6 20:33 scenes.yaml
-rw-r--r-- 1 homeassistant homeassistant      0 Nov  6 20:33 scripts.yaml
-rw-r--r-- 1 homeassistant homeassistant    161 Nov  6 20:33 secrets.yaml
drwxr-xr-x 1 homeassistant homeassistant   1272 Nov  6 21:51 .storage
drwxr-xr-x 1 homeassistant homeassistant      0 Nov  6 20:42 tts

Happy/relaxed weekend everybody :slight_smile:

Maybe this might help?

│   home-assistant.service - Home Assistant (DietPi)                              │
│      Loaded: loaded (/etc/systemd/system/home-assistant.service; disabled;      │
│ vendor preset: enabled)                                                         │
│     Drop-In: /etc/systemd/system/home-assistant.service.d                       │
│              └─dietpi-services_edit.conf                                        │
│      Active: failed (Result: exit-code) since Thu 2022-11-10 12:56:29 EET; 2    │
│ days ago                                                                        │
│     Process: 33944 ExecStart=/home/homeassistant/homeassistant-start.sh         │
│ (code=exited, status=1/FAILURE)                                                 │
│    Main PID: 33944 (code=exited, status=1/FAILURE)                              │
│         CPU: 2.536s                                                             │
│                                                                                 │
│ Nov 10 12:56:27 Pi4-black systemd[1]: Started Home Assistant (DietPi).          │
│ Nov 10 12:56:29 Pi4-black Home Assistant[33944]: Fatal Error: Specified         │
│ configuration directory /mnt/5TB/dietpi_userdata/homeassistant does not exist   │
│ Nov 10 12:56:29 Pi4-black systemd[1]: home-assistant.service: Main process      │
│ exited, code=exited, status=1/FAILURE                                           │
│ Nov 10 12:56:29 Pi4-black systemd[1]: home-assistant.service: Failed with       │
│ result 'exit-code'.                                                             │
│ Nov 10 12:56:29 Pi4-black systemd[1]: home-assistant.service: Consumed 2.536s   │
│ CPU time.

did you tried to copy files yourself? Because there is stuf inside /mnt/dietpi_userdata/homeassistant that should not be there

These files should be located inside /home/homeassistant/

Home folder of user homeassistant should be /home/homeassistant/ . Can be checked as follow

cat /etc/passwd | grep homeassistant

can you check following in addition

ls -la /mnt
ls -la /home/homeassistant/

Well, i tried some things before posting, thinking might help before bothering you guys :slight_smile: maybe i copied contents of original folder to other folders just in case it might help (don’t remember if the copying was done on a previous attempt installing HA or this fresh install though).
Keep in mind that before moving the home folder i did run a bit home assistant to try it out.
This is the contnt of what you asked:

cat /etc/passwd | grep homeassistant
homeassistant:x:996:993::/home/homeassistant:/usr/sbin/nologin
dietpi@Pi4-black:~$ ls -la /mnt
total 32
drwxr-xr-x  7 root   root   4096 Nov  6 21:51 .
drwxr-xr-x 18 root   root   4096 Nov 10 12:46 ..
drwxrwx---  1 dietpi dietpi   90 Nov 10 12:44 5TB
lrwxrwxrwx  1 root   root     24 Nov  6 21:51 dietpi_userdata -> /mnt/5TB/dietpi_userdata
drwxrwxr-x  2 dietpi dietpi 4096 Oct 23 15:12 ftp_client
drwxrwxr-x  2 dietpi dietpi 4096 Oct 23 15:13 nfs_client
drwxrwx---  2 dietpi dietpi    0 Nov 12  2022 pi-1TB
drwxrwx---  2 dietpi dietpi    0 Nov 10 14:08 pi3-4TB

dietpi@Pi4-black:~$ ls -la /home/homeassistant/
total 36
drwxr-xr-x  4 homeassistant homeassistant 4096 Nov  6 21:53 .
drwxr-xr-x  4 root          root          4096 Nov  6 20:13 ..
-rw-------  1 homeassistant homeassistant   77 Nov  6 20:32 .bash_history
drwxr-xr-x  3 homeassistant homeassistant 4096 Nov  6 20:25 .cache
lrwxrwxrwx  1 root          root            34 Nov  6 20:29 .homeassistant -> /mnt/dietpi_userdata/homeassistant
-rwxr-xr-x  1 root          root           106 Nov  6 21:53 homeassistant-start.sh
-rwxr-xr-x  1 root          root           140 Nov  6 20:29 homeassistant-update.sh
drwxrwxr-x 13 homeassistant homeassistant 4096 Nov  6 20:16 .pyenv
-rw-r--r--  1 root          root           347 Nov  6 20:16 pyenv-activate.sh
-rw-r--r--  1 homeassistant homeassistant    7 Nov  6 20:24 .python-version

from directory structure, this all looks fine. Let’s try to start it manually.

systemctl stop home-assistant.service
sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh
exec hass -c '/mnt/dietpi_userdata/homeassistant'

Hmmmm… I might have a possesed pi after all

New output :eyes: :

dietpi@Pi4-black:~$ systemctl stop home-assistant.service
Failed to connect to bus: No such file or directory

homeassistant@Pi4-black:/home/dietpi$ . /home/homeassistant/pyenv-activate.sh


homeassistant@Pi4-black:~$ exec hass -c '/mnt/dietpi_userdata/homeassistant'
Fatal Error: Specified configuration directory /mnt/dietpi_userdata/homeassistant does not exist

Very curious …don’t you think? :thinking:

You need to execute this as root, but you are logged in as user dietpi.

You’re correct Jappe, run it again, no errors on first line, but last command is same (anyway, service was already inactive)

dietpi@Pi4-black:~$ sudo systemctl stop home-assistant.service
dietpi@Pi4-black:~$ sudo -u homeassistant bash

homeassistant@Pi4-black:/home/dietpi$ . /home/homeassistant/pyenv-activate.sh
homeassistant@Pi4-black:~$ exec hass -c '/mnt/dietpi_userdata/homeassistant'
Fatal Error: Specified configuration directory /mnt/dietpi_userdata/homeassistant does not exist
dietpi@Pi4-black:~$

But the directory is accessible if you have switched to used homeassistant?

Now we are on to something.
Joulinar you are perfect :ok_hand:

ok, i hadn’t tried user homeassistant till now!
1.This user can access the folder /mnt only
2.There is a !dietpi_userdata in RED with size 24 bytes but not accessible.
3.external HDD cannot be accessed
4. SMB shares are ok
5./home/homeassistant/ has folders: /.cache /.config /.local /.pyenv the HA-start and update .sh files, the pyenv-activate.sh the .python-version AND a !.homeassistant file of 34 bytes

(using MC)

i assume ( ! ) exclamation in front of a file means it cannot be accessed, right?

mind that external HDD is formated as btrfs form dietpi drive manager, but i do not think this poses a problem
(after all file systems are not on a top level layer and might be OS agnostic as well -given it is supported by the OS- )

root@Pi4-black:~# dietpi-launcher
[ INFO ] DietPi-Drive_Manager | Detecting drives, please wait...
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/mmcblk0p2 > /
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/mmcblk0p1 > /boot
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/sda1 > /mnt/5TB
[ INFO ] DietPi-Drive_Manager |  - Detected mounted network drive: //192.168.100.11/toshiba_ALL > /mnt/pi-1TB
[ INFO ] DietPi-Drive_Manager |  - Detected mounted network drive: //192.168.100.14/4TB > /mnt/pi3-4TB
[  OK  ] DietPi-Drive_Manager | mv .fstab /etc/fstab
[  OK  ] DietPi-Drive_Manager | systemctl daemon-reload
[ INFO ] DietPi-Drive_Manager | Checking for required APT packages: e2fsprogs
[  OK  ] DietPi-Drive_Manager | sync
[ SUB1 ] DietPi-Services > stop
[  OK  ] DietPi-Services | stop : knockd
[  OK  ] DietPi-Services | stop : cron
[  OK  ] DietPi-Services | stop : home-assistant
[  OK  ] DietPi-Services | stop : mosquitto
[  OK  ] DietPi-Services | stop : minidlna
[  OK  ] DietPi-Services | stop : smbd
[  OK  ] DietPi-Services | stop : nmbd
[ SUB1 ] DietPi Updating user data location >
[ INFO ] DietPi-Set_userdata |  - From : /mnt/dietpi_userdata
[ INFO ] DietPi-Set_userdata |  - To   : /mnt/5TB/dietpi_userdata
[ INFO ] DietPi-Set_userdata | Please wait...
[  OK  ] DietPi-Set_userdata | mkdir -p /mnt/5TB/dietpi_userdata
[  OK  ] DietPi-Set_userdata | Free space check: path=/mnt/5TB/dietpi_userdata | available=4519152 MiB | required=997 MiB
[ INFO ] DietPi-Set_userdata | Moving your existing data from /mnt/dietpi_userdata to /mnt/5TB/dietpi_userdata, please wait...
[  OK  ] DietPi-Set_userdata | Successfully moved your data from /mnt/dietpi_userdata to /mnt/5TB/dietpi_userdata.
[  OK  ] DietPi-Set_userdata | Completed
[ INFO ] DietPi-Drive_Manager | Detecting drives, please wait...
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/mmcblk0p2 > /
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/mmcblk0p1 > /boot
[ INFO ] DietPi-Drive_Manager |  - Detected mounted physical drive: /dev/sda1 > /mnt/5TB
[ INFO ] DietPi-Drive_Manager |  - Detected mounted network drive: //192.168.100.11/toshiba_ALL > /mnt/pi-1TB
[ INFO ] DietPi-Drive_Manager |  - Detected mounted network drive: //192.168.100.14/4TB > /mnt/pi3-4TB
[  OK  ] DietPi-Drive_Manager | mv .fstab /etc/fstab
[  OK  ] DietPi-Drive_Manager | systemctl daemon-reload
[  OK  ] DietPi-Drive_Manager | sync
[ SUB1 ] DietPi-Services > start
[  OK  ] DietPi-Services | start : nmbd
[  OK  ] DietPi-Services | start : smbd
[  OK  ] DietPi-Services | start : minidlna
[  OK  ] DietPi-Services | start : mosquitto
[  OK  ] DietPi-Services | start : home-assistant
[  OK  ] DietPi-Services | start : cron
[  OK  ] DietPi-Services | start : knockd
root@Pi4-black:~# mc
homeassistant@Pi4-black:/root$ mc
$ ls
This account is currently not available.
homeassistant@Pi4-black:/root$ ls
ls: cannot open directory '.': Permission denied
homeassistant@Pi4-black:/root$ cd /home
homeassistant@Pi4-black:/home$ ls
dietpi  homeassistant
homeassistant@Pi4-black:/home$ cd homeassistant
homeassistant@Pi4-black:~$ ls
homeassistant-start.sh  homeassistant-update.sh  pyenv-activate.sh
homeassistant@Pi4-black:~$ mc
$ ./dietpi_userdata
This account is currently not available.
$ ./dietpi_userdata
This account is currently not available.
$ ./dietpi_userdata
This account is currently not available.
  Left     File     Command     Options     Right
┌<─ /mnt ─────────────────────────────────.[^]>┐┌<─ ~ ─────────────────────────────────────.[^]>┐
│.n         Name          │ Size  │Modify time ││.n         Name           │ Size  │Modify time │
│/..                      │UP--DIR│Nov 13 18:01││/..                       │UP--DIR│Nov 13 14:48│
│/5TB                     │     90│Nov 13 18:04││/.cache                   │   4096│Nov 13 18:10│
│/ef46bced-1f3~81381daac1c│   4096│Nov 13 16:37││/.config                  │   4096│Nov 13 18:10│
│/ftp_client              │   4096│Oct 23 15:12││/.local                   │   4096│Nov 13 18:10│
│/nfs_client              │   4096│Oct 23 15:13││/.pyenv                   │   4096│Nov 13 14:48│
│/pi-1TB                  │      0│Nov 12 20:16││!.homeassistant           │     34│Nov 13 15:03│
│/pi3-4TB                 │      0│Nov 10 14:08││ .python-version          │      7│Nov 13 14:56│
│!dietpi_userdata         │     24│Nov 13 18:05││*homeassistant-start.sh   │    102│Nov 13 15:03│
│                         │       │            ││*homeassistant-update.sh  │    140│Nov 13 15:03│
│                         │       │            ││ pyenv-activate.sh        │    347│Nov 13 14:48│
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
│                         │       │            ││                          │       │            │
├──────────────────────────────────────────────┤├───────────────────────────────────────────────┤
│UP--DIR                                       ││UP--DIR                                        │
└────────────────────────────── 12G/14G (84%) ─┘└─────────────────────────────── 12G/14G (84%) ─┘
Hint: You can specify the username when doing ftps: 'cd ftp://user@machine.edu'
$                                                                                             [^]
 1Help    2Menu    3View     4Edit     5Copy     6RenMov  7Mkdir    8Delete   9PullDn  10Quit

This should be a symbolic link to the /mnt/5TB/dietpi_userdata folder located on your HDD

This should be a symbolic link to /mnt/dietpi_userdata/homeassistant

Could you try to access following as user homeassistant

ls -la /mnt/dietpi_userdata/homeassistant

Before revealing the output of this command, i would like to thank you all for the time devoted (YOUR time is not to take lightly) . My problem to solve but you made it yours as well, so thanks to those responded and also to thoso that just stopped by to check :slight_smile:

homeassistant@Pi4-black:/root$ ls -la /mnt/dietpi_userdata/homeassistant
ls: cannot access '/mnt/dietpi_userdata/homeassistant': Permission denied

hmm this should work normally.

Just a question, your drive is an ext4 formatted drive?

Can you share following as user root

ls -la /mnt/
ls -la /mnt/5TB
ls -la /mnt/5TB/dietpi_userdata/

file system for external drive: BTRFS
(don’t tell me we found a FS bug? )

sure, here it is:

root@Pi4-black:~# ls -la /mnt/
total 36
drwxr-xr-x  8 root   root   4096 Nov 13 18:05 .
drwxr-xr-x 18 root   root   4096 Nov 13 18:38 ..
drwxrwx---  1 dietpi dietpi   90 Nov 13 18:38 5TB
lrwxrwxrwx  1 root   root     24 Nov 13 18:05 dietpi_userdata -> /mnt/5TB/dietpi_userdata
drwxr-xr-x  2 root   root   4096 Nov 13 16:37 ef46bced-1f3f-4791-8394-281381daac1c
drwxrwxr-x  2 dietpi dietpi 4096 Oct 23 15:12 ftp_client
drwxrwxr-x  2 dietpi dietpi 4096 Oct 23 15:13 nfs_client
drwxrwx---  2 dietpi dietpi    0 Nov 12 20:16 pi-1TB
drwxrwx---  2 dietpi dietpi    0 Nov 10 14:08 pi3-4TB
root@Pi4-black:~# ls -la /mnt/5TB
total 20
drwxrwx--- 1 dietpi dietpi   90 Nov 13 18:38 .
drwxr-xr-x 8 root   root   4096 Nov 13 18:05 ..
drwxrwx--- 1 dietpi dietpi  286 Nov 12 04:59 BACKUP
drwxr-xr-x 1 root   root      0 Oct 29 16:57 dietpi-sync
drwxrwxr-x 1 dietpi dietpi  160 Nov 12 13:59 dietpi_userdata
drwx------ 1 root   root     26 Oct 30 08:37 rsync-scripts
root@Pi4-black:~# ls -la /mnt/5TB/dietpi_userdata/
total 11892
drwxrwxr-x 1 dietpi        dietpi             160 Nov 12 13:59 .
drwxrwx--- 1 dietpi        dietpi              90 Nov 13 18:38 ..
drwxrwxr-x 1 dietpi        dietpi               0 Nov  6 17:14 downloads
drwxrwxrwx 1 homeassistant homeassistant      576 Nov 13 18:04 homeassistant
drwxr-xr-x 1 minidlna      root                16 Nov 13 18:39 .MiniDLNA_Cache
drwxrwxr-x 1 dietpi        dietpi              32 Nov  6 17:22 Music
drwxrwxr-x 1 dietpi        dietpi               0 Nov  6 17:14 Pictures
drwxrwxr-x 1 dietpi        dietpi               0 Nov  6 17:14 Video
-rwxrw-rw- 1 dietpi        dietpi        12158903 Nov  6 23:44 window-cleaner-mockup.png

ok looks like your 5TB can be accessed by user/group dietpi only. That would explain why HA user has issues.

can you try following as user root

chmod 775 /mnt/5TB
systemctl restart home-assistant.service

hopefully logs will show a starting HA app now

journalctl -u home-assistant.service