== TIMESTAMPS == 0:00 bind mount that works after reboot 14:00 writing bash script 19:35 creating cron job Please also see previous video: ruclips.net/video/aEzo_u6SJsk/видео.html where we configured that share and LXC container connectivity. Scripts: *************************** mount.sh script: #!/usr/bin/env bash qm start 202 until [ "$(qm status 202 | awk '{print $2}')" == "running" ]; do sleep 2 done sleep 20 mount -t cifs -o user=smbuser,password=marekpass //192.168.1.202/MiniPC /mnt/minipc sleep 20 lxc-start -n 203 ************************** crontab -e: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin @reboot /usr/bin/bash /opt/scripts/mount.sh Please let me know if you have any questions. Marek
Thank you for another great video. Explained very well, easy to follow. All I had to do was pay attention, and translate my own information in place of your specific info and I'm good. I subscribed. We need more guys like you.
Very informative, I like the style of your video I would suggest for anyone that comes here and follows your steps to ls the mount from outside the mount directory during testing. That way you avoid blocking the mount from happening by having that directory locked by your terminal. i.e: ls -la /mnt/minipc instead of cd /mnt/minipc ls -la
It's a great advise ! Well - what can I say - my video PROVES that YOUR way is the way to run that command :) Thank you for watching and for taking the time to comment ! Marek
What a fantastic guide! I do have a quick question. I have 2 different LCXs that require different SMB mount points that I have working thanks to your last video. The question is do I just create 2 different .sh scripts and add the crontab lines twice ?
Great video and very helpful - thanks! Could you maybe tell / show how to amend the script to mount / unmount an external HDD when starting the PLEX/Jellyfin container? This way you would not need to have an external HDD attached to the Homeserver all the time to watch a movie every now and then.. This would be super helpful - I did not find any tutorials how to do this.. Thanks!
Hi! If you need to mount your disk only when you need to use it then I would check` autofs` tool rather than standard mount which is very limited for that specific use case. Please see more here: help.ubuntu.com/community/Autofs Hope that helps ! Thanks for watching - Marek
First of all: Big Thanks to this 2 videos. I have 2 thinks I'm struggeling with. 1) you wrote ...dev/null... in the cronjob but not in your video description. Does this mean you don't need it or is it just missing in the description? and the big second one. For me it does not work because of: -bash: /opt/scripts/mount.sh: No such file or directory but its there..... Someone got a hint for me?
Hi Yes sorry, only after publishing the video I realized that you cant use angled brackets in the description, so I had to drop that portion of config but yes - it should not have any influence on the script itself, it was just a simple redirection. You might also be interested in the new video I have just released - Bind mounts vs Volumes - what are they? What's the difference between them? Link below: ruclips.net/video/keINzeYs_lc/видео.html Kind regards Marek
Can you elaborate? How that would work after reboot when the VM needs to be started first and be fully up and running before you mount anything? I know there are some other possibilities, I am aware you can achieve something similar with autofs, but not sure how you can do that with simple entry in fstab file as I tried and it simply doesnt work so please let me know. Thank you for your comment!
== TIMESTAMPS ==
0:00 bind mount that works after reboot
14:00 writing bash script
19:35 creating cron job
Please also see previous video:
ruclips.net/video/aEzo_u6SJsk/видео.html
where we configured that share and LXC container connectivity.
Scripts:
***************************
mount.sh script:
#!/usr/bin/env bash
qm start 202
until [ "$(qm status 202 | awk '{print $2}')" == "running" ];
do
sleep 2
done
sleep 20
mount -t cifs -o user=smbuser,password=marekpass //192.168.1.202/MiniPC /mnt/minipc
sleep 20
lxc-start -n 203
**************************
crontab -e:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@reboot /usr/bin/bash /opt/scripts/mount.sh
Please let me know if you have any questions.
Marek
Thank you for another great video. Explained very well, easy to follow. All I had to do was pay attention, and translate my own information in place of your specific info and I'm good. I subscribed. We need more guys like you.
Happy I could help, thank you for watching and commenting :)
Very informative, I like the style of your video
I would suggest for anyone that comes here and follows your steps to ls the mount from outside the mount directory during testing. That way you avoid blocking the mount from happening by having that directory locked by your terminal.
i.e:
ls -la /mnt/minipc
instead of
cd /mnt/minipc
ls -la
It's a great advise ! Well - what can I say - my video PROVES that YOUR way is the way to run that command :)
Thank you for watching and for taking the time to comment !
Marek
What a fantastic guide! I do have a quick question. I have 2 different LCXs that require different SMB mount points that I have working thanks to your last video. The question is do I just create 2 different .sh scripts and add the crontab lines twice ?
Most frustrating thing for me(newb) is passing devices/data to containers. This is helpful, thanks
I agree, it takes a while to get used to.
Thank you for watching!
Marek
Great video and very helpful - thanks!
Could you maybe tell / show how to amend the script to mount / unmount an external HDD when starting the PLEX/Jellyfin container? This way you would not need to have an external HDD attached to the Homeserver all the time to watch a movie every now and then.. This would be super helpful - I did not find any tutorials how to do this.. Thanks!
Hi! If you need to mount your disk only when you need to use it then I would check` autofs` tool rather than standard mount which is very limited for that specific use case.
Please see more here: help.ubuntu.com/community/Autofs
Hope that helps !
Thanks for watching - Marek
Bind to container can be done in the GUI too by adding mount point to resources. Thanks the the previous video, I needed it’s solution yesterday!
Thank you for the video. It worked well for me.
You're welcome! Thank you for watching.
Marek
First of all: Big Thanks to this 2 videos. I have 2 thinks I'm struggeling with.
1) you wrote ...dev/null... in the cronjob but not in your video description.
Does this mean you don't need it or is it just missing in the description?
and the big second one.
For me it does not work because of:
-bash: /opt/scripts/mount.sh: No such file or directory
but its there.....
Someone got a hint for me?
Hi
Yes sorry, only after publishing the video I realized that you cant use angled brackets in the description, so I had to drop that portion of config but yes - it should not have any influence on the script itself, it was just a simple redirection.
You might also be interested in the new video I have just released - Bind mounts vs Volumes - what are they? What's the difference between them? Link below:
ruclips.net/video/keINzeYs_lc/видео.html
Kind regards
Marek
Just add mounting options to fstab in host and bind mount that location to lxc container.
Can you elaborate? How that would work after reboot when the VM needs to be started first and be fully up and running before you mount anything? I know there are some other possibilities, I am aware you can achieve something similar with autofs, but not sure how you can do that with simple entry in fstab file as I tried and it simply doesnt work so please let me know.
Thank you for your comment!
Thank you so much sir, Really helpful topic
I am glad I can help! Thank you for your comment !
Marek
Hi, i have followed the instructions, but when i try to connect to the share it is Read Only. is there anyway to make this writable
@neilharris try to change the permission on the folder "chmod +x /your/folder
Thanks.
You're welcome !