We're quite interested in exploring the possibility of using SSD drives in a server environment. However, one thing that we need to establish is expected drive longevity. According to this article manufacturer's are reporting drive endurance in terms of 'total bytes written' (TBW). E.g. from that article a Crucial C400 SSD is rated at 72TB TBW. Do any scripts/tools exist under the Linux ecosystem to help us measure TBW? (and then make a more educated decision on the feasibility of using SSD drives)

link|improve this question
feedback

3 Answers

up vote 2 down vote accepted

Another possibility is to look at /proc/diskstats. It's not persistent across reboots, but it has data for every block device. Probably most interesting to you is field 10, which contains the total number of sectors written. On a system with scsi disks with a sector size of 512 bytes, you could run

awk '/sd/ {print $3"\t"$10 / 2 / 1024}' /proc/diskstats

to see how many megabytes were written to each device. The output will look like

sda 728.759
sda1 79.0908
sda2 649.668

link|improve this answer
feedback

You can try iostat. It gives you statistics related to IO and CPU usage. Have a look at the manual man iostat.

link|improve this answer
I suppose that could work but I was hoping there was something higher-level available that could provide cumulative byte totals :) – badnews Feb 21 '11 at 8:05
feedback

You can see how much data has been written to an ext4 filesystem by looking in /sys/fs/ext4/$DEVICE/lifetime_write_kbytes.

link|improve this answer
That's a cool feature I didn't know about! A shame most of our systems are running ext3 and also some raw LVM partitions for VMs :) – badnews Feb 21 '11 at 8:06
ext3 (and to a slightly lesser extent) ext4 are not designed for writing to flash. The failure will occur depending on the number of times a location is written - and with conventional filesystems, hotspots develop very rapidly. The figures cited by manufacturers are very misleading since they assume an even spread of writes. There are filesystems - such as JFFS2 - specifically designed to extend the life of your SSDs. – symcbean Feb 21 '11 at 12:47
@symcbean - with present-day flash devices, this is largely a non-issue. They all have wear-leveling routines built into their on board controllers. – ErikA Feb 21 '11 at 14:50
@ErikA - I assumed the same. The flash controller should perform wear-levelling which would make the "total bytes written" metric a useful guideline :) (or so I hope!) – badnews Feb 21 '11 at 22:32
@symcbean - There are two kinds of flash devices. Memory Technology Devices (or MTDs) present a direct interface to the flash memory. These are typically found in embedded devices and are what filesystem like JFFS2 are designed for. The other kind of flash device hides the flash memory behind a Flash Translation Later (FTL) so that it looks like a regular block device. This is how consumer technology like SSDs, usb sticks, and memory cards are implemented. Filesystems like JFFS2 aren't appropriate for these; instead, you have to use filesystems like ext4 that are designed for block devices. – sciurus Feb 23 '11 at 4:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.