INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: New HTPC Build with SSD - Symbolic Links  (Read 8100 times)

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
New HTPC Build with SSD - Symbolic Links
« on: July 06, 2012, 06:06:59 am »

I've got most of the parts now for my new htpc, just waiting on the case  :)

I've got a crucial m4 128gb ssd. I want to maximise the lifespan of the ssd and disk space. I'm going to flash it with the lastest firmware and enable trim in Windows 7.

I have been pondering using symbolic links for certain folders of applications and os folders that generally fill up with files over time. Like windows log folders for example - so that unnessesary files don't constantly get written to the ssd and just go on the ssd.

I am trying to compile a list of safe windows folders to do this with that won't affect performance.

And also wondering if there are and folders within MC that could work well with symbolic links.

I haven't decided which software I will load onto my new machine yet so I'll have to figure out which folders to use sym links at a later date but I will probably put photoshop on that list..

Anybody got any ideas which folders would be best for this?

Thanks
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: New HTPC Build with SSD - Symbolic Links
« Reply #1 on: July 06, 2012, 06:42:50 am »

I've got most of the parts now for my new htpc, just waiting on the case  :)

I've got a crucial m4 128gb ssd. I want to maximise the lifespan of the ssd and disk space. I'm going to flash it with the lastest firmware and enable trim in Windows 7.

If you enable AHCI in the BIOS/EUFI, Windows 7 will load a default ahci driver that supports NCQ and TRIM. If you load the controllers' native driver (I assume Intel RST), both are supported as well. There is no need to take any manual action for this support. Besides, TRIM is overrated anyways ;).

I have been pondering using symbolic links for certain folders of applications and os folders that generally fill up with files over time. Like windows log folders for example - so that unnessesary files don't constantly get written to the ssd and just go on the ssd.

I am trying to compile a list of safe windows folders to do this with that won't affect performance.

This is not advised. You can redirect the default user and global temp folders with the system variables (create the folders first).

You can right click most of your users profile folders and move them to a new location. Windows will automatically create and move all the files for you and make the required changes in the registry. That doesn't move the appdata folder, if you need to move that, I suggest you move the entire Users folder to another drive and create a new user account. Delete the one created during install.

https://www.sevenforums.com/tutorials/18629-user-folders-change-default-location.html

With a 128GB drive and no other programs installed on the C: drive, you should have plenty of space to last. I had a 80GB drive for 2 years and it rarely filled up to the rim but it does require some housekeeping. with 40GB more, you should not have problems.

And also wondering if there are and folders within MC that could work well with symbolic links.

You can set most folders under Tools/Options/File Locations.

I haven't decided which software I will load onto my new machine yet so I'll have to figure out which folders to use sym links at a later date but I will probably put photoshop on that list..

Anybody got any ideas which folders would be best for this?

Thanks

Generally, I'd advise against redirecting folders and/or using symbolic links for OS or User profile folders. Many applications don't like it either so the changes you run into trouble are likely.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #2 on: July 06, 2012, 03:39:16 pm »

Besides, TRIM is overrated anyways ;)

Disagreed here, though I agree with everything else you said in that post.

TRIM is basically essential with any modern-generation SSD.  There are lots of detailed benchmarks I can show you where a single 120GB drive with TRIM beats (handily) a 2x64GB RAID array (without TRIM, obviously).  Performance without TRIM does degrade over time, and if the drive is fully "dirty" will end up around 1/2 of the performance of a clean drive.  In particular with the Crucial drives, which have a less aggressive Garbage Collection scheme, the problem can mount quickly if you are running close to full capacity usage.

The Intel drives have a good garbage collection scheme built into the firmware (at least the ones using the older Intel controllers, I don't know the details of the Sandforce ones in great detail because Sandforce is so secretive), and those are less troublesome without TRIM.  In any case, it helps in many cases, and never hurts, so there is no reason not to make sure it is enabled.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: New HTPC Build with SSD - Symbolic Links
« Reply #3 on: July 06, 2012, 04:41:07 pm »

True, certain drives seem more sensitive than others but I meant to mention the Toolbox there, I forgot.

Luckily there's always someone to cover my back  ;D
Logged

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #4 on: July 06, 2012, 05:02:01 pm »

Thanks for the tips I'll take them into account, I was reading up on junction points would they prove to be better than sym links for some folders.
Logged

Jaguu

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1336
Re: New HTPC Build with SSD - Symbolic Links
« Reply #5 on: July 06, 2012, 05:31:32 pm »

This week a Swiss PC magazine published a really smart way to move the complete users folder from C: to another drive like D: So you will have Windows and program files only on the SSD and all user data on a hard drive. To move the users folder do the following:

1. Boot Windows7 from the Boot CD and when appropriate select the command line mode and log in as administrator.
2. As booting from the install CD changes the drive letters, you will first have to find out the drive letter of the system drive, could be e:\
3. Having booted from the CD, the users folder on disk is now unlocked and you are able to copy the entire users folder to another drive with robocopy, which is on the system, example: robocopy e:\users d:\users /mir /sec /xj
4. After you copied the whole users folder to d:\, delete the original users folders on e:\ (the system drive)
3. Now make a hard link with the command mklink, example: mklink e:\users d:\users /j
4. Remove the CD and reboot your windows. Everything should work as usual, but the whole users folder will now reside on d:\

One advantage of this data split is backup: You can perform an image backup of the c:\ drive and separate replication / sync of all users and media data on d:\

This is really smart as it is almost impossible to move the users folder in its entirety to another drive except for a new and  unattended installation of Windows.


Logged

hulkss

  • Galactic Citizen
  • ****
  • Posts: 451
Re: New HTPC Build with SSD - Symbolic Links
« Reply #6 on: July 06, 2012, 05:32:47 pm »

I was reading up on junction points would they prove to be better than sym links for some folders.

I tried this approach of junction points etc for an install of windows. Works great in theory....however.... a lot of software aparently does not follow all of the Microsoft rules and many things will get screwed up in strange ways as a result. I recommend against it as developers are not testing with "odd" OS installations.
Logged

Jaguu

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1336
Re: New HTPC Build with SSD - Symbolic Links
« Reply #7 on: July 06, 2012, 06:02:50 pm »

There is a difference between hard links and junction points. Google for it. Hard links work, junction points not always.
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: New HTPC Build with SSD - Symbolic Links
« Reply #8 on: July 07, 2012, 02:40:59 am »

One method for redirecting may work better than another, but there may still be issues/incompatibities, that's a fact.

Besides, there is no reason to make it that complicated when you can simply edit a registry key (follow link I gave above), change C:\Users to D:\Users and create a new user account. The new users' profile will be in D:\Users. It is as simple as that. All profile folders, including appdata, temp, everything, will be in D:\Users\profile\. This works best on new installations for new users, don't attempt to move existing profiles. It may be possible, but it's not straightforward as a new user.

This method, on a new installation, works flawless. I've done this for years. There is zero reason to use junctions, hard points, symlinks, whatever for moving user profile folders. It just makes things overly complicated and increases the chances for trouble. The method above provides 100% compatibility.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #9 on: July 07, 2012, 11:47:04 am »

Besides, there is no reason to make it that complicated when you can simply edit a registry key (follow link I gave above), change C:\Users to D:\Users and create a new user account. The new users' profile will be in D:\Users. It is as simple as that. All profile folders, including appdata, temp, everything, will be in D:\Users\profile\. This works best on new installations for new users, don't attempt to move existing profiles. It may be possible, but it's not straightforward as a new user.

If you really need to move the whole user folder, this is the only safe way to do it.  Other options may work "some of the time", but not with all applications, and when you do encounter errors from it, they'll be nigh impossible to relate to the issue.  However... There is a bad thing about doing it this way.  When you create a whole new user profile this way, then you are moving your AppData folder(s) off of the fast SSD and onto the spinning disk which is an order-of-magnitude slower.

Applications read/write to the AppData folder a LOT (especially on launch and shutdown).  They often store caches there and other similar things, which really benefit from the fast random access speeds of the SSD.  Moving AppData in full to a slower spinning disk, "muffles" some of the benefit of moving to an SSD.

I find it is better to move only the true "user data" folders over.  Windows has a built in mechanism for moving these "special folders" (Documents, Music, etc), and they work fine.  Slower speeds reading/writing these files isn't usually a big deal, and these file types are almost always read sequentially (and spinning disks do much better against SSDs with sequential reads/writes than they do with random access where their pants fall down).  If you can't fit everything you need to on the SSD, then you'd almost certainly be better off either:

1. Buying a bigger SSD.  Here's an awesome deal on a Crucial M4 512GB drive this weekend for under $400.  Not the fastest drive on the block, but the 512GB version is still a screamer, and you can't beat that price.  If that's too rich for your blood, you can get ~240GB Sandforce drives now for under $180.

2. If you have a Z68 chipset or newer, set that little SSD up as a Smart Response Cache.  This provides a very nice performance benefit without forcing you to decide what to move to the SSD and what to put on the spinning disk on your own (which you're never going to do fully efficiently).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #10 on: July 08, 2012, 01:47:40 pm »

A lot of points to take in I'll have to really think about it all.

I read somewhere that ssds have a minimum block size. So if I save a 1kb txt file it will still take up more space. I don't mind keeping the user profile app data folders on the ssd. I will definitely move the music, pictures, documents etc.

It's really just folders that fill up with lots of junk files I am worried about, like the windows temp folder and log folders.

Are there any specific programs I should avoid installing on the ssd, ones that consist of thousands of files for instance?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #11 on: July 08, 2012, 06:33:32 pm »

I read somewhere that ssds have a minimum block size. So if I save a 1kb txt file it will still take up more space. I don't mind keeping the user profile app data folders on the ssd. I will definitely move the music, pictures, documents etc.

This is only slightly more true than it is on a spinning disk, in practice.  Most SSDs have a 4kb page size.  Traditionally, hard drives had a 512b or 2048b sector size, however, newer hard drives use the same 4k sector size as most SSDs (those above 3TB originally, but many new drives too anymore, regardless of total size).

On an SSD you almost always want to align your filesystem's block size to the native page size.  On a spinning disk, it doesn't matter as much, and you can effectively set it to whatever you'd like.

The main difference is that when you have a spinning disk, the performance penalty for not aligning block size with sector size is generally very small.  So, if you have a drive that you know you are going to totally fill with very small (less than 512b) files, you can gain back a small amount of space by formatting with a smaller block size.  On SSDs, you don't want to do that because you don't want the pages and blocks to be misaligned, or it screws up the whole TRIM and garbage collection schemes.  In practice, this is usually not worth the performance penalty anyway, even on a spinning disk, except for on specialized servers that store truly massive quantities of very small bits of data.

Not worth worrying about.

It's really just folders that fill up with lots of junk files I am worried about, like the windows temp folder and log folders.

CCleaner and Task Scheduler.

EDIT:  I should note, and I did not above, that there are also downsides to using a smaller block size.  This wastes space too!  Basically, it is a tradeoff.  The smaller the block size in relation to the total size of the disk, the more space is wasted on "formatting" (tracking and allocating all of those blocks).  The bigger the block size, the less overhead is needed in the filesystem, but the more slack space (those wasted bytes at the end of files) you create.

So, to give a real-world example.  On my C drive on my server, which is a 128GB SSD, I have around 407,000 files total stored.  A good (conservative) rule-of-thumb is that you end up with around 1/2 a block of slack space per file.  With a 4k block size (correct for my SSD), that works out to around 800MB of wasted slack space on the drive total.  That's 800MB out of 121856MB total (or 0.66%).  But slack space is only one part of the overhead in NTFS.  Each file needs at least one entry in the MFT as well, for example, and there's the formatting overhead.

Also, note, that the default NTFS cluster size for any drive from 2GB to 16TB in size is 4k, the same as the standard SSD page size (not coincidentally).  So, unless you are manually changing the cluster size on your spinning disks, this same rule would apply equally to those disks.  You'd only ever even see a difference if you were using non-default block sizes with your formats.  And, the defaults are balanced to prevent excessive filesystem overhead.  You should only change them if you know what you are doing, or if you have hardware that prefers a different block size (common with RAID cards, and usually you make it bigger, not smaller).

Also Note: You shouldn't use an SSD on a Windows XP system without taking special care to align your blocks to your pages properly.  That's because Windows XP is set up funny though, and it was fixed with Vista and later.  This doesn't waste space, but does degrade performance.  You really don't get all of the whiz-bang of an SSD on Windows XP anyway though, and Windows 7 is a much better choice.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #12 on: July 12, 2012, 01:17:29 pm »

Thanks for all the usefull information, it's making it much easier.

One last question, I know you aren't supposed to defrag the ssd but what about defragging the registry? Do the same rules apply as the random read access is so fast?

Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #13 on: July 12, 2012, 11:31:43 pm »

Registry "Cleaning" is generally snakeoil.  There can be uses for good cleaners (like CCleaner) when you are trying to solve a specific purpose (removing all traces of a sloppy graphics driver uninstall is a common use-case), but most of the time, it is useless.  According to Ed Bott:

Quote
I'd go a step further: Don't run registry cleaner programs, period. I won't go so far as to call them snake oil, but what possible performance benefits can you get from "cleaning up" unneeded registry entries and eliminating a few stray DLL files?

When you think about it, this really makes sense.  A registry cleaner might find and clean out 50 or 100 or 200 "orphaned" entries left behind by a bad uninstaller that doesn't properly clean up after its source application (which is mostly what they do).  Sure, those entries are loaded into RAM, and are unnecessary, but each key is very small individually.  And, by percentages, your registry might contain 500,000 individual keys.  Removing 0.01% of the RAM used by the registry by "cleaning" out 200 keys isn't going to make a darn bit of difference anyone can see.

Registry Defragging is sometimes useful on a spinning disk, but is especially useless with an SSD.  The only thing it can ever help with is startup and shutdown times.  The registry is, in full, loaded into RAM and kept there throughout any login session in Windows.  Any changes you make are writes to RAM, not to disk, and so is unaffected by fragmentation.  Only when you login/logout are changes read-from/to disk (well, it also flushes changes to disk periodically, but this is only done when the disk is otherwise idle).  So, even if your registry hive files are badly fragmented, fixing it will only impact those big login/logout read and write operations, after which, the whole darn thing is resident in RAM for all uses.

If you are on a slow disk, particularly one that is highly utilized (almost full states often result in heavier fragmentation), you can see some boot time benefits from defragging the registry (all that random access costs time).  But think about the entire point of defragging.  The idea is to take files that are broken up and stored in "hunks" spread all around the surface of the disk, and to shuffle the pieces around to store them contiguously.  The reason to do this is because traditional spinning disks have much faster sustained read rates than they do random access rates (which requires moving the head around and then waiting for the platters to spin around to the right place).

As explained above, SSDs have near-instantaneous random access times.  Defragging does not help (and can hurt) an SSD, and regular defragging is just going to result in excessive write amplification, and can reduce the lifespan of your drive.  Basically, the rule of thumb with an SSD should be "don't write to it when you don't have to".  Not that you need to worry that much, as most SSDs will die from component failures before a substantial enough portion of the NAND has exceeded its write-erase cycle limits (or will be so small by modern standards that they have out-lived their usefulness anyway).  But you shouldn't do it wastefully.  It comes down to this:

When Random Access Times are instantaneous, there is no need to ensure that files live "together" on the disk anymore.

In fact, even when you do this, the SSD doesn't actually store the files contiguously on the NAND.  All SSD controllers are constantly shifting data around as you write it.  Spreading writes across the available NAND as part of their wear leveling scheme, cycling over-provisioned capacity out for "used cells".  Even more significant, SSD controllers internally stripe data across the internal NAND array intentionally to spread the data across the various channels and improve performance (and they do parity bit calculations to provide for data integrity checking and recovery).  Basically, inside that SSD, the controller treats the NAND much like a RAID5 array, with the individual NAND chips playing the part of independent drives.

So, defragging them doesn't even actually accomplish the goal of "storing files contiguously", and even if it somehow did accomplish this by some miracle, it would reduce the performance of the NAND array because the file would only be available to one of the drive's internal channels.

If you want to learn more about how SSDs work, and the future of the technology, you really can't go wrong with Ars Technica's recent monumental epic series on the subject:

1. How SSDs Work
2. The Impact of Flash on Mobile Devices and Modern OSes
3. How Do You Make the Most of Your SSD?
4. The Future of Flash Memory
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #14 on: July 13, 2012, 12:13:49 pm »

Thanks Glynor lots of useful information I'm sure I'll prolong the lifespan of the ssd now  ;D
Logged

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #15 on: July 25, 2012, 07:03:18 pm »

Glynor what do you think Pagefile on ssd or not?

I've read that the ratio of reads/writes to the page file is somewhere along the lines of 40:1, so the writes are minimal. It is suggested that it is better to keep it on the ssd but on other forums people say move it to a mechanical hard drive.

What do you think?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #16 on: July 25, 2012, 07:31:20 pm »

Keep it on the SSD for sure.  If you do need to swap out to the page file, having it in the SSD is going to give a massive performance boost.  Like I said above, don't write to an SSD for no good reason, but also don't worry about the write limits so much that you change things around.  They're fine.

People who claim otherwise are just plain wrong.  You don't want to use a MLC (consumer) SSD in a high-throughput database server, because they write to disks more in a few minutes than you do on your Windows machine in a lifetime of use.  But for home use, even aggressive home use, it is fine for everything Windows puts on there by itself and whatnot.

I probably wouldn't use it for a high-throughput "recording scratch disk" either, but more because it would be absurd overkill than for some worry about wearing out the write/erase cycles on the NAND.

But, I'll also note, if you have enough RAM, you'll never actually page out to disk.  RAM is mega-cheap.  Just throw 16GB in the machine and fuggedaboutit.

PS. One other note, that I'm not sure I made above...  You might not be aware of this, but one nice thing about NAND is that if you DO hit those cell re-write limits, they fail read-only, not altogether.  What I mean is that if your drive were to ever be affected by this during its usable lifespan (again, unlikely), you won't lose data.  How you'll know it happens is that you'll start getting write errors, but reads will continue to work from now until the end of time (well, assuming other electronics components in the drive don't fail).

Again, though, this is very unlikely, at least in the current generation of drives.  The controller and power supply circuitry are going to burn up and fry long before the active and spare NAND space in that drive is all "used up".
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #17 on: July 26, 2012, 03:36:43 am »

Thanks Glynor was a little unsure about that one :)
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #18 on: July 26, 2012, 06:47:07 am »

One other thing I should note:  A handful of drives that are based on Sandforce controllers advertise higher capacity than most of the rest.  They do this by simply reducing the amount of spare capacity that the controller has to use, not by actually adding additional NAND.  Most "normal" Sandforce based drives have "odd" capacities compared to normal SSDs (60, 120, 240, 480 rather than 64, 128, 256, and 512).

I'm skeptical about these.  Don't get one, or if you did, revert it back to "normal mode" (which you should be able to do via the firmware writing application the manufacturer provides).  Not only do they perform worse, but I'd be afraid this is pushing the spare area on the drive too much, and could reduce longevity.  It could be paranoia, but there is a good reason that Sandforce chose to reserve that extra spare space, and pushing the limits right to the edge seems like a bad idea for a few GB extra.

Drives with other controllers don't have this issue (Samsung, Micron, Intel, etc).

If you are extra paranoid: You can also provide "extra protection" on any SSD by simply leaving some portion of the drive unformatted.  Any unformatted/unused space is automatically used by the controller for wear leveling.  So, for example, if you have a 256GB drive, only format it as a 230GB volume in Windows and leave 26GB free (or something like that).

The more "blank space" an SSD has (whether formatted or unformatted doesn't matter), the more space the controller will have to spread writes around and keep the NAND healthy.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: New HTPC Build with SSD - Symbolic Links
« Reply #19 on: July 26, 2012, 07:20:42 am »

Too late, I already formatted and installed my os.

I got a Crucial M4 128gb, I quite happy with it it seems really fast. From what I've heard they are pretty reliable. I don't play pc games so the size should be more than adequate for my os and most programs
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New HTPC Build with SSD - Symbolic Links
« Reply #20 on: July 26, 2012, 07:22:00 am »

The M4 doesn't have the problem I was referring to, as it isn't a Sandforce-based drive.

No worries.  Like I said, that was only for the paranoid.  And, it really doesn't matter if the extra space on the drive is formatted or not.  The controller will use any "free" space (formatted or unformatted) for wear leveling regardless.  Keeping some of it unformatted is just a trick to keep you from accidentally sucking all of the space up.

They all have plenty of spare area anyway (with the possible exception of those "extended capacity" Sandforce drives which make me skeptical), so it isn't worth worrying about.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up