SD to HDD conversion


22 posts
by Crook » Mon Jun 11, 2012 9:23 am
I know there are cards allowing an SD card to be used as a HDD - is there such a thing in reverse? Plug a connector into the SD socket and into a powered SATA drive, and have a traditional HDD setup?
Posts: 42
Joined: Mon Jun 04, 2012 5:57 pm
by godFather89 » Mon Jun 11, 2012 9:23 am
Why would you need something like this?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by Crook » Mon Jun 11, 2012 9:29 am
Just wondering how fast the internals of the RPi are for IO. An SD card isn't the fastest thing ever, and a HDD might dramatically speed things up. That and your root drive could be in the terabyte range.
Posts: 42
Joined: Mon Jun 04, 2012 5:57 pm
by AndrewS » Mon Jun 11, 2012 11:04 am
Rather than a physical adaptor, I suspect this would suit you much better ;)
viewtopic.php?f=63&t=6565
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by Crook » Mon Jun 11, 2012 7:40 pm
I was concerned about the throughput on the USB, since it's already used for so much else, kb, mouse, eth, but it seems from that thread that booting into a USB drive gives a speed boost. I'm a little confused though, some are taking about a USB drive and others a USB stick - I'd have thought a flash drive was comparable to an SD card.
Posts: 42
Joined: Mon Jun 04, 2012 5:57 pm
by AndrewS » Tue Jun 12, 2012 1:45 am
At the moment, the SD-interface speed on the RPi is quite limited (about 4 or 5 MB/s max, even with high-speed cards that work much faster on a PC). However initial tests in another thread seem to indicate that this is merely a software problem, which may be fixed by future kernel/firmware updates...
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by Lob0426 » Wed Jun 13, 2012 9:55 am
The bottleneck, which is at the SD interface does not appear to be affecting the USB interface. The SD cards are on average not quite as fast as the USB sticks, remember I said average. There are good and bad sticks out there. And you are right to see the heavy use of the USB bus will have an effect on overall performance. The USB bus is very dependent upon the ARM cpu. It is all going to be a balancing act for how you use your RasPi. An USB camera and an USB HDD or stick are going to have to compete for resources. But a camera using the onboard connector and sending to the USB HDD or stick is going to compete less.

I am currently using a USB HDD. I do see a gain in boot speed, to command line, and in entering LXDE, but that gain is not twice as fast. I did not really notice a difference while playing quake3. It did not seem to start faster or go to play any faster. Moving rootfs to a USB HDD or USB stick is not a magic bullet, but there are some small gains to doing it. Like 298GB of storage and double the swap space (191MB expanded to 512MB (double the RAM size)).
512MB version 2.0 as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1898
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
by AndrewS » Wed Jun 13, 2012 10:33 am
In technical terms, a USB HDD makes boot-up faster because the boot process is IO-bound. But it doesn't make Quake3 any faster because Q3 is CPU-bound.
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by Lob0426 » Wed Jun 13, 2012 4:54 pm
@AndrewS: that is true but I thought it would get into and out of the game faster due to faster file transfers. That did not appear to be the case. Quake3 fits comfortably into memory anyway, so increasing the swapfile would have no real effect on it. Running it at a 128 split would have more benefit. The balance could be that the SD card handles small file transfers faster, due to faster acces times, than the HDD does. A small (32GB or 60GB) cheap SSD could give the best of both worlds. I have see the 60's at mid $50 range. But is the slight gain worth the cash?
512MB version 2.0 as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1898
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
by Crook » Thu Jun 14, 2012 11:47 am
I think a lot of people will go for a HDD who are interested in media players - maybe other uses. Not for a massive gain, but for something incremental as mentioned above, like overclocking 10% more (haven't we all done this now?)

I just thought there would be a gizmo to allow a HDD to connect to an SD socket directly, rather than it being on the USB along with everything else.
Posts: 42
Joined: Mon Jun 04, 2012 5:57 pm
by AndrewS » Thu Jun 14, 2012 12:10 pm
Crook wrote:I just thought there would be a gizmo to allow a HDD to connect to an SD socket directly, rather than it being on the USB along with everything else.

Okay, I had a quick google... the reason that a SDcard -> SATA adaptor works, is because the firmware on the adaptor is emulating a SSD (solid state drive) not a HDD, i.e. the computer talking to the SATA still 'knows' it's talking to a flash-memory-device, not to a hard-drive-device (the way you write to a flash-memory-device is very different to the way you write to a hard-drive-device).
But there's no specs for a hard-drive-device being accessed via a SDcard interface (which only expects flash-memory-devices) which is why this would be impossible.
(unless somebody created a SATA->SDIO card, and then created an entirely new SATA-SDIO driver, which simply isn't feasible) :ugeek:

And for the sake of completeness: CompactFlash memory cards are a bit different, in that they have extra electronics on board (which is why they're bigger) which does allow them to be accessed as a hard-drive-device. And this is why you can get cheap CompactFlash->IDE adaptors (they're electrically compatible) and also why you can get CompactFlash MicroDrives 8-)
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by Crook » Thu Jun 14, 2012 12:39 pm
I'm sure it's easily possible to create a SATA to SDIO converter, but not sure of many potential uses which is why it probably hasn't been done - simple marketability. Anyway, if there isn't one there isn't one.
Posts: 42
Joined: Mon Jun 04, 2012 5:57 pm
by AndrewS » Thu Jun 14, 2012 12:50 pm
I guess on any device on which you'd want to use a SATA -> SDIO converter, it probably already has a USB port, and SATA->USB converters are much cheaper (and don't need a custom OS driver to be written).
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by lb » Sat Jun 16, 2012 12:53 pm
AndrewS wrote:Okay, I had a quick google... the reason that a SDcard -> SATA adaptor works, is because the firmware on the adaptor is emulating a SSD (solid state drive) not a HDD, i.e. the computer talking to the SATA still 'knows' it's talking to a flash-memory-device, not to a hard-drive-device (the way you write to a flash-memory-device is very different to the way you write to a hard-drive-device).
But there's no specs for a hard-drive-device being accessed via a SDcard interface (which only expects flash-memory-devices) which is why this would be impossible.


Sorry, but that's not correct at all - the SD interface works just like any other block device, e.g. a HDD. You specify a block number and read or write data, and that's all you need to know. The SD card's controller provides a block device abstraction for the flash memory.

IOW, an SD-SATA adapter is entirely doable, and would work without any issues.
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by AndrewS » Mon Jun 18, 2012 2:26 am
Oops, I stand corrected - I didn't realise it was the built-into-the-SDcard controller and not the OS-side driver that handled e.g. erase blocks :oops: Live & learn... :)
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by AndrewS » Mon Jun 18, 2012 8:19 pm
lb wrote:Sorry, but that's not correct at all - the SD interface works just like any other block device, e.g. a HDD. You specify a block number and read or write data, and that's all you need to know. The SD card's controller provides a block device abstraction for the flash memory.

It's just occurred to me - if it really is that simple, why is there so much problem with selecting the right SD card mode (etc.) in this thread: viewtopic.php?f=63&t=5057 :?:
You obviously know much more about this than me, I'm just curious...
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by lb » Mon Jun 18, 2012 8:32 pm
SD is still a pretty complex standard, despite the fact that it's a block device abstraction. That, and we don't have proper documentation for the SDHCI controller on the Pi, which seems to be quite buggy.
Posts: 193
Joined: Sat Jan 28, 2012 8:07 pm
by AndrewS » Mon Jun 18, 2012 8:42 pm
So how would a SATA HDD easily emulate this complicated standard? Return no-ops for everything?
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by holmez » Sat Jun 23, 2012 7:44 am
AndrewS wrote:But there's no specs for a hard-drive-device being accessed via a SDcard interface (which only expects flash-memory-devices) which is why this would be impossible.
(unless somebody created a SATA->SDIO card, and then created an entirely new SATA-SDIO driver, which simply isn't feasible) :ugeek:


I understand that this is how the xD cards work though.
Posts: 31
Joined: Sat Mar 31, 2012 6:39 pm
by Lob0426 » Mon Jun 25, 2012 4:50 am
You can buy a Compact Flash to SATA adapter that is sized like a 2.5" laptop drive. Then use a USB to SATA cable. A little expensive by the time you get all of the components together.

http://www.google.com/products/catalog? ... LEBEPMCMAQ
512MB version 2.0 as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1898
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
by AndrewS » Tue Jul 31, 2012 12:38 am
Just spotted this in another thread viewtopic.php?p=39417#p39417

So I guess in theory you could connect a SATA HDD to a SATA->USB convertor, and then connect that to this USB->SD adaptor, which might allow you to connect a HDD to the SD slot, as the OP originally asked for ;)
User avatar
Posts: 2776
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by drukar21 » Sat Dec 08, 2012 9:06 pm
So who had experience in using CF instead SDcard?
Posts: 4
Joined: Sat Dec 08, 2012 8:50 pm
Location: Minsk, Belarus