Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

With mechanical storage, the low level disk operation seek() causes the hard drive heads to move to a location so that they are ready to read from a given area of the disk.

With solid state storage, such as SD cards, flash drives and SSDs, there are no moving parts of the hardware, only electrical signals.

Assuming a NAND non-volatile RAM technology is the basis of the hardware, what function does a seek() actually perform at the hardware level for such a device?

Just to be clear, I already know that the following happens:

  1. Userspace program calls seek() system call or the OS-specific equivalent

  2. Kernel interprets system call and sends a message to the SATA controller to seek

  3. SATA controller interprets the command and tells the attached disk device, which is solid state, to seek (or maybe it's smart enough to recognize that it's solid state and doesn't even tell it??)

  4. What I don't know is, solid state device does ??? with the command to "seek".

If there are details that would depend on the operating system, assume a relatively standard desktop version of GNU/Linux with kernel version 3.2.

share|improve this question
2  
I think it does a big fat NOP. Joke apart, if I were an SSD drive, I'd do some "precautionary" reading into the cache, to make sure things happen as quick as possible. But as this is just a vague guess at something I don't have the slightest idea about, so take it with a grain of salt... –  ppeterka Mar 13 '13 at 13:34
    
I don't think "seek" operations are used in low-level storage interface anymore. If they did exist, they'd just change the stored position for the next I/O operation. –  David Schwartz Mar 13 '13 at 13:46

1 Answer 1

up vote 4 down vote accepted

if you're referring to linux, seek still moves ahead the required number of bytes. For example:

dd if=/dev/zero of=/dev/sdb bs=512 SEEK=2

Will start copying zeros 1024 bytes into the start of a disk, it doesn't matter if sdb is an sd card or ssd drive, because of a little thing called abstraction the actual mechanics of this is taken care of at a lower level.

Update

I see what you're saying now. Following my sd card example, flash memory uses something called pages, and the pages come in a particular size. when a seek comes, the OS sends the command to the sd card/ card controller to move to a certain page for reading and writing.

share|improve this answer
    
I'm aware that it moves ahead in the file logically, but aside from the logical impact on the file in terms of abstract "blocks", does the hardware do anything different when it's actually told to seek? You can look at the lseek() system call as a specific example if needed. I know that this system call not only does the logical seeking but also causes the HDD heads to move when dealing with a mechanical disk, so what does the SSD do? –  allquixotic Mar 13 '13 at 13:38
    
@allquixotic I've updated my answer. –  BigHomie Mar 13 '13 at 13:42
    
Even on a physical spinning hard drive, the OS sends a command (a SCSI command, ATA/SATA command, or USB mass storage command) to drive to get LBA X. The host doesn't actually end up telling the drive to move the head on any level, the drive's firmware does that. If you want some idea of a what an SSD firmware does in response to storage commands, look into some of the specs for the Jasmine OpenSSD project if you can find them, some of that explains things on a very low level. –  ultrasawblade Aug 15 at 11:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.