I should think so, as I said never done a container mount myself.
well Iām not there w/ the container file yet, was just trying you recipe for the symlink
well, then it should work. If there is an issue, Iāll gladly try to setup this for myself and ādocumentā a solution. But I hope you enjoy playing around in shell and get more comfortable there, because you can do real magic with your OSMC device when you feel comfortable in shell. I mean my device is so much more then just a video-device.
agreed. i already run NextDNS CLI on it. and borgbackup
do I need to mount the *.img first to a dir on /media/ā¦ and only then mount this mount point to the ~/osmc?
Did this but it seems I get no permission to write
write permission problem in OS or vsftp?
hmm, ftp canāt write into the dir (mounted *.img)
okey then we got to look in the ftpd logs, youāll find the location in vsftpd.conf file somewhere under /etc folder, to see if there is something obvius. Itās 11pm here and Iām about to hit the sack. If you havenāt got it to work tomorrow afternoon for me Iāll try to do a image file mount and share it via vsftpd.
hi, I canāt check this out before the weekend, I believe ā too busy w/ day job
Iāll do some quick testing here then, if the mrs permits =). Will get back to you
@thobu Well the mrs didnāt premit much this week =)
But reward comes to those that wait, login to your osmc user folder, via ssh and do this:
mkdir /home/osmc/containers
dd if=/dev/zero of=/home/osmc/containers/test1_container.img bs=1M count=1024
mkfs.ext4 /home/osmc/containers/test1_container.img
sudo mkdir -p /mnt/test1
sudo mount -t ext4 -o loop,rw /home/osmc/containers/test1_container.img /mnt/test1
sudo chmod 777 /mnt/test1/
mkdir /home/osmc/test1-storage/
sudo mount -o bind,rw /mnt/test1/ /home/osmc/test1-storage/
sudo nano /etc/vsftpd.conf
At the bottom of the file insert this line:
allow_writeable_chroot=YES
Then CTRL+x,y,ENTER
Restart the ftp server:
systemctl restart vsftpd
Login via your ftp client, and go to your ātest1-storageā folder in you home directory. I did this and voila I could write, read files and create folder. Didnāt try to delete anything or write more then 1 gigabyte of data, but I guess it would work.
So modify the file and folder names to suite your needs.
So whatās need to be done is convert those mount lines to fstab entries. Good Luck
hey, thanks ā¦ Iāll study the recipe and see how far I can get.
one question: do I read this correctly and you created the img container under ~/osmc/containers. Would it also work for an image container on a /media location?
Itā should work, but you have to make sure osmc user has read/write to that /media location, when mounting the image file as a folder ~/ or /mnt/container, and then a bind mount from /mnt/container/ to /home/osmc/thisistheimagefsfolder.
As long as the file system gives you r&w access, ftpclient should have the same in the end.
thanks, Iāll check this out once Iām back from a week of vacationsā¦
it seems to work as I get the recordings in both /mnt/test1 and in /home/osmc/test1-storage. But Iām actually not sure since I tell the camera to write to /test1-storage. Does this setup control the /test1-storage via the /mnt/test1 and the container and limits it to the 1GB defined for the .img. Is this what it does?
As I understood it, yes. You make a mount of the 1gb file as a ext-fs into /mount/test1, then bind a folder in /home/osmc/test1-bind-folder, which has āthe sameā function as a ln would have. So in short when you write in the ābind-folderā, it gets writen to your 1gb filesystem, Represented twice in your Root file system, but it shouldnāt be two copies of it.
you said something about the fstab file. how would I add these 2 mount commands, would this work?
/home/osmc/containers/test1_container.img /mnt/test1 none defaults,bind 0 0
/mnt/test1/ /home/osmc/test1-storage/ none defaults,bind 0 0
Iām no fstab expert, add these lines (changed to your perfered paths) at the end of fstab, I think would work:
# Initial mount (this example uses smb to connect to NAS), but if you are using an extrnal hdd, it should automount when connected/reboot in /media filder instead
//servername/sharename /mnt/windowsshare cifs guest,uid=1000,iocharset=utf8 0 0
# loopback (container file)
/mnt/windowsshare/contrainerfile.blob /mnt/container ext4 defaults,x-systemd.requires-mounts-for=/media/windowsshare,loop 0 0
#bind to osmc-home folder directory
/mnt/container /home/osmc/preferred_name none bind,x-systemd.requires=/mnt/container
This is untested, but thatās from my understanding how it should work. the requires option makes it so that the remote filesystem is there first, then next that the containers is mounted before binding to your preferred folder.
Ps. since I havenāt tested it, I would make sure mount points exist, that is mkdir em once, before trying out the fstab. If there are errors in my suggested setup, you are stuck with google for solutions, Iām not knowledgeable enough in fstab to be more help full.
thanks man, Iāll look into this and check the fstab documentation. For the time being Iām using the local dirs so no initial mount necessary for this, I guessā¦