$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
…install homeassistant
Verify correct install and accessing it from pi_ip:8123 normally
… Move home folder to external flash drive or to external usb hdd, then homeassistant service fails to find correct folder for starting
… 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 )
Any thoughts?
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)
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
Well, i tried some things before posting, thinking might help before bothering you guys 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:
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
Now we are on to something.
Joulinar you are perfect
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
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
homeassistant@Pi4-black:/root$ ls -la /mnt/dietpi_userdata/homeassistant
ls: cannot access '/mnt/dietpi_userdata/homeassistant': Permission denied