VOGONS


First post, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

I've run an experiment with my laptop. The hardware used is:

- A Toshiba Satellite Pro 4340. It has a PIIX4 southbridge, that uses UDMA/33.
- A IBM DJSA-210 hard disk. It has 10 Gb, runs at 4200 rpm and is a UDMA/66. This disk used to run in a (now defunct) Fujitsu laptop.
- A Samsung Evo microSD card (UHS-1) with a SD adapter.
- A chinese unbranded SD to IDE 44 adapter.

That laptop runs Windows 98SE, so the only performance test I had was Diskspeed. Windows 98 has Intel chipset drivers installed, but for some reason it does NOT enable DMA when you put a new hard disk. So I made performance tests with and without DMA enabled. The results are the following:

                     HDD   HDD+DMA        SD     SD+DMA
--- ------- -- ------
Linear (Mb/s): 4,2576 14,8352 23,1250 110,9375
Random (Mb/s): 0,9303 1,4856 10,3125 43,3750
Access (ms): 16,81 16,67 2,05 0,71

Keep in mind that there are a bottleneck on IDE bus. It is a UDMA/33 bus, while both devices (IBM hard disk and Samsung SD card) support higher speeds.

Also, my performance test don't measure write speed (there are other software that can measure write speed, but I only had DiskSpeed at hand). Unless Windows 98 group disk writes so it can erase/write entire SD card pages at once (and Windows 98 never supported SSD), write speed should be slow (maybe if partitions are aligned and cluster size is the same as SD card page size...).

Do you think that replacing old/small hard drives with SD cards is a good idea? Do you think that SD cards would support the stress caused by misaligned disk writes?

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 2 of 9, by GuyTechie

User metadata
Rank Member
Rank
Member

I think for occasional use, it's not that bad. I don't plan on daily driving my retro rig. It's also nice to be able to pop in a different SD Card to test different OSes and configurations while keeping your main SD Card pristene. I know you have a laptop, but if you have a retro desktop that allows access to the SD card externally (without needing to crack open the case), it's like having a solid state removable hard drive. Convenient to test out different OSes.

You're going to miss that hard drive whine and clatter though (especially old noisy ones).

Reply 3 of 9, by debs3759

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for sharing your results. I've been considering SD cards for a couple of retro builds. This has me convinced it'll be worth it for graphics card testing systems that don't need to be perfect retro systems 😀

See my graphics card database at www.gpuzoo.com
Constantly being worked on. Feel free to message me with any corrections or details of cards you would like me to research and add.

Reply 4 of 9, by Zup

User metadata
Rank Oldbie
Rank
Oldbie
happycube wrote:

It probably won't last forever, but given how cheap an 8 or 16gb card is now and how fast it is, does it matter? 😉

The SD adapter has not the same size as a hard disk, so I had to disassembly the laptop. Replacing a hard disk needs only to remove one screw (and a cover), Put that adapter on place and ensure I didn't bend any pin needs to remove that cover, the keyboard and the upper cover (including screen) to view the IDE connector. To replace that SD card (or the entire adapter) I'd need to disassembly the thing again, so (in laptops) it would be a permanent change (and my Toshiba is not very complex).

debs3759 wrote:

Thanks for sharing your results. I've been considering SD cards for a couple of retro builds. This has me convinced it'll be worth it for graphics card testing systems that don't need to be perfect retro systems 😀

Your mileage can vary. I choose a (very) fast SD card (UHS-1, equivalent to a Class 10 card). Also, some SD to IDE adapter may only support SD cards and not SDHC (I've got one of those) or won't support DMA modes (although that card is faster than my hard disk even on non DMA mode). I guess that even an old Class 2 or Class 4 card would outperform Pentium era hard disks, but writing speeds are still untested.

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 5 of 9, by shamino

User metadata
Rank l33t
Rank
l33t

I must be missing something obvious here, but I'm confused how you're getting so much more linear transfer speed from the SD card - is it somehow on the PCI bus directly? Because you're getting way more speed than UDMA33 will support. Or if those are megabits (not bytes), then in that case the hard drive looks way too slow.

To use this or any Flash based storage over the long term, I would do two things:
1) Align the partition(s) by creating them in gparted or similar (use the "align to 1MB boundary" option). Don't let Win98 create the partitions, create them in gparted and just let Win98 format them.
2) "Overprovision" (if that's the correct term) the storage.
Starting from a pristine or nearly pristine SD card, only partition -part- of the available space, not all of it. As far as I know SD cards don't have any support for TRIM or secure erase, so there's no way to ever invalidate a storage location on them. As they age, eventually nearly all of the logical addresses could end up receiving a write, so they will have an ever decreasing amount of "unused" slack space available (from the SD card's point of view) and their performance will keep degrading. They don't understand what space has been deallocated by the OS/filesystem, so once an address has been written once, the card will spend the rest of it's life trying to preserve that data. Unless I'm mistaken there's no way to "reset" these devices or TRIM them at all. Seems like a very serious oversight with USB/SD/CF storage in my opinion, but I guess the industry regards them as throwaway devices.
If you leave say 25-50% of the space as unallocated and never referenced by any write operation, this should mitigate that and keep their performance up over the long term. Some benchmarks in SSD reviews (maybe just older ones) have tested this principle and measured how much the performance drops off with a given percentage of "overprovisioning".

Reply 6 of 9, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Does any one know whether modern SD/SDHC/SDXC cards do still use 512 Byte sectors or not ? CF cards and older PATA SSDs usually did use them.
I know that alignment can be fixed for 4 Kibibyte media by using gparted (at least for DOS/win9x. I know that MacOS9 didn't like this),
but access time/write performance could be still a bit behind cards which do use 512 Byte sectors (pages) internally.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 7 of 9, by Jo22

User metadata
Rank l33t++
Rank
l33t++
shamino wrote:

I
2) "Overprovision" (if that's the correct term) the storage.
Starting from a pristine or nearly pristine SD card, only partition -part- of the available space, not all of it. As far as I know SD cards don't have any support for TRIM or secure erase, so there's no way to ever invalidate a storage location on them. As they age, eventually nearly all of the logical addresses could end up receiving a write, so they will have an ever decreasing amount of "unused" slack space available (from the SD card's point of view) and their performance will keep degrading. They don't understand what space has been deallocated by the OS/filesystem, so once an address has been written once, the card will spend the rest of it's life trying to preserve that data. Unless I'm mistaken there's no way to "reset" these devices or TRIM them at all.

I heard of that. The problem is, if you do apply overprovision on an used media, it get's even worse :
Normally, if you do allocate all available flash, the aging process is spread over all cells. (Good)
But if you do reserve used flash, it is never beeing used by the OS/the card and the other cells die more quickly. (Bad)

A solution would be to do a reset or do some blanking.
Note that "erasing" a HDD works in reverse to a "SSD", because their logical values which do represent 1 (one) and 0 (zero) are internally different.
Im speaking under correction, but I think it works akin to an EPROM.

So if you do use an archaic HDD erasing tool, you may write data patterns to the flash media which it won't recognize as "empty".

So to make this work a feature like "secure erase" is required.
Apparently some SD cards do have something similar (see SD Formatter), but I've never seen a card with this feature. Did you ?

Edit: Several edits. Sorry. I can't concentrate myself today. 🙁

Attachments

  • fullerase.gif
    Filename
    fullerase.gif
    File size
    28.82 KiB
    Views
    3570 views
    File comment
    Flash erase possible ?
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 8 of 9, by shamino

User metadata
Rank l33t
Rank
l33t
Jo22 wrote:

I heard of that. The problem is, if you do apply overprovision on an used media, it get's even worse :
Normally, if you do allocate all available flash, the aging process is spread over all cells. (Good)
But if you do reserve used flash, it is never beeing used by the OS/the card and the other cells die more quickly. (Bad)

I can see how that would be an issue - if most/all of the address range you are reserving has already been written before, then this strategy could be counterproductive as far as preserving the card goes. However, if it's reached the state where nearly all logical addresses are considered in use, and thus virtually all the physical flash locations are flagged as "active", then the write amplification rate might have already spiked so badly (10-20x or more) that it dominates the wear issue and nothing you do will make much difference. But maybe I'm being too defeatist here. 😀

I'm on the fence about whether to do this on used cards, but I'm really just advocating this strategy with a new card. With a used one it might not be a good idea, as you pointed out.

On a new card, the wear leveling should be free to map across all physical storage even if only part of the logical address range is used. But I'm making an assumption that the controllers in these things are reasonably intelligent, and that might not be the case.

This might already be well understood, but I just want to elaborate on the theory in case it's unclear to anyone (this assumes a new, pristine card):
Say the first time you write to LBA address 0xC100, the card stores it at some physical location "A". It records the fact that LBA address 0xC100 is being stored at location "A".
A day later you overwrite something else to the same LBA address 0xC100, this time the card maps it to location "B", which happens to be in a completely different place in the actual flash memory.
The flash controller will not waste time and write cycles trying to protect the contents of physical location "A", because it knows that data is obsolete and no longer valid. It knows that location is now available for reuse/garbage collection.
So by restricting the OS to only use say 4GB worth of addresses on an 8GB flash device, the data can still be wear leveled around all the physical flash storage, but at any given time the flash controller will never think more than half of it contains valid data, so performance and write amplification are kept in check.

A solution would be to do a reset or do some blanking. Note that "erasing" a HDD works in reverse to a "SSD", because their logi […]
Show full quote

A solution would be to do a reset or do some blanking.
Note that "erasing" a HDD works in reverse to a "SSD", because their logical values which do represent 1 (one) and 0 (zero) are internally different.
Im speaking under correction, but I think it works akin to an EPROM.

So if you do use an archaic HDD erasing tool, you may write data patterns to the flash media which it won't recognize as "empty".

I've read of people trying to reset USB flash sticks, but I'm not sure how they would ever recognize anything as being "empty". How does the controller know you didn't intentionally store a string of 1s or 0s that need to be preserved? Yet I think I've read of people claiming that this can work, but I have trouble believing it. I guess it might be interesting to experiment on a junk USB stick sometime. Measure it's performance in some benchmark, do something to intentionally degrade it, benchmark again to confirm, then try different methods of trying to "erase" it and see if performance can be restored.

So to make this work a feature like "secure erase" is required.

I agree, support for "secure erase" would be very appropriate for things like USB sticks and SD cards IMO. Not just for resetting their performance but also for security. I'm kind of surprised it's not an established standard.

Apparently some SD cards do have something similar (see SD Formatter), but I've never seen a card with this feature. Did you ?

Not that I know of, but I've never done much research into SD cards. If they do have some documented way to tell them to consider themselves erased, then that would be a great thing.

Reply 9 of 9, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Thank you very much for your reply, shamino!
You explanation was very well done!

shamino wrote:
A solution would be to do a reset or do some blanking. Note that "erasing" a HDD works in reverse to a "SSD", because their logi […]
Show full quote

A solution would be to do a reset or do some blanking.
Note that "erasing" a HDD works in reverse to a "SSD", because their logical values which do represent 1 (one) and 0 (zero) are internally different.
Im speaking under correction, but I think it works akin to an EPROM.

So if you do use an archaic HDD erasing tool, you may write data patterns to the flash media which it won't recognize as "empty".

I've read of people trying to reset USB flash sticks, but I'm not sure how they would ever recognize anything as being "empty". How does the controller know you didn't intentionally store a string of 1s or 0s that need to be preserved? Yet I think I've read of people claiming that this can work, but I have trouble believing it. I guess it might be interesting to experiment on a junk USB stick sometime. Measure it's performance in some benchmark, do something to intentionally degrade it, benchmark again to confirm, then try different methods of trying to "erase" it and see if performance can be restored.

That's exactly what I wondered as well. Perhaps a complete flash "page" has to be ONEd (instead of ZEROed) ?
Another idea would be to overwrite data in all (used) LBA addresses with a specific pattern (0 or 1 or something else).
On boot-up (power on), the card could recognize this and perform a complete factory reset (incl. clearing the "LBA table").

But that's just an idea of mine. There's also a problem. Flash was already in use,
so it wouldn't be safe if the SD card would forget about everything what happened before such a reset.
SSD are quite smart and incorporate powerful multi-core controllers to keep track about such things (like SMART data).
But what about current SD cards ? Do they have enough resources to remember how often each of their cells were used before ?
I seriously don't know. My knowledge is a bit timeworn, I'm afraid.

But if I think about it, even earliest CF cards used to have a simple form of wear-level algorithm,
so perhaps modern SD cards do now have more sophisticated methods to save flash cells..

shamino wrote:

So to make this work a feature like "secure erase" is required.

I agree, support for "secure erase" would be very appropriate for things like USB sticks and SD cards IMO. Not just for resetting their performance but also for security. I'm kind of surprised it's not an established standard.

I'm surprised, too. Perhaps manufacturers do not suspect their average customers to be as smart as they are themselves ? I hope not, because it isn't true:
A few years ago I've read a lot about this flash issues in photography-themed forums (I was looking for a good camera).
Apparently, professional photographers do worry way more about their flash cards than we do (even though they aren't geeks, but "normal" people).
So I think is unintelligibly that high-end SD cards (or industrial CF cards at least) do not have a such a feature, even though it is a sought after feature.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//