Being nice to the SD Card

The SARPi project forum. For anything and everything relating to Slackware ARM on a Raspberry Pi 1, 2, and 3. This forum is NOT a replacement or substitute for the Slackware (ARM) forums on Linux Questions website! Please try to seek help there first about any issues you may be experiencing, or question you might have, before posting on here.
User avatar
linicks
Registered user
Registered user
Posts: 126
Joined: Mon Oct 27 2014 - 20:26:01
Location: Pompey, England

Being nice to the SD Card

Postby linicks » Sat Nov 22 2014 - 15:18:46

There is a nice thing that you can do with /etc/fstab. Turn off ATIME.

Info here (a bit dated but still applies even for ext4):

http://tldp.org/LDP/solrhe/Securing-Opt ... sec73.html

So basically adding 'noatime' to the system mount device stops your SD card being unnecessarily written to, and thus preserves life usage. Edit /etc/fstab and add 'noatime' thus:

Code: Select all

/dev/mmcblk0p3   /                ext4        defaults,noatime         1   0


I have been using the above on all my laptops/notebooks etc. for a few years now - you will not see any change in system usage.

Secondly, /boot/ partition does _not_ need to be mounted for a normal running system.

Edit /etc/fstab and add 'noauto' thus:

Code: Select all

/dev/mmcblk0p1   /boot            vfat        noauto,fmask=133,dmask=022 1   0


This now /boot/ will not be mounted at boot time, saving more work the SD card has to do - I have bee using this on my AMD64 Slack box since 2008.

Do _not_ forget though, that when you update system using rpi-update command to MOUNT it first:

Code: Select all

mount /boot


Nick

EDIT: There is a nice page here:

http://www.ideaheap.com/2013/07/stoppin ... pberry-pi/
https://linicks.net/

Q. What is the difference between a duck and an elephant?
A. You can't get down off an elephant.

User avatar
Exaga
FatDog Network Administrator
FatDog Network Administrator
Posts: 205
Joined: Wed Apr 18 2012 - 02:01:03
Location: England [UK]

Re: Being nice to the SD Card

Postby Exaga » Sat Nov 22 2014 - 23:12:49

Cool Nick, I always unmount my /boot partition. The noatime is interesting though.

Thanks! ;)
Exaga

====
__ KEEP THE DOG ALIVE!!!
()'`; /
/\|` W00f W00f W00f
www.fatdog.eu

User avatar
linicks
Registered user
Registered user
Posts: 126
Joined: Mon Oct 27 2014 - 20:26:01
Location: Pompey, England

Re: Being nice to the SD Card

Postby linicks » Sun Nov 23 2014 - 15:49:11

Yes, it works well.

I just updated and all is good - I have also turned off swap, as my Pi (even running all those services) still uses only 25% of RAM. I was also reading up on using zram, and implemented it on my notebook (took a kernel rebuild), and that is excellent - but the kernel on the Pi hasn't got the zram module in .config, so I can't use it here.

I still don't yet understand the kernel build cycle on the Pi... what with the firmware stuff - i.e. on my machines here at home I do (all static built, no modules - each kernel adjusted just for that machine):

wget latest_kernel
tar vxf latest_kernel
cd ./latest_kernel
make mrproper
zcat /proc/config.gz > .config
make oldconfig
make
...
...
cp bzImage to /boot
edit lilo
lilo -v
reboot

and that it. But how to do it on the Pi, I don't know.

Nick
https://linicks.net/

Q. What is the difference between a duck and an elephant?
A. You can't get down off an elephant.

Return to “SARPi Project - Slackware ARM on a Raspberry Pi”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests