Hardware Reference
In-Depth Information
What IS thIS WrIte-aND-eraSe CYCLe?
With a normal hard drive, every time you write something to the disk a sector on the disk changes its magnetic
state. this is a physical change in the disk platter and causes no wear to the platter itself. now when you read
from that same sector the physical platter has no change in state at all.
An sd card obviously has no physical platters but has small memory chips that contain cells. A cell is where the
bits of data are stored, much like a sector on the physical hard disk.
now, unlike the physical hard disk, when you read or write to a flash cell it will change its state.
this is because the flash cell uses a small amount of stored electrical charge to indicate that the data bits are
stored. this is where the write-and-erase cycle comes in: each time you read or write to a flash cell a cycle of the
cell is used. It moves from one state to another and there are a limited amount of cycles that each cell can sustain
before it will no longer hold any charge.
In the case of a standard SD card it has an endurance rating of around one hundred thousand cycles. A cycle can
be a write or an erase. Really, any time the voltage state on the flash cell is changed that's a cycle. Once you have
used up all of the one hundred thousand cycles your flash cells will simply stop working. Once your flash cells stop
working your SD card will be useless as you can no longer read or write to it.
One hundred thousand cycles may sound like a whole lot at first and for a digital camera, for example, it would
be. Now I want you to think about a journaling filesystem like EXT3 that the Fedora remix uses. A journaling filesystem
will write small amounts of data (called metadata) to the underlying device quite frequently. On top of the journal
writes you also have file and directory update times being written to the disk every time you update a file or directory.
You can see the erase cycles getting chewed up now!
By default the mount options for EXT4 on Fedora will use an option called atime , which will update the last
accessed time every time a file is touched by the operating system. Think about that in flash cell cycles again: all of a
sudden one hundred thousand cycles seems to be quite limited! Let's put an end to that updating of access time for
no valid reason.
There are two mount options that can be used to achieve this:
noatime , which simply won't update the access time. This is good for your flash
cells but bad for you, if you want date and time stamps on your files, for example. It may also
break some applications that rely on the access time stamp on their files.
The first is
relatime
mount option. The relatime option will update only the access time stamp if it's before the
modification time stamp. This will cut down a lot of writes to your flash cells. To turn relatime
on, edit your /etc/fstab file and make your root and boot filesystems look like Figure 2-14 . Note
that in Figure 2-14 the fstab file has no swap set up. We'll look at this issue in the next section.
To get a good balance of the two extremes you have the option of using the
Figure 2-14. Root and boot filesystem options
First, remount each filesystem:
# mount -o remount / && mount -o remount /boot
 
Search WWH ::




Custom Search