Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Filebrowser] Won't start with local drive mount #1008

Closed
DjordjeMandic opened this issue Sep 25, 2023 · 15 comments
Closed

🐛 [Filebrowser] Won't start with local drive mount #1008

DjordjeMandic opened this issue Sep 25, 2023 · 15 comments
Labels
bug Something isn't working stale Element will be closed automatically

Comments

@DjordjeMandic
Copy link

Description

Haos in Hyper-V, mounted 2 vhds. Second vhd used as data partition. Trying to mount sdb1 results in failure to start addon.

Reproduction steps

1. Go to configuration for addon
2. Add any disk to mount
3. Quickly watch logs

Addon Logs

Starting...
/etc/cont-init.d/00-banner.sh: executing
-----------------------------------------------------------
 Add-on: Filebrowser
 filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files
-----------------------------------------------------------
 Add-on version: 2.25.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.9.3
 Home Assistant Supervisor: 2023.09.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
NoAuth='true'
certfile='fullchain.pem'
keyfile='privkey.pem'
localdisks='sdb1'
ssl='false'
/etc/cont-init.d/00-local_mounts.sh: executing
Local Disks mounting...

Architecture

amd64

OS

Virtual Machine

@DjordjeMandic DjordjeMandic added the bug Something isn't working label Sep 25, 2023
@alexbelgium
Copy link
Owner

Hi, that’s all in the log ? And no error messages in the supervisor or core logs ?

@DjordjeMandic
Copy link
Author

Supervisor

23-09-26 12:54:02 ERROR (MainThread) [supervisor.docker.addon] Add-on Filebrowser try to access to blocked device sda!
23-09-26 12:54:02 ERROR (MainThread) [supervisor.docker.addon] Add-on Filebrowser try to access to blocked device sda1!
23-09-26 12:54:02 ERROR (MainThread) [supervisor.docker.addon] Add-on Filebrowser try to access to blocked device sdb1!

@alexbelgium
Copy link
Owner

alexbelgium commented Sep 26, 2023

Mmh Hyper-V is likely restricting access to the devices? As apparmor allows it :

"/dev/sda1",
"/dev/sdb1",

Perhaps you could try to mount by Label but I fear it would be the same

@DjordjeMandic
Copy link
Author

Why would hyper-v block it when it works normally as data prtition?

@alexbelgium
Copy link
Owner

That's a good question ;-) What is sure is that sdb1 device accessibility is enabled on the addon and works on HAos, so if the supervisor doesn't allow it the only difference I see is the usage of hyper-v...

@alexbelgium
Copy link
Owner

alexbelgium commented Sep 26, 2023

Actually I have an hyperV system I'll try to replicate ; on my system the disks are not named sda1 ; sdb1...

@alexbelgium
Copy link
Owner

alexbelgium commented Sep 26, 2023

Hi, you can create a file named /config/addons_autoscripts/filebrowser.sh with the content below, restart and copy paste the log here thanks

#!/usr/bin/env bashio

#################
# INSTALL TOOLS #
#################

# Install lsblk
if ! command -v "lsblk" &>/dev/null; then
    if command -v "apk" &>/dev/null; then apk add --no-cache lsblk >/dev/null; fi
    if command -v "apt" &>/dev/null; then apt-get update && apt-get install -yqq util-linux; fi
fi

####################
# LIST LOCAL DISKS #
####################

## List available Disk with Labels and Id
bashio::log.blue "---------------------------------------------------"
bashio::log.info "Available Disks :"
lsblk -o name,label,size,fstype,type,ro | awk '$5 != "" { print $0 }'
bashio::log.blue "---------------------------------------------------"

@DjordjeMandic
Copy link
Author

---------------------------------------------------
[16:23:52] INFO: Available Disks :
NAME   LABEL  SIZE FSTYPE   TYPE RO
├─sda2         24M squashfs part  0
├─sda3        256M squashfs part  0
├─sda4         24M squashfs part  0
---------------------------------------------------

image

@DjordjeMandic
Copy link
Author

I guess its problem with permissions and protection mode that blocks elevated system access from the add-on

@alexbelgium
Copy link
Owner

alexbelgium commented Sep 26, 2023

Indeed ; sdb1 isn't even visible as a valid fstype in lsblk - i fear I won't be able to help you.

Actually squashfs is probably not supported by the mount command ; it only supports ext*, fat* or ntfs based drives

@DjordjeMandic
Copy link
Author

This looks okay but sdb8 also does not work. Tried it also.

---------------------------------------------------
[16:34:07] INFO: Available Disks :
NAME   LABEL  SIZE FSTYPE   TYPE RO
├─sda2         24M squashfs part  0
├─sda3        256M squashfs part  0
├─sda4         24M squashfs part  0
---------------------------------------------------
---------------------------------------------------
[16:34:07] INFO: All Available Disks :
NAME   LABEL  SIZE FSTYPE   TYPE RO
sda            32G          disk  0
├─sda1         32M          part  0
├─sda2         24M squashfs part  0
├─sda3        256M squashfs part  0
├─sda4         24M squashfs part  0
├─sda5        256M          part  0
├─sda6          8M          part  0
├─sda7         96M          part  0
└─sda8       31.3G          part  0
sdb            64G          disk  0
└─sdb1         64G          part  0
zram0           0B          disk  0
zram1          32M          disk  0
zram2          16M          disk  0
---------------------------------------------------

@DjordjeMandic
Copy link
Author

Here is the output from root zsh

➜  ~ df -T
Filesystem           Type       1K-blocks      Used Available Use% Mounted on
overlay              overlay     66013004  18200248  45093528  29% /
/dev/sdb1            ext4        66013004  18200248  45093528  29% /media
/dev/sdb1            ext4        66013004  18200248  45093528  29% /ssl
devtmpfs             devtmpfs     1491232         0   1491232   0% /dev
tmpfs                tmpfs        1493268         0   1493268   0% /dev/shm
/dev/sdb1            ext4        66013004  18200248  45093528  29% /data
/dev/sdb1            ext4        66013004  18200248  45093528  29% /addons
/dev/sdb1            ext4        66013004  18200248  45093528  29% /backup
/dev/sdb1            ext4        66013004  18200248  45093528  29% /share
/dev/sdb1            ext4        66013004  18200248  45093528  29% /config
/dev/sdb1            ext4        66013004  18200248  45093528  29% /etc/asound.conf
/dev/sdb1            ext4        66013004  18200248  45093528  29% /run/audio
tmpfs                tmpfs         597308      1544    595764   0% /run/docker.sock
tmpfs                tmpfs         597308      1544    595764   0% /run/dbus
/dev/sdb1            ext4        66013004  18200248  45093528  29% /etc/resolv.conf
/dev/sdb1            ext4        66013004  18200248  45093528  29% /etc/hostname
/dev/sdb1            ext4        66013004  18200248  45093528  29% /etc/hosts
tmpfs                tmpfs        1493268         0   1493268   0% /dev/shm
/dev/sdb1            ext4        66013004  18200248  45093528  29% /etc/pulse/client.conf
tmpfs                tmpfs         597308      1544    595764   0% /run/log/journal
/dev/sdb1            ext4        66013004  18200248  45093528  29% /var/log/journal
tmpfs                tmpfs        1493268         0   1493268   0% /proc/asound
tmpfs                tmpfs        1493268         0   1493268   0% /proc/acpi
devtmpfs             devtmpfs     1491232         0   1491232   0% /proc/kcore
devtmpfs             devtmpfs     1491232         0   1491232   0% /proc/keys
devtmpfs             devtmpfs     1491232         0   1491232   0% /proc/timer_list
tmpfs                tmpfs        1493268         0   1493268   0% /proc/scsi
tmpfs                tmpfs        1493268         0   1493268   0% /sys/firmware

@alexbelgium
Copy link
Owner

alexbelgium commented Sep 26, 2023

I guess the system only expose the disks as squashfs which is not supported... Sorry

Perhaps your alternative is mounting your drive using the build in HAos system ; it didn't exist when I initially set my code but it allows mounting in /media I think

@alexbelgium
Copy link
Owner

Actually, if you have root access you should mount from root and not from HA... It doesn't seem possible otherwise. The native mount I talk above is actually limited to SMB/NFS shares and not for local driver.

alexbelgium added a commit that referenced this issue Sep 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Element will be closed automatically label Oct 2, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Element will be closed automatically
Projects
None yet
Development

No branches or pull requests

2 participants