Page 1 of 2
Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 12:11 pm
by andrew_sinclair
Hello,
I have recently decided to move my CumulusMX from the micro SD to a USB stick. Everything works fine when I 'manually' change directory to /media/pi/CUMULUS/Cumulus3107 and start CumulusMX using the command sudo mono CumulusMX.exe command.
I then went to change my crontab from
Code: Select all
# Start Cumulus as background task 30s after reboot (delay to allow WiFi to startup)
@reboot (sleep 30;cd /home/pi/CumulusMX3107;sudo mono CumulusMX.exe) &
# Reboot each day at 0253
53 02 * * * sudo reboot
#inactive line at the end
to
Code: Select all
# Start Cumulus as background task 30s after reboot (delay to allow WiFi to startup)
@reboot (sleep 30;cd /media/pi/CUMULUS/CumulusMX3107;sudo mono CumulusMX.exe) &
# Reboot each day at 0253
53 02 * * * sudo reboot
#inactive line at the end
but CumulusMX does not start 30 seconds after reboot. Have I got the root cd /media/pi/CUMULUS/CumulusMX3107 correct or is there anything else I am missing?
Thanks
Andrew
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 12:14 pm
by freddie
It could be that the job is being fired before the usb drive is ready - but then you should see some errors in your syslog.
Have you tried using the systemd startup method - i.e. run MX as a service?
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 12:42 pm
by andrew_sinclair
@freddie,
I did wonder about the timing aspects, I might change the 30s to 60s.
I haven't tried running as a service yet, mainly because I am on a learning curve and haven't quite taken to plunge. I thought what may be a good idea was to purchase a Pi Zero and then run it as a service on that.
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 12:48 pm
by andrew_sinclair
Quick update, changing 30s to 60s delay after startup has solved the problem, thanks @freddie.
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 5:04 pm
by galfert
I don't think the delay is going to solve your problem. The Raspberry Pi OS will not automount the USB drive unless you log in. If your Pi suddenly reboots (power outage), then the USB drive no matter how long you wait will not be mounted. Unless you have the Pi set to auto-login....which I think is not advisable for many reasons.
Therefore the better solution is to do as Freddie mentioned and use systemd startup method.
You can follow my guide:
viewtopic.php?f=40&t=18766
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 5:29 pm
by andrew_sinclair
@galfert,
Thanks for the link. I need to grit my teeth and go for it.

Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 7:18 pm
by galfert
Another recommendation is to not use an SD card at all. Setup and boot the Raspberry Pi directly from your USB hard drive. It will run much faster if you use an SSD.
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 8:38 pm
by andrew_sinclair
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 9:05 pm
by mcrossley
galfert wrote: ↑Sat 20 Feb 2021 7:18 pm
Another recommendation is to not use an SD card at all. Setup and boot the Raspberry Pi directly from your USB hard drive. It will run much faster if you use an SSD.

I have done this with both my Pi 3B, and my Pi 4. A much better solution all round.
Note the 3B boot from SSD is a one way thing, once you have configured it is permanent and there is no going back.
The Pi4 is much more flexible, it will boot preferentially from the SSD, but if there are issues it will revert to booting from the SD card if one is present.
Re: Start CumulusMX @reboot from USB stick
Posted: Sat 20 Feb 2021 11:12 pm
by andrew_sinclair
@galfert and @mrcrossley
Just for my own technical edification under what circumstances is the speed of running an issue?
My Pi is dedicated to running CumulusMX and seems to me, a layman, the running of execution is fine.
The only reason I moved Cumulus to a USB stick was to reduce wear and tear on the SD card.
Thank you
Andrew
Re: Start CumulusMX @reboot from USB stick
Posted: Sun 21 Feb 2021 1:49 am
by galfert
If you only run Cumulus MX on the Pi with the SD then you will probably not notice the difference unless you are pulling some historical reports, or do database backups. However when you do operating system updates, when you reboot, you will notice the difference in performance. But is very responsible to decide to not use the SD card for database storage.
Re: Start CumulusMX @reboot from USB stick
Posted: Sun 21 Feb 2021 2:03 am
by galfert
mcrossley wrote: ↑Sat 20 Feb 2021 9:05 pm
Note the 3B boot from SSD is a one way thing, once you have configured it is permanent and there is no going back.
For clarification...regarding the PI 2B v1.2, 3A+, 3B, Compute Module 3, 3+, the no going back is in reference to the OTP bit (One-Time-Programable) memory. Which means you can't disable it. But you can still boot from SD card if you don't have a USB drive to boot from.
https://www.raspberrypi.org/documentati ... des/msd.md
Re: Start CumulusMX @reboot from USB stick
Posted: Sun 21 Feb 2021 11:13 am
by SamiS
andrew_sinclair wrote: ↑Sat 20 Feb 2021 11:12 pm
Just for my own technical edification under what circumstances is the speed of running an issue?
.....
The only reason I moved Cumulus to a USB stick was to reduce wear and tear on the SD card.
I have run CumulusMX from SD card since 2018 without an issue. If you use a good quality power supply with a good quality card, and MX is the only ”active” usage of the Pi, it should run for years without any problems. Of course eventually the card will probably become unreliable, but replacing it proactively once in 3-5 years or something like that doesn’t take much effort.
For example Kingston’s High Endurance cards are warranted for 3 years of continuous full hd recording with 13Mbps bitrate. That means an endurance of over 5,8 gigabytes of write
every hour for 3 years totalling about 150TB of writes! If CumulusMX would write 1GB/day (probably an overestimate), that would mean a card endurance of over 400 years. Of course the operating system also writes to the card, but this gives at least some perspective.
Re: Start CumulusMX @reboot from USB stick
Posted: Sun 21 Feb 2021 11:37 am
by andrew_sinclair
@SamiS
Thanks for the information, that does indeed give some perspective. I am concerning myself over nothing perhaps

Re: Start CumulusMX @reboot from USB stick
Posted: Sun 21 Feb 2021 1:27 pm
by andrew_sinclair
@freddie and @galfert
galfert wrote: ↑Sat 20 Feb 2021 5:04 pm
Therefore the better solution is to do as Freddie mentioned and use systemd startup method.
I have taken the plunge and all seems to be working well apart from when I reboot. The service should start automatically but it fails because it cannot change diectory. I suspect this is because the USB is taking a finite time to become avaiable. I had the same problem with crontab and the solution was to increase sleep 30 to sleep 60 to allow sufficient time. Can the execution of the autostarting of cumulus.service be delayed?