• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: how to preserve flash disk  (Read 2192 times)
bob38
Newbie
*

Karma: 1
Posts: 22


View Profile
« on: July 28, 2010, 11:50:13 PM »

Hello,

I work on embbeded system for a long time. And I'm surprised that some directories are not in tmpfs. I tested recently a sheevaplug, with Ubuntu. A very famous embbeded system, congratulation !

But I change some filesystems configuration. I put /tmp and /var/log in tmpfs format. To preserve flash disk, which has limited write actions. So, my  /etc/fstab file looks like:

        tmpfs   /tmp        tmpfs   defaults        0         0
        tmpfs   /var/log    tmpfs   defaults        0         0

Due to this update, I also update a start file, to create some directories which must exist in /var/log. I currently update the file /etc/init.d/mountall.sh to create these directories.

Because I do a lot of test with this material, I also change the apt cache, to not write regularly in flash disk. So, I replace the /var/cache/apt directory by a symbolic link to /var/log/aptcache, directory created at Sheevaplug startup.

If you have better solution to preserve the flash disk, I'm ready to listen it.

Regards

Bob the french


Logged

mundhra
Newbie
*

Karma: 1
Posts: 36


View Profile
« Reply #1 on: August 11, 2010, 08:17:39 AM »

this might be useful.
Logged

two9er
Jr. Member
**

Karma: 10
Posts: 51


View Profile
« Reply #2 on: August 11, 2010, 09:35:10 AM »

And this:
http://plugcomputer.org/plugwiki/index.php/Reduce_Flash_Writes
HTH, Jim
Logged

Just plugging away! GuruPlug Server Plus, 1TB esata hd, 8GB microSD (rfs)

Blüto
Newbie
*

Karma: 5
Posts: 38


View Profile
« Reply #3 on: August 15, 2010, 08:27:00 AM »

If you have better solution to preserve the flash disk, I'm ready to listen it.

Trčs simple: use flash for the purpose of storing a kernel/initrd but put your rootfs on a more suitable (or at least less fragile) device such as a USB stick, SD card or external HDD.

In principle, the whole system can be booted and run off the network with NO flash involvement apart from executing u-Boot.

Blüto l'American





Logged

sfzhi
Jr. Member
**

Karma: 1
Posts: 83


View Profile
« Reply #4 on: August 15, 2010, 01:42:58 PM »

I don't see any reason whatsoever why the root file system can not be read-only (and I believe it should be). Besides preserving the flash, it also protects the data from accidental damage by buggy software or, more likely, by a user's mistake, such as "sudo rm -rf /" Wink. I've been using this for many years on my home router.

The recipe is quite simple: mount tmpfs on /tmp and unionfs (or aufs, if you prefer) on /var. The unionfs/aufs mount should contain two branches: read-only - the original /var, and writable - another tmpfs mount somewhere (I use /mnt/var for that purpose). Using unionfs/aufs relieves you from the burden of creating all necessary files and directories in /var upon each boot.
Logged

Lack of knowledge is not such a big problem, unwillingness to learn is.

Pages: [1]
Print
Jump to: