Best practice to protect sd card (WIKI offers 2 options). Topic is solved
Moderator: leecollings
-
- Posts: 229
- Joined: Wednesday 30 April 2014 20:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Best practice to protect sd card (WIKI offers 2 options).
Hi all,
I want to protect my sd card against damage.
As far I can understand wiki offers 2 options:
1. Setting up a RAM drive on a Raspberry Pi;
2. Setting up overlayFS on Raspberry pi;
What’s he best practice? Why is this best practice not installed by default (like MQTT broker, NodeJS, Node-red)?
Thanks in advance.
I want to protect my sd card against damage.
As far I can understand wiki offers 2 options:
1. Setting up a RAM drive on a Raspberry Pi;
2. Setting up overlayFS on Raspberry pi;
What’s he best practice? Why is this best practice not installed by default (like MQTT broker, NodeJS, Node-red)?
Thanks in advance.
-
- Posts: 84
- Joined: Saturday 05 March 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: France
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Hello,
here's a free opinion, purely mine :
* Setting up overlayFS should be better, but it's complicated and not well documented on Internet, whereas setting up several RAM drive for often accessed directories is very easy, so if not perfect, a good solution.
The best practice is not yet available, and you're right, I hope that someone will do it. We already have a very good basis (Thank you very much gizmocuz).
Personally, I set up 3 ram drives (by adding theses lines to /etc/fstab) :
The first 2 are system standard, the third is for my "own personal usage". The question of setting a ram drive for /var/log can be discussed, it is my personnal choice.
I am very interested in other opinions or other enhancements.
Have a good day,
GD
here's a free opinion, purely mine :
* Setting up overlayFS should be better, but it's complicated and not well documented on Internet, whereas setting up several RAM drive for often accessed directories is very easy, so if not perfect, a good solution.
The best practice is not yet available, and you're right, I hope that someone will do it. We already have a very good basis (Thank you very much gizmocuz).
Personally, I set up 3 ram drives (by adding theses lines to /etc/fstab) :
Code: Select all
tmpfs /tmp tmpfs defaults,nosuid,nodev,noatime,mode=0755,size=4M 0 0
tmpfs /var/log tmpfs defaults,nosuid,nodev,noatime,mode=0755,size=6M 0 0
tmpfs /var/gai tmpfs defaults,nosuid,nodev,noatime,mode=0755,size=6M 0 0
I am very interested in other opinions or other enhancements.
Have a good day,
GD
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Isn't 6M to small for /var/log?
You 'may' assign more, it will only be assigned when in use. I have mine set to 300M on RPI2.
Ofcourse you have to clean you're logfiles now and then.
One thing to consider is logging to specific folders. Like nginx is default set to /var/log/nginx/...log so you need to alter those configs to.
You 'may' assign more, it will only be assigned when in use. I have mine set to 300M on RPI2.
Ofcourse you have to clean you're logfiles now and then.
One thing to consider is logging to specific folders. Like nginx is default set to /var/log/nginx/...log so you need to alter those configs to.
-
- Posts: 8
- Joined: Sunday 26 January 2014 15:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
There is a third option to protect the SD card: https://www.raspberrypi.org/forums/view ... 29&t=44177
I use this on all three of my rpi's (2x Domoticz, 1x OSMC).
I use this on all three of my rpi's (2x Domoticz, 1x OSMC).
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Very well written document, it seems to be best solution.guus_b wrote:There is a third option to protect the SD card: https://www.raspberrypi.org/forums/view ... 29&t=44177
I use this on all three of my rpi's (2x Domoticz, 1x OSMC).
In any case, SD or not SD, do you think that a daily/weekly reboot is needed to clean the system one in a while?
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Why should you reboot? A Linux system should (almost) never reboot.
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Perfect, thanks!
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
You can also move your filesystem to iscsi on a nas
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 229
- Joined: Wednesday 30 April 2014 20:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
Thanks a lot for the ansers. "Move the filesystem to a USB stick/Drive" seems the best solution. I feel like a noob at this point. It seems difficult but I'll try.
I 'm not sure that I can start with a fresh Domoticz image. Woody4165 you know an answer to this?
Thanks in advance!!
I 'm not sure that I can start with a fresh Domoticz image. Woody4165 you know an answer to this?
Thanks in advance!!
-
- Posts: 8
- Joined: Sunday 26 January 2014 15:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: NL
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
You don't need a fresh Domoticz image. The step sudo rsync -axv / /mnt in the procedure creates a mirror of the current situation of your SD card.
I would stop the domoticz service before running that command, though.
I would stop the domoticz service before running that command, though.
Code: Select all
sudo service domoticz.sh stop
-
- Posts: 229
- Joined: Wednesday 30 April 2014 20:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
I tried the suggestion of @ guus_b https://www.raspberrypi.org/forums/view ... 29&t=44177, without success. I got stuck very quickly (latest stable Domoticz).
After the command (df -h) the line rootfs is missing.
After ( lsusb) , for me everything seems OK
After ( tail /var/log/messages) , I can not find the USB stick.
What’s wrong?
Thanks in advance
After the command (df -h) the line rootfs is missing.
After ( lsusb) , for me everything seems OK
After ( tail /var/log/messages) , I can not find the USB stick.
What’s wrong?
Thanks in advance
-
- Posts: 229
- Joined: Wednesday 30 April 2014 20:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
I just started with a fresh Jessie image (without Domoticz). I followed the instructions carefully https://www.raspberrypi.org/forums/view ... 29&t=44177.
Got some errors wich I don't understand. I hope that somebody cab point me in a good direction.
Thanks
Got some errors wich I don't understand. I hope that somebody cab point me in a good direction.
Thanks
-
- Posts: 229
- Joined: Wednesday 30 April 2014 20:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: The Netherlands
- Contact:
Re: Best practice to protect sd card (WIKI offers 2 options).
I took a break and then I tried again. I started reformatting the USB stick. It now works as desired.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest