<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I use Voyage-Linux since 3 years as WiFi HotSpot with Coova Chilli, Apache2, PHP5, MySQL and FreeRadius.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As I need to log every users actions, I’ve completely disabled the read-only system.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I use regular CF (MLC ship, not SLC) and I’m very happy with it.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Some of my boxes are running since 3 years and I never encounter any problems on any CF…<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I didn’t tweak any parameter, I just use Voyage-Linux stock config and it works great for me.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sylvain<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De :</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Voyage-linux [mailto:voyage-linux-bounces+sylvaingomez=free.fr@list.voyage.hk] <b>De la part de</b> Jordi Soucheiron<br><b>Envoyé :</b> jeudi 11 juillet 2013 10:34<br><b>À :</b> Nils Toedtmann<br><b>Cc :</b> voyage-linux<br><b>Objet :</b> Re: [Voyage-linux] Best Practices for writing logs & data to CF<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><br clear=all><o:p></o:p></p><div><p class=MsoNormal><b>Jordi Soucheiron</b><br>Software Engineer<br><a href="mailto:jsoucheiron@dexmatech.com" target="_blank"><span style='color:#669900'>jsoucheiron@dexmatech.com</span></a><br><br><b>DEXMA</b><o:p></o:p></p><div><p class=MsoNormal>Marie Curie, 8-14, Barcelona, ES-08042<o:p></o:p></p><div><p class=MsoNormal>5 Penn Plaza, Suite 2300, New York, NY 10001<br>t: (+34) 93 181 01 96<o:p></o:p></p><div><p class=MsoNormal><a href="http://www.dexmatech.com" target="_blank">www.dexmatech.com</a><br><br>Follow us on <a href="http://www.twitter.com/dexma" target="_blank">Twitter</a> and <a href="http://www.linkedin.com/company/247838" target="_blank">Linkedin</a><br>Síguenos en <a href="http://www.twitter.com/dexma_ES" target="_blank">Twitter</a> y <a href="http://www.linkedin.com/company/dexma-tech" target="_blank">Linkedin</a><o:p></o:p></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>2013/7/11 Nils Toedtmann <<a href="mailto:voyage-linux-mail@nils.toedtmann.net" target="_blank">voyage-linux-mail@nils.toedtmann.net</a>><o:p></o:p></p><p class=MsoNormal>Dear Voyage community<br><br><br>First: Voyage Linux is great! It makes building embedded systems<br>significantly easier - thanks to everyone who contributed!<br><br><br>I have a number of questions about writing data to CF on ALIX (before<br>you rant about even wanting to do this - see my use case and motivation<br>in the PS below).<br><br>I apologize in advance if i haven't found existing answers in the Voyage<br>documentation. I did do some research, but admit that being only a<br>sysadmin, i didn't dive into the depths of Voyage's development docs.<br><br><br>Here are my questions:<br><br> * Most documentation says that CF wears down quickly when many write<br>operations happen. But those docs are 5-10 years old. Do modern<br>'industrial grade' CF cards still suffer from this problem? I wonder<br>because nowadays it is pretty common to use flash based SSDs in<br>write-heavy systems.<o:p></o:p></p><div><p class=MsoNormal>Heavy writing in SSD is not usually a good idea. The disks will inevitably wear down eventually. It's only a matter of time, but it may be worth it depending on what you need to do. <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br> * PC Engine recommend [1] to have partitions aligned to flash's 2K or<br>4K page size. But most partitioning software assumes 63 sectors (512<br>bytes each) per track. How would i partition a CF card such that the<br>partitions are aligned properly, e.g. using Voyage's fdisk? Maybe just<br>use multiples of '8 tracks = 63*4K'?<br><br> * I have the rootfs on a ro partition, and write my data to a separate<br>rw partition. Is it safe to assume that even if a powercycle corrupts my<br>data partition, that the rootfs partition is still intact?<o:p></o:p></p></blockquote><div><p class=MsoNormal>It should work just fine. I've known many people that has a factory default values in ro partitions and restore it in case of failure of the rw partition. I use rw for the whole disk most of the time and I mount the logs directories in ram. I usually sync this directories every hour or so to reduce the cf wear. <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br> * Besides your recommendations to adjust the vm.dirty_* syscontrols<br>when writing to CF [2] - What are your recommended file systems and<br>mount options for rw data partitions to reduce the risk of data loss on<br>a powercycle? E.g. i see people recommending to use ext3 or ext4 with<br>'journal=data' and/or 'sync' (at the expense of reduced write speed). Is<br>that sound?<o:p></o:p></p></blockquote><div><p class=MsoNormal>Journaling systems increase the number of writes to the CF. You should consider If it's worth it. Remember that ext3 is basically ext2 + journaling. <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br> * Does Voyage Linux do a file system check when it mounts additional<br>file systems if they have fs_passno=2 (6th field) in /etc/fstab? Does<br>the fsck call include the "-y" option to force automatic fixing mode?<br><br> * Would it work if i symlinked /var/log/ into a rw data partition and<br>removed it from 'SYNC_DIRS' in /etc/init.d/voyage-sync ?<o:p></o:p></p></blockquote><div><p class=MsoNormal>You don't need to symlink it, just mount it there ;) And yes, it should work<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Sorry but I can't help you with the others<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br><br>Any advise would be greatly appreciated!<br><br><br>Cheers, /nils.<br><br><br>[1] <a href="http://www.pcengines.ch/cfperf.htm" target="_blank">http://www.pcengines.ch/cfperf.htm</a><br>[2] <a href="http://linux.voyage.hk/content/getting-started-v09x" target="_blank">http://linux.voyage.hk/content/getting-started-v09x</a><br><br><br>PS: Disclaimer & use case:<br><br>I know that CF is not advised for permanent storage when powercycles can<br>happen at any time. We use ALIX + Voyage linux to collect and cache, and<br>send sensor data to central servers. The data we write to CF is not<br>critical. However, for a number of reasons it would be very helpful if<br>the data survived powercycles:<br><br> * Cached sensor data that hasn't been sent out yet (some of our ALIXes<br>have unstable uplinks, e.g. 3G) would not get lost<br><br> * Stored states would allow the data collection to resume significantly<br>quicker<br><br> * Logs up to just before a system fault (e.g. OOM) would be very<br>helpful for debugging<br><br>_______________________________________________<br>Voyage-linux mailing list<br><a href="mailto:Voyage-linux@list.voyage.hk">Voyage-linux@list.voyage.hk</a><br><a href="http://list.voyage.hk/mailman/listinfo/voyage-linux" target="_blank">http://list.voyage.hk/mailman/listinfo/voyage-linux</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>