FLASH  MEMORY  AS A  HARD  DRIVE REPLACEMENT Seminar by Hisham Pasha.N.K. Roll No:8 S5 MCA 06/03/11 GEC_Thrissur
OVERVIEW <ul><li>FLASH BASICS </li></ul><ul><li>FLASH DEGRADATION </li></ul><ul><li>FLASH MEMORY V/S HARD DISK DRIVES </li...
HARD DISK STRUCTURE 06/03/11 GEC_Thrissur
HARD DISK STRUCTURE 06/03/11 GEC_Thrissur
STRUCTURE OF A USB FLASH DRIVE 06/03/11 GEC_Thrissur
Applications of flash memory <ul><li>DIGITAL CAMERAS </li></ul><ul><li>PERSONAL DIGITAL ASSISTANTS (PDAs) </li></ul><ul><l...
FLASH MEMORY USED IN DEVICES  06/03/11 GEC_Thrissur
FLASH DEGRADATION <ul><li>Storage units perform two basic functions: </li></ul><ul><li>- reading </li></ul><ul><li>- writi...
FLASH MEMORY V/S HDD <ul><li>Key factors:- </li></ul><ul><li>Pricing trends </li></ul><ul><li>Technology trends </li></ul>...
Cost is a Key Factor 06/03/11 GEC_Thrissur
06/03/11 GEC_Thrissur
Advantages of Flash over HDD  <ul><li>In portable applications </li></ul><ul><li>In limited capacity applications </li></u...
FLASH AS A HARD DRIVE REPLACEMENT <ul><li>Wear leveling </li></ul><ul><ul><li>Technique to rotate the write/erase cycles. ...
PROLONGING FLASH LIFE <ul><li>Reducing Writes </li></ul><ul><li>Move /tmp to tmpfs </li></ul><ul><li>Manage swap space </l...
1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li>...
Mounting Log Files Via NFS <ul><li>To mount  /var  as an NFS share </li></ul><ul><ul><li>Entry required in  /etc/fstab  to...
<ul><ul><li>Kernel 2.6.23 </li></ul></ul><ul><ul><ul><li>RHEL5 </li></ul></ul></ul><ul><ul><ul><ul><li>Increase Performanc...
1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li>...
Redirecting Log Output Using Syslog <ul><li>Log some or all messages to a remote log server </li></ul><ul><li>UDP is used ...
1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li>...
Redirecting Application Logs to Syslog <ul><li>Hosted applications write to log files </li></ul><ul><ul><li>Eg:- BIND & so...
2.PROLONGING FLASH LIFE BY MOVING /tmp TO tmpfs <ul><li>The /tmp directory is a large source of writes. </li></ul><ul><li>...
Advantages of tmpfs over Ramdisks <ul><li>tmpfs dynamically grows the file system up to a user-specified limit </li></ul><...
3. PROLONGING FLASH LIFE BY MANAGING SWAP SPACE <ul><li>Analyzing swap space </li></ul><ul><li>Running without swap space ...
Analyzing swap space <ul><li>To determine current memory and swap usage of a Linux system </li></ul>06/03/11 GEC_Thrissur ...
Running without swap space <ul><li>Determine which  device is the swap device </li></ul><ul><li>2. Turn off swapping tempo...
4.  PROLONGING FLASH LIFE BY  MIGRATING FREQUENTLY WRITTEN FILES OFF FLASH <ul><li>Migration of frequently written files c...
5.  PROLONGING FLASH LIFE BY  TUNING FILE SYSTEMS TO MINIMIZE WRITES <ul><li>Areas to be considered:- </li></ul><ul><li>Ma...
Standard Linux File System <ul><li>The Ext2 File System </li></ul><ul><ul><li>Highly configurable </li></ul></ul><ul><ul><...
Queries?  06/03/11 GEC_Thrissur
06/03/11 GEC_Thrissur
Upcoming SlideShare
Loading in...5
×

Flash memory as a hard drive replacement

1,005

Published on

from the collection of hisham pasha

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,005
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Flash memory as a hard drive replacement

  1. 2. FLASH MEMORY AS A HARD DRIVE REPLACEMENT Seminar by Hisham Pasha.N.K. Roll No:8 S5 MCA 06/03/11 GEC_Thrissur
  2. 3. OVERVIEW <ul><li>FLASH BASICS </li></ul><ul><li>FLASH DEGRADATION </li></ul><ul><li>FLASH MEMORY V/S HARD DISK DRIVES </li></ul><ul><li>FLASH AS A HARD DRIVE REPLACEMENT </li></ul><ul><li>PROLONGING FLASH LIFE </li></ul>06/03/11 GEC_Thrissur
  3. 4. HARD DISK STRUCTURE 06/03/11 GEC_Thrissur
  4. 5. HARD DISK STRUCTURE 06/03/11 GEC_Thrissur
  5. 6. STRUCTURE OF A USB FLASH DRIVE 06/03/11 GEC_Thrissur
  6. 7. Applications of flash memory <ul><li>DIGITAL CAMERAS </li></ul><ul><li>PERSONAL DIGITAL ASSISTANTS (PDAs) </li></ul><ul><li>GAME CONSOLES </li></ul><ul><li>USB DRIVES </li></ul><ul><li>GENERAL PURPOSE SERVERS </li></ul><ul><li>BLADE SYSTEMS </li></ul>06/03/11 GEC_Thrissur
  7. 8. FLASH MEMORY USED IN DEVICES 06/03/11 GEC_Thrissur
  8. 9. FLASH DEGRADATION <ul><li>Storage units perform two basic functions: </li></ul><ul><li>- reading </li></ul><ul><li>- writing </li></ul><ul><li>The lifetime of a flash device is measured in “ write/erase ” or “ program/clear ” cycles. </li></ul><ul><li>Write operations are performed on “ pages ”. </li></ul><ul><li>Erase operations are performed on “ blocks ”. </li></ul><ul><li>The lifespan of a flash device is long, but limited </li></ul>06/03/11 GEC_Thrissur
  9. 10. FLASH MEMORY V/S HDD <ul><li>Key factors:- </li></ul><ul><li>Pricing trends </li></ul><ul><li>Technology trends </li></ul><ul><li>Energy consumption </li></ul><ul><li>Robustness </li></ul><ul><li>File size </li></ul>06/03/11 GEC_Thrissur
  10. 11. Cost is a Key Factor 06/03/11 GEC_Thrissur
  11. 12. 06/03/11 GEC_Thrissur
  12. 13. Advantages of Flash over HDD <ul><li>In portable applications </li></ul><ul><li>In limited capacity applications </li></ul><ul><li>In applications where file size or the total no: of files to be stored is more important than total system cost </li></ul>06/03/11 GEC_Thrissur
  13. 14. FLASH AS A HARD DRIVE REPLACEMENT <ul><li>Wear leveling </li></ul><ul><ul><li>Technique to rotate the write/erase cycles. </li></ul></ul><ul><ul><li>Goal </li></ul></ul><ul><ul><ul><li>Get the entire device to wear at approximately the same rate. </li></ul></ul></ul><ul><ul><li>Generally implemented in h/w on a microcontroller on the same PCB as the flash memory </li></ul></ul><ul><ul><li>Wear leveling failing formula:- </li></ul></ul>C*L*O/W*60*60*24*365 06/03/11 GEC_Thrissur
  14. 15. PROLONGING FLASH LIFE <ul><li>Reducing Writes </li></ul><ul><li>Move /tmp to tmpfs </li></ul><ul><li>Manage swap space </li></ul><ul><li>Migrate frequently written files off flash </li></ul><ul><li>Tune file system to minimize maintenance-related writes </li></ul>06/03/11 GEC_Thrissur
  15. 16. 1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li></ul><ul><li>Redirecting Log Output Using Syslog </li></ul><ul><li>Redirecting Application Logs to Syslog </li></ul>06/03/11 GEC_Thrissur
  16. 17. Mounting Log Files Via NFS <ul><li>To mount /var as an NFS share </li></ul><ul><ul><li>Entry required in /etc/fstab to avoid traffic problem in NFS`network </li></ul></ul><server>:</path/to/dir> /var nfs sync 0 0 06/03/11 GEC_Thrissur
  17. 18. <ul><ul><li>Kernel 2.6.23 </li></ul></ul><ul><ul><ul><li>RHEL5 </li></ul></ul></ul><ul><ul><ul><ul><li>Increase Performance </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Large no: of writes </li></ul></ul></ul></ul><ul><ul><ul><ul><li>fsc </li></ul></ul></ul></ul><ul><ul><ul><ul><li>no fsc </li></ul></ul></ul></ul><ul><ul><ul><ul><li>To disable fsc; following /etc/fstab entry used </li></ul></ul></ul></ul><ul><ul><ul><ul><li>In log server side; following entry in /etc/exports to authorize the client to mount and write to the share </li></ul></ul></ul></ul><server>:</path/to/dir> /var nfs sync,nofsc 0 0 /path/to/logs/<client host name><client IP>(rw,no_root_squash,no_subtree_check) 06/03/11 GEC_Thrissur
  18. 19. 1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li></ul><ul><li>Redirecting Log Output Using Syslog </li></ul><ul><li>Redirecting Application Logs to Syslog </li></ul>06/03/11 GEC_Thrissur
  19. 20. Redirecting Log Output Using Syslog <ul><li>Log some or all messages to a remote log server </li></ul><ul><li>UDP is used to send log messages </li></ul><ul><li>Security Implications:- </li></ul><ul><ul><li>Eg:- Logging over an untrusted n/w </li></ul></ul><ul><ul><li>Replacing Syslog by Syslogng </li></ul></ul><ul><ul><ul><li>Logging using TCP </li></ul></ul></ul>06/03/11 GEC_Thrissur
  20. 21. 1. PROLONGING FLASH LIFE BY REDUCING WRITES <ul><li>Redirect Log Output </li></ul><ul><li>Mounting Log Files Via NFS </li></ul><ul><li>Redirecting Log Output Using Syslog </li></ul><ul><li>Redirecting Application Logs to Syslog </li></ul>06/03/11 GEC_Thrissur
  21. 22. Redirecting Application Logs to Syslog <ul><li>Hosted applications write to log files </li></ul><ul><ul><li>Eg:- BIND & some types of Apache error logging </li></ul></ul><ul><ul><li>To enable Apache access logs: </li></ul></ul>CustomLog “|/path/to/logging/script.pl”common 06/03/11 GEC_Thrissur
  22. 23. 2.PROLONGING FLASH LIFE BY MOVING /tmp TO tmpfs <ul><li>The /tmp directory is a large source of writes. </li></ul><ul><li>The common parameters are size, nr_inodes and mode. </li></ul><ul><li>/tmp can be mounted as a ramdisk. </li></ul><ul><li>Ramdisks:- </li></ul><ul><li>Areas of RAM reserved by OS </li></ul><ul><li>Mounted as disks </li></ul><ul><li>Provide very High Speed Storage </li></ul>06/03/11 GEC_Thrissur
  23. 24. Advantages of tmpfs over Ramdisks <ul><li>tmpfs dynamically grows the file system up to a user-specified limit </li></ul><ul><li>tmpfs is able to swap out seldom-used pages </li></ul><ul><li>tmpfs can be resized on the fly by simply remounting it </li></ul><ul><li>To mount 100MB tmpfs partition, run the command </li></ul>06/03/11 GEC_Thrissur %mount –t tmpfs –o size=100M,nr_inodes=1k,mode=777 tmpfs /tmp
  24. 25. 3. PROLONGING FLASH LIFE BY MANAGING SWAP SPACE <ul><li>Analyzing swap space </li></ul><ul><li>Running without swap space </li></ul><ul><li>Swapping to external storage </li></ul>06/03/11 GEC_Thrissur
  25. 26. Analyzing swap space <ul><li>To determine current memory and swap usage of a Linux system </li></ul>06/03/11 GEC_Thrissur %free -mt
  26. 27. Running without swap space <ul><li>Determine which device is the swap device </li></ul><ul><li>2. Turn off swapping temporarily </li></ul><ul><li>3. Configure system to run with out swap on a more permanent mode </li></ul>06/03/11 GEC_Thrissur % grep swap /etc/fstab /dev/sda2 swap swap 0 0 % swapoff /dev/sda2 # /dev/sda2 swap swap defaults 0 0
  27. 28. 4. PROLONGING FLASH LIFE BY MIGRATING FREQUENTLY WRITTEN FILES OFF FLASH <ul><li>Migration of frequently written files can be in any of the following ways:- </li></ul><ul><li>Move a file into a Ramdisk and sacrifices permanence </li></ul><ul><li>Move a file onto an NFS share and impact speed </li></ul><ul><li>Move a file into externally attached storage and add cost to the system </li></ul>06/03/11 GEC_Thrissur
  28. 29. 5. PROLONGING FLASH LIFE BY TUNING FILE SYSTEMS TO MINIMIZE WRITES <ul><li>Areas to be considered:- </li></ul><ul><li>Make sure reads don’t cause writes </li></ul><ul><li>Check that the file system is not using some form of secure deletion </li></ul><ul><li>Utilize on-the-fly file system compression </li></ul><ul><li>Evaluate if any partitions can be mounted read-only </li></ul>06/03/11 GEC_Thrissur
  29. 30. Standard Linux File System <ul><li>The Ext2 File System </li></ul><ul><ul><li>Highly configurable </li></ul></ul><ul><ul><li>Supports secure deletion </li></ul></ul><ul><ul><li>Access time logging </li></ul></ul><ul><ul><li>The Ext3 File System </li></ul></ul><ul><ul><ul><li>Journaling file system </li></ul></ul></ul><ul><ul><ul><li>Not recommended for flash drives </li></ul></ul></ul><ul><ul><ul><li>The JFFS file system </li></ul></ul></ul><ul><ul><ul><ul><li>Used on non-wear leveled flash devices </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Log file system </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Intelligent garbage collection and built-in compression </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Targeted at embedded device market </li></ul></ul></ul></ul>06/03/11 GEC_Thrissur
  30. 31. Queries? 06/03/11 GEC_Thrissur
  31. 32. 06/03/11 GEC_Thrissur
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×