鄂州市华容区军人政策:如何保护固体硬盘

来源:百度文库 编辑:偶看新闻 时间:2024/04/29 14:28:54

How to prevent programs from killing my SSD in two weeks?

I just got my first SSD. And I have SSDLife monitoring in the background. After I have installed all software, and did some basic testings. SSDLife said “Total Data written, GB” = 52.1 (40GB used space, 70GB free space).

So, he only installed about 40 GB of data but there is already 52.1 GB written?

He found why this happens in a post which explains:

The problem with an SSD is, data is written in blocks. A block may be 256KB: 256 * 1000 * 8 binary digits. To change even ONE of these digits, you must rewrite the ENTIRE block. That is to say, your OS sees 1 bit being written, but the SSD wear is equivalent to 256KB being written: a 2.048 MILLION fold difference.

Which means that the formula

(SIZE OF SSD) * (Endurance Cycles) = Total data written to SSD before failure

is only for the best case scenario which would allow you to write 1,000 to 1,000,000 times the data of the drive before failure. But, looking at the average to even worst case, those are way more likely to occur with all those small writes going on on the SSD. This is confirmed in

What is the lifespan of an SSD drive?

However, the gist is that SSDs are more reliable than hard disks, and should last a good 20 years at least not counting performance degradation. — Answer by caliban

And that is what we could call an average case. You can do the numbers for the worst case if you want to, I can assure you that it doesn’t look good!

Let’s maximize the lifetime of our precious SSD by wear leveling and minimizing all those small writes to it, using simple and advanced techniques…

Make sure that TRIM is enabled

First, there is no sense in checking and trying to enable TRIM when your hard disk does not support it, this has been answered on Super User:

How do I know if my SSD supports TRIM?

The easiest way to know if your SSD supports TRIM is to use CrystalDiskInfo.

And exactly, this allows you to see if your SSD is supporting TRIM:

Now, the next step is to check if your OS is aware of the TRIM feature. For Windows 7, you can do this with fsutil behavior query disabledeletenotify. If this results in a zero, it means that the OS is using TRIM and thus is treated as an SSD.

In the case it’s not treating it as an SSD, you should do some troubleshooting by looking at the information in the Device Manager and the properties of the SSD. Perhaps you need to update the drivers of your disk controller in order for the OS to become aware of your SSD…

Disable or move unnecessary OS features

Our operating system has some features that write to the disk when the memory can’t hold it for some reason, alongside tricks that speed up your computer in case you have a HDD but are no longer necessary on an SSD.

Let’s look into the most important features that can cause issues and see if we could disable them. Be sure to read this three-part article too, it contains even more in-depth information on various space consumers.

Paging

The page file is meant to keep space free in the memory by swapping out memory data to the disk, this to ensure that the memory doesn’t get full when you run too much programs.

However, you might have a computer that only uses 2 – 3 GB of memory while you have 8 GB of memory. In such case, when you are sure your memory will almost never fill to 8 GB you can really spare out a lot of SSD writes by disabling the page file without any drawback.

When you do run out of memory (eg. if you run virtual machines), you don’t want your computer to thrash your SSD because of that…

So, there are two solutions:

Disabling the page file

  1. Right click ‘My Computer’ and click ‘Properties’.
  2. Go to the ‘Advanced System Settings’ tab.
  3. Click Settings in the ‘Performance’ fieldset, then go to the Advanced tab.
  4. Click Change in the ‘Virtual memory’ fieldset.
  5. Click on your SSD drive, select ‘No paging file’ and click ‘Set’.
  6. Click OK when you’re done.

Moving the page file

  1. First disable the page file as described above.
  2. Then, click on your preferred HDD drive, select ‘System managed size’ (unless you know what you’re doing) and click ‘Set’.
  3. Click OK when you’re done.

Make sure that you monitor your memory every now and then, you might be able to get around with creating a smaller page file on your HDD of only 1 – 2 GB.

There are a lot of Super User questions on disabling the page file, feel free to do more research to see what could be the best for you or just try it out.

Hibernation

Another feature that can be a pain is when you are hibernating the computer. If you really don’t need this feature consider to use sleep or shutdown instead, because it is writing your memory to the hibernation file every time you hibernate. If you reconsider to not use hibernation anymore then you can disable it by running the command

powercfg /hibernate off

as an administrator. This will disable the hibernation option and remove the hibernation file. It’s not possible to move the hibernation file.

SuperFetch and Defrag

(cfr. Steven noted in our comments that this is already done by Windows 7 if your SSD is detected and TRIM is on)

The manufacturers suggest that you turn both of them off, as your SSD doesn’t need defragmentation at all and it is fast enough which makes SuperFetch useless. Both of those do excessive small writes, which are unnecessary thus it’s better to just disable both:

  1. Disable the SuperFetch service.
  2. Make sure that the defragger isn’t scheduled, disable or remove defragment software. However, you don’t want to disable this for your HDD…

Search Indexing

Most people find the search indexer necessary, because it speeds searching up a lot for data that’s on your HDD.

If you only have an SSD, you might want to consider to disable the Search Indexer. If you have both, you should move the Search Indexer cache to your HDD. This will spare out a lot of writes so that whenever a file is being saved in one of your indexed locations the search cache is no longer updated.

Another option is to trim down your indexed locations so that things that you would never search or already know where they are never get indexed.

Temporary Files, Cache and Logs

There are a lot of temporary files, caches and logs on your computer. These also result in a lot of excessive writes! However, these depend on which browser and what software you use.

For example Google Earth keeps a cache of the images of the places you visited, so whenever you use Google Earth you are essentially writing images to your SSD. Let’s see in our next two sections how we can find those and use junction points when we can’t move or disable them.

Finding more writes with handy tools

(cfr. If you are using Linux or Mac OS X, there are some alternatives you could use.)

Resource Monitor

Let’s look at the built-in Resource Monitor in the newer versions of Windows:

  1. Type ‘Resource Monitor’ in the start menu and run it.
  2. Go to the ‘Disk’ tab.
  3. Sort the ‘Disk Activity’ by ‘Write’.

This will allow you to see an accumulation of the writes that are happening on your system, if you want more detail you’ll need Process Monitor.

Process Monitor

Let’s download Process Monitor from Microsoft Sysinternals and set up a filter on the writes:

  1. Download Process Monitor and run it.
  2. Click ‘Reset’.
  3. Make sure the new filter reads ‘Operation contains WRITE then Include’ then click ‘Add’.
  4. Optional: Filter by your SSD drive.Make sure the new filter reads ‘Path starts with C:\ then Include’ then click ‘Add’.
  5. Then click ‘Apply’ and then click ‘OK’.

Now you will see the writes occurring in real time, you can click an individual element if you need in-depth information. Under the menu ‘Tools’ there is a ‘File Summary’ which allows you to look at the whole set of writes in different tabs.

Warning: If you plan to let Process Monitor run in the background, then enable ‘Drop Filtered Events’ under the ‘Filters’ menu and perhaps decrease the ‘History Depth’ under the ‘Options’ menu. If you haven’t disabled your page file, Process Monitor will be writing to it. You can change this behavior in ‘Backing Files’ under the ‘File’ menu.

Can’t move folders away from the SSD?

Use junction points!

Junction points tell the system that when it’s accessing path X that it should access path Y instead. For example, this comes in really handy to tell it that if it wants to access C:\Windows\Temp That it should access E:\Storage\Cache\Temp instead.

For people that like the command line, there exists Junction for Windows and mklink for both Windows and Linux. The documentation clearly explains what parameters to use to create, list and remove junciton points.

However, what if you rather like to create Junction points from Windows Explorer? This is also possible! This Super User answer comes up with two tools that can do exactly that. If you like to script/program, check the question for an idea on what could be a better implementation if you have a lot of things you want to speed up but don’t have a big SSD.

Then, what should I put on my SSD?

You should place things that really require to load faster on your SSD, this is mostly your programs and games. Placing a video from your SSD will not give a noticeable speed-up in comparison with your HDD, nor do other personal documents result in this in general.

A lot of images will be loaded in quicker by a program like Adobe Lightroom, and a lot of music will be analyzed quicker by a DJ program like Traktor Studio; but the current SSD sizes aren’t meant for that purpose so for the moment that’s a bummer.

But pictures and music are a good example of things that you store only once if you aren’t planning to edit them, perhaps it will be fine to place those on your SSD in the future…

Feel free to read the comments below for more information and leave a message if you have additional hints, tips or tricks. Thank you for reading!

Posted by Tom Wijsman on May 10th, 2011
Filed under Solid State Drives
Where did all my hard drive space go? Part 3 Meet Ivo… ? Super User Mod ?
  1. Caue Rego says:

    What all this tells me is: avoid the SSD for now!

    I just wonder how complicated this would be on a mac.

  2. Tom Wijsman says:

    Using a SSD for some months now, it’s really worth it and you shouldn’t be avoiding it for that reason. However, it’s a wise decision to wait. I don’t think it’s overly complicated on Mac OS X, see this SU question: XPerf alternative for Linux & Mac OS X

  3. Andrew says:

    For most users, if you aren’t using your SSD for swap space, you’re losing out on a large amount of the benefit of the SSD.

    The failures you see reported for SSDs are rarely because of write cycles being exceeded.

  4. Tom Wijsman says:

    You get no improvement for using your SSD as swap space when you have sufficient memory. While not much SSDs have failed for that reason for now, they most likely will soon fail for that reason too…

  5. Kvad says:

    Get 3 years warranty on a SSD and then just run it into the ground

  6. The Morning Brew - Chris Alcock ? The Morning Brew #854 says:

    [...] Maximizing the lifetime of your SSD – Tom Wijsman shares some excellent advice to help (if you are lucky enough) owners of SSD disks to ensure that they get the best lifetime out of the drive, highlighting a variety of configuration settings and features to enable and disable to keep unnecessary and damaging writes to a minimum. [...]

  7. Steven Robbins says:

    As far as I was aware, Win7 automatically disables defrag and SuperFetch when running on an SSD – if Win7 detected your drive as an SSD and enabled TRIM then it shouldn’t be using those services anyway:

    http://www.tomshardware.com/news/windows-solid-state-drives-ssd,7717.html

  8. Tom Wijsman says:

    True, but but other operating systems might not and then there are those odd situations where detection doesn’t happen properly. Thanks for linking that article so people have more detail on how Windows 7 does this automatically for you…

  9. Eric Malamisura says:

    Windows 7 will automatically disable SuperFetch, and Defrag on that drive when TRIM is detected. You should not recommend disabling defrag in its entirely, especially if you have a mix of SSD and HD, since the HD will most definitely need to be defragged on a normal schedule.

    The most important piece of information you are missing is to update the SSD Firmware, this will often substantially increase the lifetime of the drive.

    We can only hope Windows 8 will allow us to move the registry, and search indexing databases, etc. off to another disk so that we don’t toast our SSD drives.

    Per wikipedia:Windows XP, and Windows Vista do not support Trim. OSX 10.6.6 and Lion support TRIM. Linux 2.6.33 has support for it as well.

    Although based on the articles I have read, TRIM support will only slightly extend the lifetime of your SSD in any case.

    You should also run some serious backup software if you are using an SSD, it WILL FAIL and you will need a 100% fool proof backup mechanism. I suggest a Drobo combined with Acronis.

  10. John L. Galt says:

    @Eric: Or, you could alternatively move all of your storage / settings / etc files an folders off the SSD – then, if it fails, it’s merely the time need to reinstall the OS onto the new drive.

    I use my SSD for my OS and programs. All of my Win7 special folders have been moved to a separate physical drive, and I install most of my games there as well. Since I have a pair of (identical) mechanical drives, I have split the swap file between the two, I have all of my downloads, file transfers, backups, etc on those two drives, leaving the SSD for OS and standard program files (Office, browser, etc. – and yes, even browser profiles are on one of the two mech drives).

    At the price of SSDs drop, they’re becoming more and more attractive for the sheer performance – but right along side that is the noticeable price drop in storage drives as well. If you have a desktop I highly recommend a multiple drive schema for your setup for this (among other reasons).

    @Tom – a good conglomeration of tips and tricks for SSD use – wish it had been around about 2 years ago when I got my SSD

  11. How To Maximise The Life Of Your SSD | Lifehacker Australia says:

    [...] Maximizing the lifetime of your SSD [Super User] [...]

  12. Tom Wijsman says:

    Eric: That’s indeed important, I’ll update the post to mention that alongside Steven’s suggestion. Please note that the Search Indexing database can be moved, check the Search Indexing options as you can change the location there. And if you don’t want to rebuild I would bet a junction point would do the job fine…

  13. zvz says:

    What happens when SSD run out of life cycles? Everything crashes or like old hdd bad block appears?

  14. Tom Wijsman says:

    zvz: The cells become unreliable. The wrong bits are getting stored, the data can become permanent or the cell can’t reliable remember the data anymore. I don’t know the exact thing that would happen but it all comes down that your data isn’t safe anymore, but it doesn’t necessarily crash. So yes, bad blocks would appear…

  15. lukatar says:

    you can extend your ssd’s lifetime by hanging it on the wall in your room and watching it every morning you wake up. Furthermore, everybody can see easier that you have an ssd. On your computer just use your old hdd

  16. Super User’s 2nd Birthday Super Contest - Super User Blog says:

    [...] Maximizing the lifetime of your SSD [...]

  17. Phil Robins says:

    Solid State Disks improve the performance of your PC so much that it’s easy to tweak these settings as the instructions on blogs like these are clear and easy to follow – this gives your SSD it’s maximum chance of longevity. IMHO I don’t believe any SSD has failed yet through wearing out – any failures will have been through some other reason. Quite often it’s probably due to an incompatibility problem.

  18. Chris S says:

    Anyone saying that SSDs don’t fail obviously hasn’t been around very many of them. The majority of them are fine for years. There are plenty though that die rather quickly. We run them in most of our work laptops; we’re averaging one dead every quarter.

    They die spectacularly, not read/write errors, but they simply no longer work (completely bricked). You should be running a backup solution anyway, but certainly more so if you are relying on a SSD.

  19. Matt says:

    I have a new Solid State drive that I installed Windows 7 on, Works great…only it claims to be storing twice the data that it actually contains. So I have a 60 gig drive with 42 gigs taken up by windows 7. Anyone had a similar problem with a SSD?