Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Comment Secure deletion (Score 0) 135

Why go to the trouble of implementing a command implicitly when you can implement it explicitly and avoid unintended side effects?

Because the explicit command causes unintended side effects in drives manufactured prior to the command's introduction.

Not to mention operating systems would still need to change the way they handle the disk to support the 0xFF method

Any file system supporting "secure" deletion should be filling deleted files' sectors in the background anyway.

Comment The drive would decompress it (Score 1) 135

A sector full of only 0xFF might mean "I don't need this anymore" as well as "this file have a sector worth of 0xFF stored there".

Either way, when you read that sector back, the drive would decompress it to a string of 0xFF. This is true whether it's an "empty sector" or a row of white pixels in a BMP file.

Using trim, the FS/OS/whatever's on the line can tell the drive "ok, this part I don't need anymore, go play with it" in a non-ambiguous way.

What happens when the kernel attempts to read back a sector that hasn't been written since it was last TRIMmed?

Comment Some drives choke on TRIM (Score 1) 135

To make it work, the disk would have to look at every written block and see if it's "the empty block".

A lot of flash controllers already use compression of some sort to reduce write amplification. So a controller could just store which sectors compress to the smallest sizes. That wouldn't be much more effort than storing which sectors are TRIMmed, and it'd ensure a well-defined response when the kernel attempts to read a TRIMmed sector.

TRIM is faster and easier.

Unless, as Immerman pointed out, a particular drive chokes on it. Sending TRIM to a device that doesn't correctly support TRIM produces "undefined behavior", and even some drives that claim to support TRIM don't in fact. No drive chokes on constant fill.

Comment Poor man's TRIM (Score 1) 135

A filesystem just notes which blocks are erased, it doesn't actually erase them. [...] With TRIM, the OS can tell the disk which blocks are no longer needed, so that the disk can treat them like empty blocks

Why couldn't an operating system just write a big block of 0xFF bytes to an unused sector, which the SSD's controller would compress into an efficient representation of a low-information-content sector, instead of needing a dedicated command?

Comment Re:Can someone dumb-down the comment... (Score 5, Informative) 135

Solid-state drives (SSDs) are an alternative to hard disk drives using flash memory instead of spinning platters. This greatly improves read speeds but doesn't do quite as much for write speeds. One reason is that each sector on a solid-state drive can only be erased a finite number of times before it starts failing. For this reason, the microcontroller in an SSD perform wear leveling to spread writes across more physical sectors. TRIM is a feature that an operating system can use to notify a drive that a range of sectors has become unused, which helps wear leveling run more efficiently. A cron job is a program that runs periodically in the background, and Canonical (the publisher of Ubuntu, a distribution of the GNU/Linux operating system) wants to add a cron job that scans attached drives for unused sectors and sends TRIM commands for these sectors. It's possible for an operating system kernel to send a TRIM command for multiple ranges of sectors, but the current version of Linux doesn't know this and instead sends one range at a time. This slows down deleting files because the kernel has to notify the drive of each sector range as the file is deleted. To work around this missing feature of Linux, the cron job will TRIM when a drive isn't busy doing something else.

Comment It's cache (Score 2) 135

I swear, after the OS, web browsers seem to generate the next highest number of 'writes'.

I'd bet a lot of these writes are for caching received HTTP response bodies to disk. Otherwise, desktop browsers in low-memory environments would have to act like Firefox for Android and Chrome for Android. When I open multiple pages in tabs in these mobile browsers, they tend to discard entire pages as soon as I switch to another tab and reload them when I switch back. This interferes with my common use case of opening multiple pages in tabs and then reading them while offline and riding transit. Firefox for X11/Linux can keep pages open on a Dell Inspiron mini 1012 laptop with 1 GB of RAM, but Firefox for Android can't on a first-generation ASUS Nexus 7 tablet with the same amount of RAM. I guess the difference comes from two differences in the environment: swapping is more acceptable on X11/Linux than on Android, and desktop browsers are more likely to keep things in disk cache than mobile browsers.

Comment Re:Remaining a law-abiding citizen (Score 1) 550

Find me an American law that can't be understood with high-school reading skills.

Sometimes the hard-to-understand part of the law is not the law itself as much as how it applies to the facts. One example is whether two works of authorship are "substantially similar" in areas beyond "idea, procedure, process," or other unprotectable elements. Another is whether factors in favor of fairness of a particular use of a work of authorship outweigh factors in favor of unfairness.

Slashdot Top Deals

So you think that money is the root of all evil. Have you ever asked what is the root of money? -- Ayn Rand

Working...