Date: Tue, 1 Jul 2014 09:35:29 -0600 From: Warner Losh <imp@bsdimp.com> To: mexas@bris.ac.uk Cc: freebsd-arm@freebsd.org Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? Message-ID: <C8EFA73F-5D47-45A3-AF58-65E59A0BED95@bsdimp.com> In-Reply-To: <201407010925.s619PHeT006679@mech-cluster241.men.bris.ac.uk>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Jul 1, 2014, at 3:25 AM, Anton Shterenlikht <mexas@bris.ac.uk> wrote: > Why is it a good idea to mount /tmp and some var dirs on memory disks: > > root@raspberry-pi:/usr/ports # df -m > Filesystem 1M-blocks Used Avail Capacity Mounted on > /dev/mmcsd0s2a 14694 777 12742 6% / > devfs 0 0 0 100% /dev > /dev/mmcsd0s1 16 3 13 20% /boot/msdos > /dev/md0 28 4 22 16% /tmp > /dev/md1 14 0 12 0% /var/log > /dev/md2 4 0 4 0% /var/tmp > root@raspberry-pi:/usr/ports # > > Is this about speed or power, or maybe space? > > Can I not put all these dirs on sd card? > > I'm new to arm, so maybe things are different > to other arches. It isn’t so much about ARM as it is about SD cards. Each write to a file causes wear and tear on the card. Each update of metadata likewise. There are things that can be done (like enabling trim) that reduce the wear and tear on the card, NAND flash only has so much life. Do you really want to use it for data that’s at best disposable? No. SD cards these days are made from NAND that’s lucky to get 3k separate writes to it (or even worse: 500 in the case of TLC NAND). Given such a limited resource, nanobsd, and others, use MD devices to eliminate that wear and tear. It is the same rason there’s no swap partition... Having said that, I’ve run many development systems without doing this. They work fine, but doing it in production has shown to result in some SD cards (not all) breaking prematurely. Warner [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTstVCAAoJEGwc0Sh9sBEA1fAP/05hPbwe8Nh03ZKbUoJTSIJV P23q8KXX0ocRKwT8AJedhpNqTWHFTkAzF0cIGLEiatxQnsRSAosVDisAxZNlqYxH uA417z6EWt68R9BnTBCFu5/UmagszH1i6KSWTXWmxR2e8ltGSqf4RgXRj9qzJKKo UhNOsHsoI29820kErS7oykCMBSL+EinVOs/HI6OGm4Lnnu3crUHTMdces+TMXTk9 oG4R7KLPWNDJTXBdPrNyJysVnrM94/GvG+/6C1qG8T2b30oLdOS8jj7OU3mtkYJv QHBsiz011LxZAsLXpCQcTZj0xb/SzJ1jdI3p8XlBAVNNsWtxcpARV+3HuO1fBfOJ Psxyv0urhIAOsRqSZ63bg/MWP0U+3p3nGCV/0z5xmZV6iiXpexertFj+1/WOyvU2 nxxmbvpNtplQLI5jJCSCdBhKVqO2risEOxetSgMFCHLUTPMZ2eMsIVWATPSO0fiI M1XqR7eKaLcpnJZZtk9Gc6zet1CfiwxeLQzR8Thd56pgQpt7k0+Lul99Lxq9qe4K GumOGLF3SOV+282K/XJMCu5eNl+90HA51X6HZ+Gkj9PSI+rFGNcqOyOmmbn8RHWV yOpaX43fqX75GtjYIBWhRE/wJpUa7V3wgHDjGBQYv1RwzwlLO+eaeRI0efvT3lfW hM/LVl5NvOVtZ5J3behQ =yh03 -----END PGP SIGNATURE-----home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C8EFA73F-5D47-45A3-AF58-65E59A0BED95>
