Linux Support for Hybrid Hard Drives?
christoofar asks: "HHDD (Hybrid Hard Disk Drive) technology has been receiving some buzz lately. The concept is not new, but Samsung has been working on a consumer version of HHDD that everyone can use. HHDDs are disk drives that carry onboard RAM (in this case, NAND flash) which is non-volatile and offers to speed boot times and writes to the disk. This carries enormous benefit to laptop users who need to keep their disk activity to a minimum in order to preserve battery life.
Given that Microsoft is adding support for Hybrid Hard Drives in their upcoming Windows Vista release, what efforts are being undertaken in the Linux realm to use this new storage technology?"
Why aren't the drives designed in a way that the drive technology worries about the details of retrieving and writing files, and sends them the way USB, IDE, SATA, or SCSI drives already do? Why would these drives need special drivers?
Saskboy's blog is good. 9 out of 10 dentists agree.
I'm sure they will be support for it by the time it is really *needed*. If it is an open and available spec, support could be coding before these things start becoming popular. Otherwise, as the linux community doesn't enjoy the advantages of MS, it will be reverse engineered after release as someone's need dictates. Honestly, how is this a useful question? These drives seem to have limited use outside of laptops and there shouldn't *Need* to be special support, as other posters have said. It should adhere to already existing SATA standards or what not and handle everything on the inside.
But this is non-volatile memory we're talking about, so when it writes to the cache it is done writing the data. Subsequently transferring the data from the flash to the disk is more akin to defragmenting than "completing the write."
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
Well, they only produce the isolinear chips for Star Fleet.
Seriously, the NAND flash memory stores the data immediately. It is a perfect write cache, because it does not forget the data. Almost perfect, because its write cycles are limited. But a more reliable file system would do the trick, too. Journaling is one way of making things more reliable. But, you have a good point. It is important that some data get written ASAP onto the medium. Unfortunately Linux file systems are not exactly the right choice if this is of importance for you. VMS would be a much better alternative. In order to utilize these hybrid disks it is also important to ensure that the important data gets written immediately, and that the hybrid disk knows which data needs to be cached in the flash memory. The disk allocation tables and directories are obviously important. But some databases might be important too. Bottom line is, the disks simply cannot be smart enough to handle all file systems and all applications. Therefore I agree with you, the whole thing is pointless. It would be much easier to back up some of the computers power lines with a battery, as part of the power supply, not as external UPS (stupid HV-LV-HV-LV conversion - HV=High voltage 110/230V, LV=3.3-12V). There are a few power supplies available which do exactly that (internal LV backup).
Right like, perhaps in addition to the kernel, or other essential boot files, it would also store the journal for journaled filesystems - it will cache the writes and commit them the next time that power supply and demand warrant. Consider a 1 Gbyte flash, in addition to your 100+ Gbyte drive, that's alot of non-volatile write cache.
If they don't even the writes across the media, bits will wear out faster at say the beginning of the memory. Go through a few million writes in a hurry. No thanks for me! Or am I wrong about that?
This could IMPROVE the situation you're talking about.
First of all, you know that right now your writes are cached in your computer's memory for up to 30 seconds before they are flushed to disk. This is done so that synchronous read calls are less disrupted by writes.
It's possible that this new technology would allow the OS to commit writes to disk immediately (or at least much sooner). The disk writes to NVRAM or flash, at which point it should be stable through power loss or crash. The disk doesn't need to commit it to the actual platter right away for it to be safely stored.
The question is not whether Linux will support the drive -- someone will eventually write one. The question is what files to put in there to make it boot faster. Perhaps should be done is to put the entire swap partition in there, and put those "hibernation" files in the swap. So it would resume fast, and would also make normal operations faster with the faster swap.
You shouldn't have to wait for the drives to come out. Laptop drive controllers can address a master and a slave, they just don't have a slave drive connected in normal usage. I was just looking for an adapter to let me put a pair of CF cards in place of a 2.5" hard drive. (I can only find the single-card version in a 2.5" form factor, all the dual-card ones are for 3.5" mounting.) I figure, put a solid-state card in one slot and a microdrive in the other, and I've got a hybrid-drive laptop, right?
I just got rid of an old toughbook cf-25 that would've been perfect for this, as the drive mounting is gel and would easily accomodate an oddly shaped adapter instead of a regular drive. Or for the truly insane, a CF card piggybacked on a regular 2.5" drive! All I need is the ability to home-brew those little flex cables, and I'd be in business.
With all of the improvements in RAM, on-die cache and processor speed, the bottleneck in performence is HD speed. Anything that helps boot that is a welcome improvement.
I'm not sure if write caching in the flash chips is a good idea...
Flash chips write at around 1Mb per second. Tops. Modern harddrives write around 50Mb per second. You'd need quite a lot of flash chips in parallel to top that.
Of course, you can cache acouple of writes on the laptop drive to prevent having to spin up the disk. But it is not going to be a speed issue.
I know this just adds another point of failure to the mix with the addition of flash memory. However, with the apparent improvements in the quality of flash memory, I would expect one of these drives to outlast a current laptop drive by at least 50%. (Note: this is just idle speculation, but I don't know of any solid real-world statistics on laptop hard drive lifespan. I'm guessing laptop makers don't want us to know, either.)
I think that the point of drivers is, therefore, valid. There needs to be some sort of intelligence behind this system to allow frequently needed files to be held in cache in order for this to work effectively. Sure, you could build a drive that could try this on its own, but odds are you would totally throw out any performance or power advantage by doing so.
I am feeling fat and sassy
Why not just do that now by adding the memory to your system(if it can handle it)? It shouldn't be to hard to setup a shell script that will load a portion of your hard drive into memory. I wonder if you could setup unionfs to write the changes to the hard drive? You could probably setup proccess acounting or something to track program usage and load only the most commonly used programs. But, to get to the point, the value of the flash ram is that you can accelerate boot time by having the data already in the cache waiting when you boot. You save power by not having to spin the disk all the time. And you eliminate the risk of doing so with volatile memory. Your Idea about partitioning is good though. It'd be just like when we all had to make sure the boot partition was within the first 1024 cylinders. Nice.
So I see a completely different picture here. There are a lot of files on the HDD that are never rewritten. System files, etc. This is where having hybrid drives really helps. Put the main boot files, executables and libraries which are accessed when staring things up in there. So no fast saves, but no load time.
If I understand Dirac correctly, his meaning is this: there is no God, and Dirac is his Prophet. -Pauli
The SYNC command forces the system to flush all buffers to disk. Once it returns, you know that all currently cached data has been at least scheduled to be written to disk. (current documentation claims that it doesn't return until the data has actually been written). Once data goes to the HD, it may still take a second or more for it to clear out of the internal drive cache.
for older kernels, you can also run the 'update' progrem which will periodically flush the cache. (RH5.2 probabably was old enough to need this). On the most recent kernels, this capability is now supposed to be built in.
Free Software: Like love, it grows best when given away.
Windows doesn't open executables for writing when you run them. In fact, when you run a program, it prevents writing entirely. Windows loads executables through the memory-mapped file interface. It does this so it can share code pages between different processes, and get away with paging out part of a program without actually writing to the page file first.
Windows programs that modify their own EXE have to do some crazy tricks. While you cannot modify or delete a running program, you *can* rename or move one. You rename yourself then you make a new copy of yourself with the desired changes. When you're done, you execute the new copy and terminate yourself so that the new copy can delete you.
Melissa
"Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
I'd like to see linux have support for (and have hardware makers create) what SUN used to call NFS Accelerators. Basically add-on NV (or battery backed) memory sufficent to transparently cache write information. On my laptop I'd put it in my ExpressCard(tm) slot.
Then again I have been considering using an SD type card to contain the journal for my ext3 file system.
Actually, that combination; an ext3 file system in full data write-back journal mode, a solid-state flash device for that journal, and a "large" flush interval (more than the default five seconds) could accomplish essentially the same thing.
I wonder what the flash wear rate would be...? Do they make NAND SD cards?
(etc. od nausium. ahmen.)
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
Seeing as I can't buy one of these drives from my usual shopping websites, why would I care? Obviously the technology is very new. I would much rather let Samsung and Windows sort out all the defects at their cost and embarrassment than risk buying a kludgey piece of hardware for my linux computer.
If you'd read the topic properly, you'd have seen we're talking about non-volatile NAND RAM of some sort. Hence, the extra speed does NOT come at a cost to data integrity!
The simple solution is to just make a specific part of the hybrid drive be RAM based. It would default to being sectors starting at sector 0. Then the method to change it would be to partition the drive with a special partition code for a partition that will change the sector locations to be in RAM to what they are for that partition, up to the end of the partition or the RAM capacity, whichever is first. Then RE-partition it back to what the OS needs, which will not make changes on the hybrid drive (it will just update the RAM location when a partition table is written that includes the special partition type code). Alternatively, bypass the partition program's overlap inhibit and let the specially coded partition overlap whatever is being RAM-ified to avoid ever being in a state where you have an unusable partition table. BSD and Linux users can just use ordinary tools after reading the directions on how to do this. Windows users might have to get a special tool or a modified partitioning program (I'm sure all the commercial ones would pick up on this quickly).
The hybrid drive controller would simply monitor writes to the partition table and check for the special code in a partition entry. If no code, do nothing special (but of course, write the data if partition table writing is not otherwise inhibited). If the code is present, check that partition table entry for sanity, and if valid, perform the steps needed to make the change (lock RAM, store RAM data to platter in old location, fetch new location data to RAM, save new location sector numbers, unlock RAM).
The driver won't need to know because it will still just behave as usual, issuing standard commands for its drive interface type (SCSI, IDE/PATA, SATA) for any sector. So the driver won't need to be changed.
This method won't have to rule out also including other methods that can do the deed by other means. I would suggest a jumper spot on the drive hardware to inhibit changes so you can be sure your changes stay permanent regardless of software upgrades, installs, viruses, trojans, etc.
now we need to go OSS in diesel cars
Its not a hybrid drive, but the clever one I saw was a hard disk-backed 2 gig "solid state" drive. It was a board in a 1U rackmount box with 2 gigs of regular ram, a battery and a 2 gig hard disk.
All reads and writes are to the ram. The hard disk isn't even running. When power is lost for more than 15 seconds, the hard disk spins up and the contents of the ram are written out to disk. When power comes back on, the drive spins up, the contents of the disk are loaded back in to ram and operation resumes.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
Maybe someone doesn't want their operating system on the RAM-ified part. Maybe they want swap space there instead. Maybe they want the reserved journal space of a journaling filesystem that is frequently updated to be there. Of course all of these needs could be addressed in some way (at least I know some journaling filesystems let you put the journal in a different partition). You'd have to choose which sectors (don't think in cylinders anymore, it's all fake anyway) would be RAM-ified in a way that would fit various needs in various operating systems, including that one with the largest market.
now we need to go OSS in diesel cars
Most common source of data loss.
Laptop hard drives: the new floppy
There are no trails. There are no trees out here.
Flash memory lasts quite a while - even longer than a hard drive, from what I've heard.
The Mybrid drives load commonly-used files into their flash memory - not only for faster access, but also to prevent wear-and-tear on the hard drive's cylinders.
Whatever is in this flash memory is already committed to the flash memory, and it'll stay there until it's overwritten with new data.
Solid state memory is still a little too expensive to be able to buy a 250GB drive. These Hybrids kind-of alleviate the problem by being half-solid state and half-mechanical. They provide the benefits of solid state - high speed and durability - with the benefits of a mechanical drive - low price and high amount of storage.
www.linuxpenguin.net
Here's the description:
"Memory Technology Devices are flash, RAM and similar chips, often used for solid state file systems on embedded devices. This option will provide the generic support for MTD drivers to register themselves with the kernel and for potential users of MTD devices to enumerate the devices which are present and obtain a handle on them. It will also allow you to select individual drivers for particular hardware and users of MTD devices."
It's got options for a whole bunch of things, such as "FTL (Flash Translation Layer)", "NFTL (NAND Flash Translation Layer)", and "INFTL (Inverse NAND Flash Translation Layer)".
Given that it says the hard drives will use "a one-gigabit OneNAND flash chip" (according to the article), it sounds like it will work.
www.linuxpenguin.net
i use a 12 hp dot matrix and stone tablets [modified] ive had some of my bakups for 15+ years and no deterioratin equivalent to 100000rpm hdd read 35000 write
how about 'boot state' recorder to flash.. as in, unless you install software or add hardware, your system memory at bootstate can be written to a flashchip the same size as your ram, and you can boot, or reboot, as fast as you can re-dump the chip into ram.
add new hardware? fine, as soon as yer system is booted for real, save it to the bootchip.
every day http://en.wikipedia.org/wiki/Special:Random
Pretty much nobody wilfully uses a flash medium for swap space or transaction logs. Remember, each sector is only good for a limited number of write cycles, so they're only well suited for mostly read-only data (like system binaries or audio/video playback).
Cameras resort to using flash as a space and power tradeoff, and they can only get away with it because users don't fill and erase the same card ten thousand times.
The HD is ofcourse used for other things as well... it has to get done writing something and then seek.. yada yada...
/. had an article on why vista won't suck.. and the ability to use a usb thumb drive for system purposes was mentioned.
/boot be flash.. I might make some databases be part flash...
I'd think that most email systems are multi-threaded so that a mail message waiting to be put on disk wouldn't block another one from comming...
I would think that the flash would be used for moderately frequently read items... (because superfrequently read stuff would be in RAM already, and stuff that isn't read often.. we could wait for... unless it's a critical low latency item...
So, for those things infrequently read, but needing low latency, the first part of the file ( or most critical to be read) could be stored in the flash section... and the hd could fill it's cache with the rest of the file between seeks, or just go and read the file...
I though flash was inappropriate for swap.. because of it's limited writability.. however, there filesystems for flash take this into account.
In linux, I might make
I'd have to say that the whole hybrid drive could be done without anymodification of the drivers...
The hard drive controler would do analysis of what files get changed little... er sectors or what-not.. and read frequently... it would then copy the files, or initial parts of the files to flash. I would think that it would be more prudent to "copy" rather than "move" the part of a file... just because it makes error recovery a bit easier.
I'd just like to get a hard drive that takes sticks of sdram and has a battery backup... so that when the power goes off, it sits there still spinning writing the ram to disk and safely parking it's heads before shutting down.. it wouldn't take that big of a battery!
Remember that our 3 1/2 inch drives are half height!!! I had a 300mb scsi disk that was full height.. and I asked my dad... why is this double height?! and I was told... back in the day son...
anyway... we could have hd's with ram sticks, battery, and cooling solution if we just let the dogs be a bit bigger.
-AP
Please use [ informative / summarizing ] SUBJECT LINES
Flame me here
As long as your ram has a battery, no worries.
Some ( all? ) SAN devices have write cache, as well as read.
---- Booth was a patriot ----
I would think the easiest way to accomplish the goal of HHDDs is to simply have 2 drives, one made of Flash RAM and one traditional.... You use the flash drive for your OS and programs, and then store all your data on the traditional drive.
"A truly wise man realizes he knows nothing."
Most people are no longer aware that a regular CD-ROM is half-height for a 5.25" disk bay. About the last thing that I've seen that took a full-height 5" slot was 8mm tape drives.
Free Software: Like love, it grows best when given away.