User avatar
Andy_Capone
Posts: 3
Joined: Mon Aug 04, 2014 1:42 pm
Location: Germany
Contact: ICQ

[solved] Reduce writing on SD-Card/ move w1 slave files

Mon Aug 04, 2014 2:45 pm

Hello everyone :)
I'm new to Raspberry Pi (own and love one for about a month), Linux and this forum so I hope the is the right section to post my problem.
I know that often writing to the SD-card significantly reduces its lifetime, so I'm trying to put everything to USB or RAM that needs to write lots of stuff. I put the /var directory to a USB-stick and the data from my motion-detection is being written to RAM for example.
Now I'm working on cooling my RasPi and for that reason it detects the CPU- and roomtemperatures every few seconds. The roomtemperature is measured via a ds18b20 which writes to /sys/bus/w1/devices/SENSORID/w1_slave. Now, when I wanted to create a ramdisk for those files, I found out that every directory in /sys/bus/devices seems to be a link:

Code: Select all

andy@raspberrypi /sys/bus/w1/devices $ ls -l
total 0
lrwxrwxrwx 1 root root 0 Aug  4 15:27 28-00000577849d -> ../../../devices/w1_bus_master1/28-00000577849d
lrwxrwxrwx 1 root root 0 Aug  4 15:27 28-00000577f223 -> ../../../devices/w1_bus_master1/28-00000577f223
lrwxrwxrwx 1 root root 0 Aug  4 16:10 w1_bus_master1 -> ../../../devices/w1_bus_master1
What I don't understand is that they seem to point to themselves or am I wrong? If I wanted to mount a ramdisk in /drv/w1 for example, where do I put the links that point there?
Thanks for your advice :)
Last edited by Andy_Capone on Mon Aug 04, 2014 5:39 pm, edited 1 time in total.

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Reduce writing on SD-Card/ move w1 slave files

Mon Aug 04, 2014 3:59 pm

/sys
/proc
/dev
are not real filesystems
they don't exist on the SD card [as such]
Last edited by RaTTuS on Mon Aug 04, 2014 4:15 pm, edited 1 time in total.
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
Andy_Capone
Posts: 3
Joined: Mon Aug 04, 2014 1:42 pm
Location: Germany
Contact: ICQ

Re: Reduce writing on SD-Card/ move w1 slave files

Mon Aug 04, 2014 4:07 pm

Thanks for your reply. Does that mean I don't have to care about how often something is being written there?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reduce writing on SD-Card/ move w1 slave files

Mon Aug 04, 2014 4:09 pm

Andy_Capone wrote:Thanks for your reply. Does that mean I don't have to care about how often something is being written there?
The virtual filesystems (/proc /dev /sys) are only in kernel memory. They are never externalised to the SDCard. You can write to them all day (where allowed) and it's just waggling a few ones and zeros in RAM.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
Andy_Capone
Posts: 3
Joined: Mon Aug 04, 2014 1:42 pm
Location: Germany
Contact: ICQ

Re: Reduce writing on SD-Card/ move w1 slave files

Mon Aug 04, 2014 4:11 pm

I see, thanks a lot! :) Problem solved!

Return to “Beginners”