Optimizing an X25-M SSD in XP

Silencing hard drives, optical drives and other storage devices

Moderators: NeilBlanchard, Ralf Hutter, sthayashi, Lawrence Lee

Post Reply
cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Optimizing an X25-M SSD in XP

Post by cmthomson » Thu Sep 24, 2009 6:12 pm

A while ago, I set about optimizing my X25-M. This is not for the faint of heart.

The first thing to do is get the main partition aligned on a 512-KB boundary, so that small file writes don't cause excessive block erases.

Lots of sites have documented how the lifetime of an SSD is determined almost entirely by how many times each block is erased so that new data can be written. All SSD's have very large block sizes (typically 256KB or 512KB), unlike HDDs that have tiny block sizes (sectors) of only 0.5KB. If the OS alignment and hardware alignment don't agree, roughly twice as many block erases occur as need to; not a good thing.

By default, Windows aligns the primary partition at "cylinder 0, head 1, sector 0" (the first 63-sector "track" is used for the volume label and boot information). This places the start of the partition at an offset of 31.5KB. Huh?

Back in ancient times (thirty or so years ago), all disks used in PCs were based on 512-byte sectors, arranged into 63-sector tracks. The cylinder size was determined by the number of heads (which morphed from physical to virtual as drives got bigger). Nowadays, because disks hold hundreds of times more data than back then, all HDDs use LBA (linear block address) instead of C/H/S (cylinder/head/sector) addressing. LBA just numbers the 512-byte sectors from 0 to (approximately) infinity.

So why does Windows (or for that matter Linux) use C/H/S when formatting disks? Backward compatibility. Anyone who's worked in the software industry (especially the OS and utility sub-industry) knows it will cost you your job if you make a change like dumping C/H/S even though no existing hardware uses it anymore.

OK, enough history. How do you format a partition on a 512-KB boundary? Well, not with Windows. Not with Acronis. Not with most versions of Linux. All of these will start your partition at a multiple of 31.5-KB (the historic track size). Some will always start at 0/1/0 no matter what you do.

After lots of fumbling about, I discovered a program on the Ultimate Boot CD, called Ranish (it's in the file system partition tools area) that will create a partition on an arbitrary C/H/S boundary. The correct values to use are 0/16/17, which equals 512 KB. One hitch though: Ranish doesn't have NTFS support, so you'll have to format the partition after it's created.

Now the real downer: you can't copy a working Windows file system to this new partition with Acronis (or any other backup tool I'm aware of) because the copy process will reset the partition offset. Grr. So be prepared to reinstall Windows and applications from scratch.


Well, that was step one. The rest is easier. :)


The rest of this post describes moving volatile files and directories off the system disk to extend its lifetime. This assumes your system has an SSD as its system disk (C) and an HDD as its bulk data disk (D). In a silent system like mine, a Samsung F2 500-GB is an excellent choice as the D disk.

Top of the list is the paging file. This one is controversial. Leaving it on the SSD makes for a lightning-fast system, with no seek noise. But this is the most-often written file in a Windows system, and will greatly shorten your SSD's lifetime. Moving it to D will sometimes result in some annoying delays, especially when switching users. Some people advocate not having a paging file at all, especially when you have 2GB+ of memory, but this is at the cost of stability, since XP is designed to have that file.

Anyway, moving the paging file is easy: just delete it from C and create it on D, then reboot. This is done in the Control Panel/System/Advanced/Performance/Advanced/Virtual Memory page.

Next are the browser temporary file directories.

For Explorer, open tools/internet options, then temporary internet files/settings/move folder, then specify a directory on D (create it ahead of time of course).

Firefox is a bit clumsier. First type "about:config" into the address bar, then say OK to "I'll be careful", then right-click, then select new string, then type in browser.cache.disk.parent_directory and the path to the directory on D you created ahead of time. Nothing to it.

The last one I bothered with was the Windows temporary file directories for each user on my system (in Documents and Settings/*/temp and tmp). Changing these is simple: go to control panel/system/advanced/environment variables, and replace TEMP and TMP with paths to the directories on D that you created ahead of time. No sweat.

There are other directories you can move, such as printer spool areas, but I didn't bother. For a comprehensive list, see this thread: http://www.ocztechnologyforum.com/forum ... hp?t=55238
Scroll down to the section headed Firefox Cache Tweak. (Just above that is a detailed description of how to put your paging file onto a virtual disk in RAM for systems with 8 GB of memory.)


Well there you have it. I promised myself I'd document this demented exercise, and now I've done it. Hope someone finds it useful.


BTW, my X25-M/F2 combination is completely inaudible and super fast. I never hear disk noise; never. Now if only someone could make a quiet DVD drive...

CTT
Posts: 35
Joined: Thu Jul 30, 2009 12:14 pm
Location: Romania

Re: Optimizing an X25-M SSD in XP

Post by CTT » Fri Sep 25, 2009 12:38 pm

cmthomson wrote:How do you format a partition on a 512-KB boundary? Well, not with Windows.
Actually you can also do it with Windows. Well, sort of. You can use diskpart (command line) utility from a Windows Vista Recovery Disk.

cmthomson wrote:Now the real downer: you can't copy a working Windows file system to this new partition with Acronis (or any other backup tool I'm aware of) because the copy process will reset the partition offset.
Ghost 11.5 (Symantec Ghost Solution Suite 2.5) can restore a partition without altering the offset. I would venture to guess there are also other tools that can.

cmthomson wrote:Firefox is a bit clumsier. First type "about:config" into the address bar, then say OK to "I'll be careful", then right-click, then select new string, then type in browser.cache.disk.parent_directory and the path to the directory on D you created ahead of time. Nothing to it.
An alternative (which presumably also yields better performance) would be to move the cache to memory as described here:
http://mydellmini.com/forum/windows-7/2 ... weaks.html
Firefox - Use memory cache instead of disk cache
Description: If you use Firefox, there's a way to write cached files to RAM instead of the hard disk. This is not only faster, but will significantly reduce writes to the SSD while using the browser.
Instructions: Open Firefox -> Type about:config into the address bar -> Enter -> double-click browser.cache.disk.enable to set the value to False -> Right-Click anywhere -> New -> Integer -> Preference Name "disk.cache.memory.capacity" -> value memory size in KB. Enter 32768 for 32MB, 65536 for 64MB, 131072 for 128MB, etc. -> restart Firefox


Optimization is good, but moving system files to a hard-drive kind of negates the benefits of using a SSD (both performance and noise-wise).

skiddy
Posts: 23
Joined: Fri Jul 20, 2007 5:26 pm

Re: Optimizing an X25-M SSD in XP

Post by skiddy » Fri Sep 25, 2009 4:20 pm

CTT wrote:Actually you can also do it with Windows. Well, sort of. You can use diskpart (command line) utility from a Windows Vista Recovery Disk.
I'd recommend using diskPAR, not diskparT. No one actually knows what alignment is best for the Intel, and MS recommends 1024 sectors over 512 for 'more' compatibility...

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Re: Optimizing an X25-M SSD in XP

Post by cmthomson » Fri Sep 25, 2009 5:40 pm

CTT wrote:
cmthomson wrote:How do you format a partition on a 512-KB boundary? Well, not with Windows.
Actually you can also do it with Windows. Well, sort of. You can use diskpart (command line) utility from a Windows Vista Recovery Disk.
Windows XP comes with diskpar, not diskpart.
CTT wrote:
cmthomson wrote:Now the real downer: you can't copy a working Windows file system to this new partition with Acronis (or any other backup tool I'm aware of) because the copy process will reset the partition offset.
Ghost 11.5 (Symantec Ghost Solution Suite 2.5) can restore a partition without altering the offset. I would venture to guess there are also other tools that can.
Um, okay, I didn't know about that. But I do see that Suite 2.5 costs at least $199...
CTT wrote:
cmthomson wrote:Firefox is a bit clumsier. First type "about:config" into the address bar, then say OK to "I'll be careful", then right-click, then select new string, then type in browser.cache.disk.parent_directory and the path to the directory on D you created ahead of time. Nothing to it.
An alternative (which presumably also yields better performance) would be to move the cache to memory as described here:
http://mydellmini.com/forum/windows-7/2 ... weaks.html
Firefox - Use memory cache instead of disk cache
Description: If you use Firefox, there's a way to write cached files to RAM instead of the hard disk. This is not only faster, but will significantly reduce writes to the SSD while using the browser.
Instructions: Open Firefox -> Type about:config into the address bar -> Enter -> double-click browser.cache.disk.enable to set the value to False -> Right-Click anywhere -> New -> Integer -> Preference Name "disk.cache.memory.capacity" -> value memory size in KB. Enter 32768 for 32MB, 65536 for 64MB, 131072 for 128MB, etc. -> restart Firefox


Optimization is good, but moving system files to a hard-drive kind of negates the benefits of using a SSD (both performance and noise-wise).
Hmm, didn't know that either; will give it a try. (My soft-mounted F2 is inaudible, so noise isn't an issue here.)

CTT
Posts: 35
Joined: Thu Jul 30, 2009 12:14 pm
Location: Romania

Re: Optimizing an X25-M SSD in XP

Post by CTT » Sun Sep 27, 2009 2:33 am

skiddy wrote:I'd recommend using diskPAR, not diskparT. No one actually knows what alignment is best for the Intel, and MS recommends 1024 sectors over 512 for 'more' compatibility...
Why would you choose diskpar over diskpart?
The main downside of diskpar for me is that it can only create one partition.
I think MS recommends a 2048-sector alignment (1 MB) and Windows Vista also aligns at 1 MB by default during installation (if you have an unpartitioned drive) so I would also go for this value "just in case" - a 1 MB aligned partition is also 512 KB aligned, but not the other way around; seems that the erase block size for most flash chips is 512KB.
http://support.microsoft.com/kb/929491
cmthomson wrote:Windows XP comes with diskpar, not diskpart.
Actually Windows XP (at least SP3) comes with diskpart. Unfortunately it seems that the XP version still tries to align partitions on cylinder boundary so it's of no use.

Edit: Fixed last quote; sorry for the mix up skiddy.
Last edited by CTT on Sun Sep 27, 2009 12:29 pm, edited 1 time in total.

skiddy
Posts: 23
Joined: Fri Jul 20, 2007 5:26 pm

Re: Optimizing an X25-M SSD in XP

Post by skiddy » Sun Sep 27, 2009 11:14 am

CTT wrote:
skiddy wrote:Windows XP comes with diskpar, not diskpart.
Actually Windows XP (at least SP3) comes with diskpart. Unfortunately it seems that the XP version still tries to align partitions on cylinder boundary so it's of no use.
Please get your quotes right, that wasn't me said that... :)

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Sun Sep 27, 2009 6:33 pm

Indeed, XP comes with diskpart, not diskpar.

Diskpart accepts an offset parameter, but it silently rounds it to a 63-sector boundary (n*31.5KB), so it is useless for aligning a partition.

I tried the Firefox memory-based cache mentioned above, and it works just fine. Thanks.

I've also tried the RamDiskPlus memory-based file system for the page file, but since my motherboard doesn't support PAE, it's a dubious proposition; I'll probably back this out before the trial license expires.


As for 512KB vs 1024KB, if I were doing it all over again, I'd go with 1024KB. It's more likely to be compatible with more SSDs, and the lost space is insignificant.

davepermen
Posts: 19
Joined: Mon Oct 05, 2009 12:54 am
Location: Switzerland

Post by davepermen » Mon Oct 05, 2009 1:18 am

none of the tweaks should've been needed. except for the partition alignment, which is "being nice to the ssd". but the intel delivers so much performance in all cases, none of the other tweakings are needed.

you can even install vista without any tweaking on it, and it performs just as fast as your xp.

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Mon Oct 05, 2009 5:56 pm

davepermen wrote:none of the tweaks should've been needed. except for the partition alignment, which is "being nice to the ssd". but the intel delivers so much performance in all cases, none of the other tweakings are needed.
Actually, none of them are needed for performance; all are intended to extend the lifetime of the SSD. The only thing that slows the performance of an X25-M (G1) is a zillion 4K writes, which you don't have much control over (except possibly by moving the temporary directories, maybe).

swivelguy2
Posts: 404
Joined: Sun Jul 04, 2004 9:18 pm
Location: Illinois, USA

Post by swivelguy2 » Mon Oct 05, 2009 8:49 pm

The entire point of a page file and an internet cache is to have things closely at hand to access quickly, even though they may not fit in RAM. Having to hit the (regular) disk occasionally for these items somewhat defeats the purpose of having an SSD.

The lifetime issue is really nothing to worry about. By the time your SSD fails, you'll have wanted a newer, faster, bigger one for several years anyway. Even as the only drive in a system, Intel expects X25-Ms to last 10 years. I don't even expect mechanical drives to last more than 5.

davepermen
Posts: 19
Joined: Mon Oct 05, 2009 12:54 am
Location: Switzerland

Post by davepermen » Tue Oct 06, 2009 1:06 am

cmthomson wrote:
davepermen wrote:none of the tweaks should've been needed. except for the partition alignment, which is "being nice to the ssd". but the intel delivers so much performance in all cases, none of the other tweakings are needed.
Actually, none of them are needed for performance; all are intended to extend the lifetime of the SSD. The only thing that slows the performance of an X25-M (G1) is a zillion 4K writes, which you don't have much control over (except possibly by moving the temporary directories, maybe).
as the disk is rated to suprass the livetime of your system easily on ordinary usage, this is a pre-emptive optimisation strategy with no gain. mainly built up by the fud that gets spread about the flash dying with too much writes. while true, it's out of anyones problems range.


leaving the internet caches and such enabled gains you quite some performance after the first boot, when you browse your pages first time of the day, as they don't have to reload all their data from the internet, which is much slower than from disk.

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Tue Oct 06, 2009 11:22 am

Well I said some of this stuff was controversial...

The X25-M is rated by Intel to have a 5-year lifetime based on a bunch of assumptions, the main one being an average write rate of 20 GB per day (see the Intel data sheet). On a busy system, the page file alone could exceed that. It also assumes a very low write amplification rate, which to my knowledge nobody outside Intel has been able to verify.

The above post is the first time I've seen a 10-year lifetime claim. Intel's warranty is for 3 years.

The best place to put the paging file is in a RAM disk if your system can support that.

Since I only relaunch my browser once per reboot (about once a week when forced by some system upgrade), I don't care where the caches live. YMMV.


As for the disk outlasting the rest of the system, I would certainly hope so, both for the obvious reliability reason, but also because when I change motherboards, I want to just plug in my old disks. Sheesh. :?

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Sat Oct 31, 2009 4:07 pm

I downloaded the new Intel SSD toolbox, and it has some interesting SMART reporting. (my G1 SSD isn't supported by the new TRIM tool, but the SMART stuff does work)

According to the tool, even after all the effort above to move high-traffic files off my SSD, I still write an average of 17.5 GB a day to my SSD C: drive. This is just barely under the rated 20GB/day that Intel used to rate the drive at 5 years lifetime.

On the other hand, the "media wearout indicator" on my drive is 93 after almost exactly a year, so that would suggest a 10yr lifetime.

Anyway, it's worthwhile to get this tool, just to see what your drive has been up to...

HammerSandwich
*Lifetime Patron*
Posts: 1288
Joined: Sat Oct 25, 2003 3:21 pm
Location: 15143, USA
Contact:

Post by HammerSandwich » Sun Nov 01, 2009 6:18 pm

cmthomson wrote:...the "media wearout indicator" on my drive is 93 after almost exactly a year, so that would suggest a 10yr lifetime.
Does that mean 93% life remaining? If not, what?

lm
Friend of SPCR
Posts: 1251
Joined: Wed Dec 17, 2003 6:14 am
Location: Finland

Re: Optimizing an X25-M SSD in XP

Post by lm » Mon Nov 02, 2009 6:28 am

cmthomson wrote:OK, enough history. How do you format a partition on a 512-KB boundary? Well, not with Windows. Not with Acronis. Not with most versions of Linux. All of these will start your partition at a multiple of 31.5-KB (the historic track size). Some will always start at 0/1/0 no matter what you do.
Linux is a kernel. If there is a program that runs on linux and that can do what you want, you should be able to install it, regardless of which Linux distribution you use. So I don't understand what you mean by "most versions of Linux". For example GNU parted lets you specify the starting position of a partition in pretty much any units you like, (see here for the choices).
cmthomson wrote: Now the real downer: you can't copy a working Windows file system to this new partition with Acronis (or any other backup tool I'm aware of) because the copy process will reset the partition offset. Grr. So be prepared to reinstall Windows and applications from scratch.
The standard linux command line tool "dd" can do this. It is just a simple raw copy with no extra logic whatsoever. You give it a source and a destination, and it just does raw copying until it hits the end of the partition.[/url]

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Tue Nov 03, 2009 2:22 pm

HammerSandwich wrote:
cmthomson wrote:...the "media wearout indicator" on my drive is 93 after almost exactly a year, so that would suggest a 10yr lifetime.
Does that mean 93% life remaining? If not, what?
That's what everybody assumes. It's a value that counts down from 100 to 0, and all the values I've seen in the forums are in the 90's. The tool doesn't seem to have any documentation, but this seems like a reasonable guess.

Here's a link to one forum: http://communities.intel.com/message/68106

cmthomson
Posts: 1266
Joined: Sun Oct 09, 2005 8:35 am
Location: Pleasanton, CA

Post by cmthomson » Tue Nov 03, 2009 2:25 pm

I recently upgraded to the newest Acronis (2010), which does allow you to specify an offset on the destination disk when cloning. It's under the properties tab as space before partition.

ace_uk
Posts: 18
Joined: Sun Aug 09, 2009 10:37 am
Location: United Kingdom

Post by ace_uk » Tue Nov 03, 2009 3:23 pm

cmthomson wrote:The best place to put the paging file is in a RAM disk if your system can support that.
Not really. The best place to put your page file is on the SSD. Why on earth would you want to significantly reduce the amount of RAM available to your operating system? That's where Windows caches data.
cmthomson wrote:The X25-M is rated by Intel to have a 5-year lifetime based on a bunch of assumptions, the main one being an average write rate of 20 GB per day (see the Intel data sheet). On a busy system, the page file alone could exceed that.
If you re-read the Intel datasheet, you will see that Intel rate the X25-M 'G2' as having a minimum lifespan of 5 years. Also, according to AnandTech the Intel SSDs are capable of having upto 100GB written to them every day for five years. Under normal use you will never be writing 100GB per day to the SSD, thus their SSDs will last a lot longer than five years. I just had a look at my SSD using Intel's own SSD Toolbox application and I have written 2.32TB to my SSD to date - 102 days old so far - and that's with quite heavy use (lots of VMs plus the page file). I really think you are worrying about nothing.
SSD lifespans are usually quantified in the number of erase/program cycles a block can go through before it is unusable, as I mentioned earlier it's generally 10,000 cycles for MLC flash and 100,000 cycles for SLC. Neither of these numbers are particularly user friendly since only the SSD itself is aware of how many blocks it has programmed. Intel wanted to represent its SSD lifespan as a function of the amount of data written per day, so Intel met with a number of OEMs and collectively they came up with a target figure: 20GB per day. OEMs wanted assurances that a user could write 20GB of data per day to these drives and still have them last, guaranteed, for five years. Intel had no problems with that.

Intel went one step further and delivered 5x what the OEMs requested. Thus Intel will guarantee that you can write 100GB of data to one of its MLC SSDs every day, for the next five years, and your data will remain intact. The drives only ship with a 3 year warranty but I suspect that there'd be some recourse if you could prove that Intel's 100GB/day promise was false.
Given the 100GB per day x 5 year lifespan of Intel's MLC SSDs, there's no cause for concern from a data reliability perspective for the desktop/notebook usage case.

Post Reply