Comments (25)
I have had this problem ever since I first started experimenting with NC in Docker on Rpi. I solved it (for me) accidentally just the other day when I noticed that my external disk, mounted at the host’s /mnt/B1, was not mounted there or anywhere else inside the container!
So I used Portainer to duplicate/edit the container with another volume binding /mnt:/mnt
After deploying, I finally was able to create an external storage and use it. The ownership and permissions are also important, but I haven’t explored that stuff yet.
from pi-hosted.
I have had this problem ever since I first started experimenting with NC in Docker on Rpi. I solved it (for me) accidentally just the other day when I noticed that my external disk, mounted at the host’s /mnt/B1, was not mounted there or anywhere else inside the container!
So I used Portainer to duplicate/edit the container with another volume binding /mnt:/mnt
After deploying, I finally was able to create an external storage and use it. The ownership and permissions are also important, but I haven’t explored that stuff yet.Thanks for the information, tomorrow if I have time I'll retry from zero to implement this solution and see what will happen. I keep you in touch with my results !
I think I did it ! Here's my solution :
NextcloudPi installation
sudo apt-get update && sudo apt-get upgrade
wget -qO- https://git.io/JwUkc | bash && sudo reboot
(docker)
wget -qO- https://git.io/JwUnf | bash && wget -qO- https://git.io/JwUlY | bash
(portainer)
Access portainer via RPi_IP_adress:9000, setup the account and in the settings add this template list :
https://raw.githubusercontent.com/novaspirit/pi-hosted/master/template/portainer-v2-arm32.json
In this list install "NextcloudPi" :
And add the volume where you will mount your external storage "/mnt : /mnt" in my case
Connect to the nextcloudpi and activate nextcloudpi/nextcloud and log in.
Mount the storage ( ext4 partitions )
Convert your HDD/SDD partition to ext4 format.
find the partition of your storage (/dev/sdc1 in my case)
sudo mkdir /mnt/usb1
sudo mount /dev/sdc1 /mnt/usb1
sudo mkdir /mnt/usb1/Files
(mount and add a Files inside)
sudo chown -R www-data:www-data /mnt/usb1/Files (add permissions)
sudo chmod -R 0750 /mnt/usb1/Files
sudo ls -latr /mnt/usb1
(tcheck the permissions on the Files)
Add the storage on Nextcloud
- Restart your NextcloudPi container on Portainer
- Log on nextcloud
- Activate External Storage Application
- add the /mnt/usb1/Files local storage :
Then go to this new file and tcheck if you can add a readme file, if it's the case it's working !
I hope it'll help !
from pi-hosted.
Hi @aaronzueger,
I don't have an actual solution but I have the same problem as you.
In my case I used Portainer to install "NextcloudPi" custom image, it works fine. Now I want to add external HDDs to augment my stockage capacity.
I have a "Seagate Expansion drive" 4TB as HDD, in my RPi it is mounted as /media/pi/Seagate Expansion Drive.
In portainer I tried to add a bind volume like : /media:/media. I went to the bash shell of the container (via portainer) and I could find the "Seagate" file inside.
By tchecking on this I did:
sudo chown -R www-data:www-data /media/pi/'Seagate Expansion Drive'
sudo chmod -R 0750 /media/pi/'Seagate Expansion Drive'
And I added the local storage via external storage on nextcloud. As a result I can see the /media/pi folder but inside it's empty...
I saw on this link that the docker doesn't have all the NCP Apps like "nc-automount' that might help in our case. One solution could be to install the image of NextcloudPi on your RPi but you'll lose all the interest of Docker because you won't be able to install others applications (I think).
I also saw on this video someone using OMV + nextcloud and trying to add external storage (but i doubt the final result at the end of the video).
I saw also some forums talking about the ext4 format maybe that could help you ?
I asked on the nextcloud forums and I don't have any answers for the moment, this is why I wanted to tell you that you are not alone in this case ! If you are available we can try to find a solution together.
Any ideas on how to solve this @novaspirit ?
from pi-hosted.
I have had this problem ever since I first started experimenting with NC in Docker on Rpi. I solved it (for me) accidentally just the other day when I noticed that my external disk, mounted at the host’s /mnt/B1, was not mounted there or anywhere else inside the container!
So I used Portainer to duplicate/edit the container with another volume binding /mnt:/mnt
After deploying, I finally was able to create an external storage and use it. The ownership and permissions are also important, but I haven’t explored that stuff yet.
Thanks for the information, tomorrow if I have time I'll retry from zero to implement this solution and see what will happen. I keep you in touch with my results !
from pi-hosted.
@Tchiimy Thank you for your input.
It did not work for me exactly as you described, but it made me think about the problem with some fresh eyes.
As the hdds I attached to my pi used the ntfs fs, I could not change the owner and permissions after mounting the drive.
So I changed my /etc/fstab entry to:
UUID=3764ED523B21F43E /mnt/media ntfs-3g defaults,nls=utf8,umask=027,uid=33,gid=33,windows_names 0 0
where umask=027 changes the permission to 0750 and uid=33 changes the owner to www-data.
the umask id for a permission $perm is 777 - $perm
, and the uid may be retrieved by $ id -u www-data
from pi-hosted.
@Tchiimy Thank you for your input.
It did not work for me exactly as you described, but it made me think about the problem with some fresh eyes.
As the hdds I attached to my pi used the ntfs fs, I could not change the owner and permissions after mounting the drive.
So I changed my /etc/fstab entry to:
UUID=3764ED523B21F43E /mnt/media ntfs-3g defaults,nls=utf8,umask=027,uid=33,gid=33,windows_names 0 0where umask=027 changes the permission to 0750 and uid=33 changes the owner to www-data.
the umask id for a permission $perm is
777 - $perm
, and the uid may be retrieved by$ id -u www-data
Yeah in my case I didn't know of it was possible with nfts so I converted the partitions of my HDD to the ext4 format !
from pi-hosted.
Yeah in my case I didn't know of it was possible with nfts so I converted the partitions of my HDD to the ext4 format !
I didn't either, I guess I just had one lucky google search. Well know we do.
I still don't get the use of user www-data, as the ncp container is deployed with GID=1000 and UID=1000, which is the pi user.
The next challenge for me will be to add the same hdd to jellyfin, which doesn't seem to be working with above settings.
I'll keep you updated if I get it to work.
from pi-hosted.
Yeah in my case I didn't know of it was possible with nfts so I converted the partitions of my HDD to the ext4 format !
I didn't either, I guess I just had one lucky google search. Well know we do.
I still don't get the use of user www-data, as the ncp container is deployed with GID=1000 and UID=1000, which is the pi user.
The next challenge for me will be to add the same hdd to jellyfin, which doesn't seem to be working with above settings. I'll keep you updated if I get it to work.
Don't forget to make sure that your HDD will be mounted everytime the RPI will reboot (or it will fail on nextcloud).
I did it with :
sudo cp /etc/fstab /etc/fstab.backup sudo nano /etc/fstab
/dev/sdb2 /mnt/HDD1 ext4 defaults 0 0
And you can test it without reboot with : sudo mount -a
I'm curious about your jellyfin's problematic keep me in touch if you have a solution ! ( you installed it via portainer ?)
from pi-hosted.
Don't forget to make sure that your HDD will be mounted everytime the RPI will reboot (or it will fail on nextcloud).
I did it with :
sudo cp /etc/fstab /etc/fstab.backup sudo nano /etc/fstab
/dev/sdb2 /mnt/HDD1 ext4 defaults 0 0
And you can test it without reboot with :
sudo mount -a
I'm curious about your jellyfin's problematic keep me in touch if you have a solution ! ( you installed it via portainer ?)
Yes, I did edit my fstab. ;)
So I changed my /etc/fstab entry to:
UUID=3764ED523B21F43E /mnt/media ntfs-3g defaults,nls=utf8,umask=027,uid=33,gid=33,windows_names 0 0
I installed jellyfin via portainer (I used the template by @novaspirit) and I will keep you posted.
from pi-hosted.
Yeah in my case I didn't know of it was possible with nfts so I converted the partitions of my HDD to the ext4 format !
I didn't either, I guess I just had one lucky google search. Well know we do.
I still don't get the use of user www-data, as the ncp container is deployed with GID=1000 and UID=1000, which is the pi user.
The next challenge for me will be to add the same hdd to jellyfin, which doesn't seem to be working with above settings. I'll keep you updated if I get it to work.Don't forget to make sure that your HDD will be mounted everytime the RPI will reboot (or it will fail on nextcloud).
I did it with :
sudo cp /etc/fstab /etc/fstab.backup sudo nano /etc/fstab
/dev/sdb2 /mnt/HDD1 ext4 defaults 0 0
And you can test it without reboot with :
sudo mount -a
I'm curious about your jellyfin's problematic keep me in touch if you have a solution ! ( you installed it via portainer ?)
My system was working correctly yesterday but today I saw that during my reboot my RPi got this error :
usb 1-1.1: device descriptor read/64, error -32
Cause of this I can boot my RPi and I need to reset all my installation. I have the feeling it's linked with my HDD (that I formated in ext4).
Is it linked with power consumption ? My RPi is using :
- SSD to boot + the support
- Ventilation
- And the HDD
Any ideas about this problem ? What HDD do you use in your system ?
from pi-hosted.
The error itself related to harddisk error, either the disk fail or the usb adapter issue.
from pi-hosted.
[Jellyfin]
I got it to work, somehow.
My media hdd (WD RED Plus) is mounted to /media/media as follows:
UUID=3764ED523B21F43E /media/media ntfs-3g defaults,nls=utf8,umask=002,uid=33,gid=33,windows_names 0 0
As you see I changed umask from 027 to 002, because I've read somewhere that jellyfin needs permissions of 775.
I've setup Jellyfin manually like this. Jellyfin Portainer Setup
Then I restarted my Pi and it magically worked.
[Error]
My system was working correctly yesterday but today I saw that during my reboot my RPi got this error :
usb 1-1.1: device descriptor read/64, error -32
Cause of this I can boot my RPi and I need to reset all my installation. I have the feeling it's linked with my HDD (that I formated in ext4).
Is it linked with power consumption ? My RPi is using :
* [SSD](https://www.amazon.com/Timetec-256GB-200TBW-Performance-Internal/dp/B08GJB3P7H?th=1) to boot + the [support](https://www.amazon.fr/Geekworm-Raspberry-dextension-Jumper-uniquement/dp/B088LQWDBD/ref=sr_1_10?m=A2PBQMPS4N8CJ2&marketplaceID=A13V1IB3VIYZZH&qid=1637245265&qsid=259-8474190-4760314&s=merchant-items&sr=1-10&sres=B07VD5L1VY%2CB07ZVJDRF3%2CB095WD7BTW%2CB0828SRBTC%2CB091LKF3ZT%2CB08N617L1J%2CB09J4V3RYK%2CB07MN2GY6Y%2CB09295FHBW%2CB088LQWDBD%2CB09BW1M39Z%2CB07NLR49L1%2CB085NM7SY2%2CB096TV9164%2CB08VJC5CD4%2CB09CPG8D5Q) * [Ventilation](https://shop.mchobby.be/en/raspberry-pi-4/1659-silent-fan-cooler-for-raspberry-pi-3232100016590-garatronic.html) * And the [HDD](https://www.amazon.com/Seagate-Expansion-Portable-External-Drive/dp/B08ZJFH7Y1)
Any ideas about this problem ? What HDD do you use in your system ?
I did not have such a problem. As I'm new to this I can't tell you what could fix this right now.
I use a 4 TB WD RED Plus for media storage and a rather old 4 TB Toshiba HDD, which I had laying around, for data storage.
I hope you can fix this.
from pi-hosted.
Hello everyone,
I have discovered a new problem in my nextcloudPi installation.
I mounted my HDD as explained previously and I can create / delete files but I can't moves documents between files.
For example I create a folder "Downloads" which is link with my Transmission container (torrent). The idea is to download with Transmission and then move the files to another folder (linked with Jellyfin).
But I can't move files, is it linked with some kind of permissions ? (my files are mp4 and around 1GB)
I've seen that the files downloaded from Transmission in the file Downloads/complete can't be deleted this is why I can copy them but not delete them :
Maybe a file directly downloaded from Transmission will pass through the upload process of Nextcloud and miss something (this is why I can't delete them after ?)
Any ideas about this situation ?
from pi-hosted.
Hello everyone,
I have discovered a new problem in my nextcloudPi installation. I mounted my HDD as explained previously and I can create / delete files but I can't moves documents between files.
For example I create a folder "Downloads" which is link with my Transmission container (torrent). The idea is to download with Transmission and then move the files to another folder (linked with Jellyfin).
But I can't move files, is it linked with some kind of permissions ? (my files are mp4 and around 1GB)
I've seen that the files downloaded from Transmission in the file Downloads/complete can't be deleted this is why I can copy them but not delete them :
Maybe a file directly downloaded from Transmission will pass through the upload process of Nextcloud and miss something (this is why I can't delete them after ?)
Any ideas about this situation ?
I found the solution, Nextcloud needed to scan the files to detect them so I setup an auto-rescan with nextcloudpi :
from pi-hosted.
@aaronzueger Is your Jellyfin setup able to launch videos from .mp4 or .mkv files ?
I tried to launch .mp4 files from my nextcloud with Jellyfin but it doesn't seem to work (on firefox).
Is it the same for you ?
from pi-hosted.
@aaronzueger Is your Jellyfin setup able to launch videos from .mp4 or .mkv files ?
I tried to launch .mp4 files from my nextcloud with Jellyfin but it doesn't seem to work (on firefox).
Is it the same for you ?
@Tchiimy
My Jellyfin and my nextcloud instances play .mp4 files even with 1080p.
For me .mkv files cannot be played on Nextcloud either and Jellyfin struggles pretty hard (video stops about every 2 s), and struggles even more when not using the "auto - direct" quality.
Always remember that the Pi is not suitable for such heavy tasks as de- / encoding videos, and might get really hot as well. (I installed a cpu cooler I had laying around, to maybe prevent this, we'll see.)
We maybe get .mkv files to play on jellyfin by enabling hardware acceleration on the pi and in jellyfin.
I've found this reddit post on doing exactly this on a RPi4.
Have not tried it yet though, maybe you could deploy a second jellyfin container and try this.
I've set up hardware acceleration on my previous setup, where I didn't use docker, but used the same hardware. It kinda broke stuff back then, though I did not know what I was doing. I wasn't able to play .mkv in jellyfin anymore at all.
If it does not work as expected, I guess I'll just try the nextcloud addon called Automated media conversion, to automatically convert all .mkv files to .mp4, and maybe I then will be able to stream everything perfectly fine.
Edit: I use firefox as well.
Edit2: What permissions did you give the media folder (and it's subfolders / files) on your pi, which you're trying to play from through jellyfin?
from pi-hosted.
@Tchiimy Tried to switch everything to this account, well didn't work as planned.
Anyways, here I am now.
from pi-hosted.
Edit: I use firefox as well.
Edit2: What permissions did you give the media folder (and it's subfolders / files) on your pi, which you're trying to play from through jellyfin?
Ok so in my case I installed my Nextcloud into /mnt/HDD1/Nextcloud
I gave the permissions :
sudo chown -R pi:www-data /mnt/HDD1/Nextcloud
sudo chmod -R 0770 /mnt/HDD1/Nextcloud
Because I use Transmission to download torrents inside nextcloud (which need permissions for the user "pi") and nexcloud (needs permissions for the group "www-data").
This seems to work , I can download a file with Transmission and move it in another folder like "movies" which will be linked with Jellyfin.
To test the systems I used files in mp4 and mkv (the first file).
After testing (on firefox) :
- Nextcloud : mp4 is working and not mkv
- Jellyfin : mp4 working and mkv working (but lags every 2 seconds), h264 is also working
So I tried to install the application Automated media conversion and add a flow to automatise the process :
(sorry for the french in this picture)
The idea is : when a file is created and his MIME is mkv convert it to mp4.
The MIME type of mkv is : video/x-matroska
But netcloud doesn't seem to recognize it, by tchecking on this it's maybe possible to add this MIME type to nextcloud (I haven't tried because I don't know where is "nextcloud/resources/config/mimetypealiases.dist.json" in the container).
Do you have any ideas about this ?
Edit 1 : When I reboot my HDD will be remounted and I think i need to redo the permissions commands, is it possible to launch the lines : sudo chown -R pi:www-data /mnt/HDD1/Nextcloud
sudo chmod -R 0770 /mnt/HDD1/Nextcloud
at each reboot ?
from pi-hosted.
I'll have a look at the "mimetypealiases.dist.json" later, maybe I'll find it.
Edit 1 : When I reboot my HDD will be remounted and I think i need to redo the permissions commands, is it possible to launch the lines :
sudo chown -R pi:www-data /mnt/HDD1/Nextcloud
sudo chmod -R 0770 /mnt/HDD1/Nextcloud
at each reboot ?
Yes, there is a way:
In your /etc/fstab add:
umask=$PERMISSION,uid=$USER,gid=$USER
where $PERMISSION
is 777 minus the permission you want to apply and $USER
is the user id of www-data.
- The user id is retrieved by
$ id -u www-data
. (For me it's 33 on every instance I've tried, so it should be for you too.) - The permission I applied is 002 (777 - 775)
Then you get something like: /dev/sda /mnt/HDD1 ntfs-3g defaults,umask=002,uid=33,gid=33, 0 0
PS: Don't bother about the french ;)
from pi-hosted.
Then you get something like:
/dev/sda /mnt/HDD1 ntfs-3g defaults,umask=002,uid=33,gid=33, 0 0
In my case I want the user pi -> uid = 1000 and the group www-data -> gid = 33
So I tried with :
PARTUUID=f94bdcc5-f659-4176-9eb6-8547ea63aaf7 /mnt/HDD1/ ext4 defaults,umask=002,uid=1000,gid=33 0 0
And I think I crashed my system haha ( it's okay I'm new to this so I'm used to rebegin everything)
Is it because I missed the "," at the end ?
This should be better ? :
PARTUUID=f94bdcc5-f659-4176-9eb6-8547ea63aaf7 /mnt/HDD1/ ext4 defaults,umask=002,uid=1000,gid=33, 0 0
I saw that on internet people are using "noatime" option, what is this ?
When I reset my system I'll also try to look for the mimetypealiases.dist.json file !
from pi-hosted.
Is it because I missed the "," at the end ?
Simply, no. There should not be a "," at the end, my bad.
PARTUUID=f94bdcc5-f659-4176-9eb6-8547ea63aaf7 /mnt/HDD1/ ext4 defaults,umask=002,uid=1000,gid=33, 0 0
I'm not sure if there should / can be a "/" after HDD1, I'd leave this one as/mnt/HDD1
maybe uid and gid should be the same ... is the user pi part of the group www-data? If not this may be causing the problem.
You could use www-data as the user as well, and just use sudo if you want to do something as user pi, that's how I do it.
from pi-hosted.
Is it because I missed the "," at the end ?
Simply, no. There should not be a "," at the end, my bad.
PARTUUID=f94bdcc5-f659-4176-9eb6-8547ea63aaf7 /mnt/HDD1/ ext4 defaults,umask=002,uid=1000,gid=33, 0 0
I'm not sure if there should / can be a "/" after HDD1, I'd leave this one as/mnt/HDD1
maybe uid and gid should be the same ... is the user pi part of the group www-data? If not this may be causing the problem. You could use www-data as the user as well, and just use sudo if you want to do something as user pi, that's how I do it.
Ok by tchecking this I understand my error, the uid, gid doesn't apply in an ext4 system. And I think the chown command needs to be applied only once ( learning with mistakes haha )
I will tcheck if it's the case in ext4 and then I could try to format in ntfs, is everything working for you in this format ?
from pi-hosted.
Ok by tchecking this I understand my error, the uid, gid doesn't apply in an ext4 system. And I think the chown command needs to be applied only once ( learning with mistakes haha )
Okay, yes may be true.
I will tcheck if it's the case in ext4 and then I could try to format in ntfs, is everything working for you in this format ?
Yes for now everything works using ntfs, except for loading ncp backups (ncp says, the disk has to formatted in btrfs for this to work).
from pi-hosted.
I encountered a new problem.
When my SD card ran out of space (had to happen one day haha) I mounted the Jellyfin data and cache directories on my HDD as well.
This resulted in Jellyfin not being able to start, because it uses user pi and the HDD is mounted with owner www-data for Nextcloud to be able to mount it as well.
So in /etc/fstab i changed the mounting properties from uid=33,gid=33
to uid=1000,gid=33
.
Now the user owner of the HDD is pi and the group owner is www-data.
Everything now works again.
from pi-hosted.
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.
from pi-hosted.
Related Issues (20)
- [REQUEST] Teamspeak Server
- Flatnotes: Wrong Container Port HOT 2
- Heimdal dosent pull img HOT 3
- [REQUEST] please add wallabag HOT 4
- [QUESTION] bookstack.yml missing from repo HOT 1
- pi-weather-station not working
- Your-Spotify: Mongo Error server Error no matching manifest for linux/arm/v8 HOT 1
- Flatnotes Invalid Docker Volume Mapping Not Saving Notes to Target Path HOT 1
- Invidius doesn/t start properly, missing hmac_key from config. HOT 5
- AdGuard Home does not work anymore after reboot HOT 1
- [QUESTION] - Grafana/Pi-Monitor was working, but now several panels are empty. I do see an error in Cadvisor, is this the cause? How do we resolve it? HOT 3
- [QUESTION] Unable to access deployed containers HOT 1
- how to Add (SAMBA-Downloads folder) to PLEX? HOT 1
- Raspberry Pi Monitoring Using Grafana and Prometheus Does not work After raspberry restart HOT 2
- auto-discovery does not works in home assistant container if host bridge network is selected HOT 1
- update_portainer.sh - Failed to stop portainer! HOT 1
- Update the speed test tracker HOT 1
- failed to connect to local tailscaled; it doesn't appear to be running HOT 1
- Transmission w/ OVPN HOT 1
- Problem with filebrowser app from the templet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi-hosted.