Slashdot Mirror


Write Bits Directly Onto a Hard Drive Platter?

kidcharles writes "I'm working on a project that requires writing bits to a magnetic hard drive platter in a completely controlled fashion. I need to be able to control exactly where 1s and 0s will appear physically on the platter. Normally when data is written to a drive the actual bits that get written are determined by the file system being used, as modified by whatever kind of error handling the drive itself is using (e.g. Reed-Solomon). All of the modern innovations in file systems and error handling are great for reliable and efficient data storage, but they are making my particular task quite daunting. My question for Slashdot: is there a way to get down to the 'bare metal' and write these bits? Any good utilities out there to do this? Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

578 comments

  1. magic marker by Rivalz · · Score: 5, Funny

    It works for me. http://www.staples.com/Staples-Dry-Erase-Markers-Chisel-Tip-Black-4-Pack/product_607101?cmArea=FEATURED:SC1:CG11:DP1101 Now that someone has said it no one else can be a smart ass and they have to be informative.

  2. May I suggest by Blazarov · · Score: 2, Funny

    May I suggest a magnetic needle and a steady hand? http://xkcd.com/378/

    --
    Regards, Boyan
  3. Sure by Jurily · · Score: 5, Informative

    Just make your own controller chip for the drive.

    1. Re:Sure by Anonymous Coward · · Score: 2, Interesting

      Agreed. I would find is difficult to believe there is a practical use for this, but if there is an actual requirement to control zero and ones in specific tracks/sectors, you might as well build your own chip for a drive. :)

      If the solution sucks that maybe they're trying to solve the wrong problem. :)

    2. Re:Sure by sznupi · · Score: 1

      Anybody actually does this or is it mostly about using, say, an ARM controller; almost off the shelf?

      --
      One that hath name thou can not otter
    3. Re:Sure by Anonymous Coward · · Score: 0

      I think parent actually meant "program your own FPGA for the drive"

      http://en.wikipedia.org/wiki/FPGA

      It's not "good utilities" as the poster asked, but it's the closest (and relatively, easiest, as I'm an EE. CS might just find it easier to hack the firmware) thing to do to achieve what the poster want.

    4. Re:Sure by amn108 · · Score: 4, Informative

      Modern drives come with their own on-drive controllers, as far as I know. Chaining another controller on top will not give you any power to override the on-drive controller behavior. If the on-drive controller makes its own decisions on where and how to write data, your custom controller will not be able to override these decisions, I am afraid.

    5. Re:Sure by adolf · · Score: 4, Insightful

      A whole chip? Really? That sounds hard.

      Just Ebay an old 20MB Seagate ST-225 MFM drive, and write whatever bits you want.

      It doesn't know any better.

    6. Re:Sure by Smidge204 · · Score: 5, Insightful

      The custom controller would REPLACE the the on-drive controller, not sit on top of it.

      =Smidge=

    7. Re:Sure by amn108 · · Score: 1

      Right. Might work then. However, don't those on-drive controllers use very proprietary hardware interfaces?

    8. Re:Sure by Anonymous Coward · · Score: 0

      That's where the oscilloscope and logic analyzer and signal generator comes in. Get ready to pay, big time.

      Unless you can get your hands on some excellent documentation. Then you can code the FPGA and have it work without any testing, in theory that is.

    9. Re:Sure by beh · · Score: 1

      That doesn't answer the next question, though - when was the last time you saw a SATA to MFM or even USB to MFM adapter? ...or a non-ISA card that can still use an MFM disk?

      Mayhe he needs a whole machine from the XT/AT/386/486 era...

    10. Re:Sure by Jim+Hall · · Score: 5, Interesting

      A whole chip? Really? That sounds hard. Just Ebay an old 20MB Seagate ST-225 MFM drive, and write whatever bits you want. It doesn't know any better.

      Or, the submitter could contact Seagate or another drive manufacturer and ask what it would take to get a drive with special firmware that let him write 1's and 0's directly to the drive wherever he wanted. Basically, remove the intelligence on the drive.

      It's not that impossible for drive manufacturers to do things like this for you, if you have the $$ to pay for it. I don't know what the cost would be, especially since he's really only [probably] looking for a few drives for this project. If it's grant-funded research, the grant would pay for it. If it's an independent project of some kind, he's in for a surprise.

      I took a behind-doors tour of a major drive manufacturer a few years ago. During our visit, we were able to visit with engineers - one of whom was head of the firmware engineering team. He told us lots of stories about the firmware requests they've fulfilled. One example was a customer who supported lots of old PBX systems. These PBX systems ran software from a hard drive, but due to the age the system only supported drives up to (around) 200MB. Nobody made drives that small anymore, so this drive manufacturer re-wrote the firmware for them ($$) so a 120GB drive (the smallest they made at the time) would only recognize & address the first 200MB.

      So yeah, I'm sure a drive manufacturer like Seagate could write custom firmware for him that would meet his project needs.

    11. Re:Sure by Anonymous Coward · · Score: 0

      i think there are data recovery tools that let you connect wiring directly to the heads and control them

    12. Re:Sure by Alien+Being · · Score: 1

      He might be able to find a PCIISA bridge.

    13. Re:Sure by Lumpy · · Score: 1

      What fool would use a whole PC to do this? use a pic or ardunio.

      --
      Do not look at laser with remaining good eye.
    14. Re:Sure by vtcodger · · Score: 2, Interesting

      Does is have to be a hard drive? The Apple IIe was a wretched computer with awful software, but it had a floppy controller that was possibly the cutest electronic device ever made. It's been an awfully long time, but my recollection is that it was built from a handful -- six or eight -- of TTL chips and that not only COULD one control exactly what was written where in software, one HAD to control what was written where in software.

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    15. Re:Sure by CharlieG · · Score: 4, Insightful

      That was my first idea too "Find an old MFM/RLL drive, and have at it" - then I realized, "You know, I'll bet that more than 1/2 of the readers of /. don't even remember them"

      --
      -- 73 de KG2V For the Children - RKBA! "You are what you do when it counts" - the Masso
    16. Re:Sure by julesh · · Score: 1

      I took a behind-doors tour of a major drive manufacturer a few years ago. During our visit, we were able to visit with engineers - one of whom was head of the firmware engineering team. He told us lots of stories about the firmware requests they've fulfilled. One example was a customer who supported lots of old PBX systems. These PBX systems ran software from a hard drive, but due to the age the system only supported drives up to (around) 200MB. Nobody made drives that small anymore, so this drive manufacturer re-wrote the firmware for them ($$) so a 120GB drive (the smallest they made at the time) would only recognize & address the first 200MB.

      That kind of shit happens all the time. For a while back in the early 2000s, some drive manufacturers were shipping drives with jumpers that would tell the firmware to report the disk as being 32GB, because there was a relatively common PC BIOS that crashed with any larger disk.

    17. Re:Sure by julesh · · Score: 0, Flamebait

      The Apple IIe was a wretched computer with awful software [...]

      Which just goes to show people shouldn't be so surprised by the iPad...

    18. Re:Sure by Gordonjcp · · Score: 2, Insightful

      but if there is an actual requirement to control zero and ones in specific tracks/sectors, you might as well build your own chip for a drive.

      Not to mention that disks haven't actually written "zeros and ones" as such for at least 15 years, which is why a single pass of /dev/zero will wipe a recentish disk beyond recovery.

    19. Re:Sure by drachenfyre · · Score: 1

      Remember? heck, I even had a perstor controller so my 40 meg mfm drive was running as a 76 meg drive. I even had two of em in an external enclosure.

    20. Re:Sure by lavaboy · · Score: 2, Funny

      damn. I was going to say "Call Woz."

      --
      Steve -- If you have to call it a system, you don't know what it is.
    21. Re:Sure by trejrco · · Score: 1

      You plug that 20MB MFM HDD into an RLL controller, and presto - you know have a 30MB HDD. *BAM*. /feeling old now.

    22. Re:Sure by TheLink · · Score: 3, Informative

      But you couldn't control exactly what was written with the Apple II drives.

      IIRC the spec was you could not expect to _reliably_ write a bit stream that has more than two zeroes in a row. In practice you could usually get away with three zeroes in a row. You had to do stuff like write sync streams e.g. 11111111001111111100111111110011111111001111111100. Which are basically 5 x 10 bits of 1111111100.

      You could control the drive head too. You could even move the head in sub-track increments - e.g. half track. However, tracks have to be at least a full track apart to be reliably read/written.

      All these is why I find the submitter's request rather strange. When you get down to the low level details, there is no such thing as exact.

      Even if you are writing one bit on the entire platter with a huge magnet :).

      So I'm curious on what he's really trying to achieve.

      --
    23. Re:Sure by iamhassi · · Score: 1

      "when was the last time you saw a SATA to MFM or even USB to MFM adapter? ...or a non-ISA card that can still use an MFM disk?"

      author doesn't say if he needed this on a modern PC or not, just that "I'm working on a project that requires writing bits to a magnetic hard drive platter in a completely controlled fashion"

      It's pretty clear this can't be done within Windows, so I'm sure the author doesn't mind using a 20 yr old 486 to complete the task. It is a solution to the question asked.

      --
      my karma will be here long after I'm gone
    24. Re:Sure by iamhassi · · Score: 1

      "It's not that impossible for drive manufacturers to do things like this for you, if you have the $$ to pay for it."

      Last sentence: "Obviously a free and open source solution would be preferable, but I'm open to anything at this point." Pretty clear submitter doesn't want to pay for it.

      --
      my karma will be here long after I'm gone
    25. Re:Sure by iamhassi · · Score: 1

      "The Apple IIe was a wretched computer with awful software,"

      What? The Apple IIe was very popular at the time, I guess everyone is entitled to their own opinions but I've never heard anyone describe a 80s Apple as "wretched" or "awful".

      --
      my karma will be here long after I'm gone
    26. Re:Sure by Anonymous Coward · · Score: 0

      I use /dev/zero all the time before reinstalling Windows, probably unnecessary with XP and up, but old Win98 would insist on using the old directories even after running fdisk. Heh, the captcha was "contempt"

    27. Re:Sure by jspenguin1 · · Score: 1

      Was it an ATA drive? Did it not support a Host Protected Area? With HPA, you can set the drive to whatever size you want. Also, you could probably get an adapter and use a 128MB CompactFlash card.

    28. Re:Sure by idontgno · · Score: 2, Informative

      You have a 30 MB HDD until you realize that your MFM HDD wasn't being sold as an RLL HDD because it failed RLL density checks at the factory, and your bits start decaying within hours or days of writing them.

      Yes, this is the bitter voice of experience. An ST-255 wasn't always the equivalent ST-238.

      --
      Welcome to the Panopticon. Used to be a prison, now it's your home.
    29. Re:Sure by Anonymous Coward · · Score: 1, Funny

      > Not to mention that disks haven't actually written "zeros and ones" as such for at least 15 years

      Roight--modern drives go to ELEVEN!

    30. Re:Sure by Pentium100 · · Score: 1

      Remember? I have one such drive (though somebody removed a chip from it before giving it to me). I still hope that one day I can buy a similar drive, replace the electronics on this one and bring this drive back to life.

    31. Re:Sure by Stewie241 · · Score: 1

      Then the question becomes... how do you know it worked?

    32. Re:Sure by Anonymous Coward · · Score: 0

      "It's not that impossible for drive manufacturers to do things like this for you, if you have the $$ to pay for it." Last sentence: "Obviously a free and open source solution would be preferable, but I'm open to anything at this point." Pretty clear submitter doesn't want to pay for it.

      Pretty clear you can't fucking read.

    33. Re:Sure by Simon80 · · Score: 1

      I wiped a recent-ish disk with /dev/zero, and received a scare when it "went away" after the command completed. However, after a reboot (it was an internal drive), it showed up just fine. All of this talk about drives being mysterious and finicky sounds like uninformed scaremongering to me.

    34. Re:Sure by operagost · · Score: 2, Insightful

      The Apple IIe was a wretched computer with awful software

      You know, I'm far from an Apple fanboy, but I used the Apple IIe and by the standards of the day, it was clearly not a "wretched computer with awful software". It had good graphics, a built-in ML monitor and BASIC, few quirks, and a low enough price that it dominated the USA public school system. The C64 was a better value, but it had its own problems (like the glacially slow floppy drive).

      --

      Gamingmuseum.com: Give your 3D accelerator a rest.
    35. Re:Sure by number11 · · Score: 1

      That was my first idea too "Find an old MFM/RLL drive, and have at it" - then I realized, "You know, I'll bet that more than 1/2 of the readers of /. don't even remember them"

      Remember them? I think I've got a pile of them somewhere, just waiting for them to come back into fashion. And a few of those old WD controllers they used. But maybe it's time to throw out the shoebox labeled "MFM CABLES". Hmm.. $35 on eBay for a used ST225, I guess I need to wait for the pile to appreciate some more.

      Whoever said "find an old 486" isn't really in sync, 486s are way too modern.

    36. Re:Sure by drachenstern · · Score: 1

      As a dual EE CS student, I can say that it's definitely RAD faster to hack the firmware, even if the more reliable is to build a FPGA... pinouts tend to be tricky for keyboard jockies...

      --
      2^3 * 31 * 647
    37. Re:Sure by MoralHazard · · Score: 1

      ...and I am afraid that you misunderstood the original poster. The rest of us seem to agree that he's talking about replacing the existing controller, not "chaining another controller on top", whatever the hell the means. You trolling, or what?

    38. Re:Sure by drachenstern · · Score: 1

      I suppose if you can read what you wrote...

      --
      2^3 * 31 * 647
    39. Re:Sure by hondo77 · · Score: 1

      The Apple IIe was a wretched computer with awful software...

      Compared to which of its contemporaries?

      --
      I live ze unknown. I love ze unknown. I am ze unknown.
    40. Re:Sure by srpape · · Score: 1

      He wasn't talking about making the drive no longer functional by overwriting it with zeros...

      He was talking about a pass of /dev/zero wiping a drive, making it impossible to recover the original data.

    41. Re:Sure by pnutjam · · Score: 1

      what do they write then, it may not be a numerical 1 or 0, but it has to be an equivalent binary status, right?

    42. Re:Sure by Sancho · · Score: 1

      Not to mention that disks haven't actually written "zeros and ones" as such for at least 15 years, which is why a single pass of /dev/zero will wipe a recentish disk beyond recovery

      I don't see how that follows. Could you elaborate?

    43. Re:Sure by fbjon · · Score: 1

      which is why a single pass of /dev/zero will wipe a recentish disk beyond recovery.

      That doesn't sound right at all. The only difference between between wiping /dev/sdax and /dev/sda is which sector you start in. Starting in sector 0 (/dev/sda/) simply means overwriting the boot sector (usually MBR), which means you lose the primary partition table as well. Any partitioning software can trivially create that again.

      You are right that disks don't simply write the bytes you send it onto the disk, but you cannot access or wipe the physical structures through any /dev/* trickery.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    44. Re:Sure by amn108 · · Score: 1

      No not trolling, I obviously thought he was referring to controller cards - those you insert into extension slots. Since hard drives have on-board controllers, no matter how you look at it, a controller card will have to be "chained" to it, since both are obviously present.

    45. Re:Sure by Hyppy · · Score: 1

      Does my 1.44MB floppy count?

    46. Re:Sure by Gordonjcp · · Score: 1

      You are right that disks don't simply write the bytes you send it onto the disk, but you cannot access or wipe the physical structures through any /dev/* trickery.

      Yes, it probably wasn't clear that I meant wiping off the data. You can't mess about with the "internal" stuff on the disk, because the controller won't put data there without magic firmware.

    47. Re:Sure by fbjon · · Score: 1

      Ah I see, I thought you meant the disk itself would become unusable.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    48. Re:Sure by Stewie241 · · Score: 1

      But that will only tell you that the data actually did get stored and can be read. It will not tell you that the data actually got stored where you wanted it to get stored.

      I could write something that would have a nice GUI interface that would allow you to select a location on the disk and write a 1 or 0 to it. It would also allow you to read from a selected location. As long as in my code I use a predictable mapping to a location somewhere on disk, the actual user has no way of knowing it is actually doing what the code says it is doing.

    49. Re:Sure by Simon80 · · Score: 1

      On looking at his comment again, I have to agree with you, though his comment still doesn't make sense to me. It seems like he's arguing that one pass of /dev/zero is sufficient as a secure erase technique, but that doesn't jive with my perception of what the popular wisdom on that is. I use the phrase popular wisdom deliberately, since nobody ever has a credible tests to illustrate what is sufficient, and there is always the suggestion that the government could have some kind of secret data recovery capability beyond the publicly known state of the art.

    50. Re:Sure by keeboo · · Score: 1

      Does is have to be a hard drive? The Apple IIe was a wretched computer with awful software, but it had a floppy controller that was possibly the cutest electronic device ever made. It's been an awfully long time, but my recollection is that it was built from a handful -- six or eight -- of TTL chips and that not only COULD one control exactly what was written where in software, one HAD to control what was written where in software.

      I don't think that's much different from PC-like floppy drives, the difference being that the (x86) PC had a floppy controller which limited read/write to sectors and MFM coding.
      Amiga diskette drives were almost the same as the PC ones (except for the disk-detection signal, which you could hack and convert a PC drive to an Amiga one), and Amigas wrote pretty much whatever you wanted into the disk (AFAIR the modulation was software based) and not even the index signal was used (except when r/w FAT disks).

    51. Re:Sure by srpape · · Score: 1

      Supposedly, with modern hard drives, the need for repeatedly overwriting data is gone.

      A single pass with /dev/zero should make the drive unrecoverable. There was a whole challenge about it, though it's now ended and was never accepted.

      From http://forums.techpowerup.com/showthread.php?t=79982

      Q. What is this?

      A. A challenge to confirm whether or not a professional, established data recovery firm can recover data from a hard drive that has been overwritten with zeros once. We used the 32 year-old Unix dd command using /dev/zero as input to overwrite the drive. Three data recover companies were contacted. All three are listed on this page. Two companies declined to review the drive immediately upon hearing the phrase 'dd', the third declined to review the drive after we spoke to second level phone support and they asked if the dd command had actually completed (good question). Here is their response... paraphrased from a phone conversation:

      "According to our Unix team, there is less than a zero percent chance of data recovery after that dd command. The drive itself has been overwritten in a very fundamental manner. However, if for legal reasons you need to demonstrate that an effort is being made to recover some or all of the data, go ahead and send it in and we'll certainly make an effort, but again, from what you've told us, our engineers are certain that we cannot recover data from the drive. We'll email you a quote."

    52. Re:Sure by GWBasic · · Score: 1

      Or, the submitter could contact Seagate or another drive manufacturer and ask what it would take to get a drive with special firmware that let him write 1's and 0's directly to the drive wherever he wanted. Basically, remove the intelligence on the drive.

      Or just find out if there are test codes / commands that do the same thing.

    53. Re:Sure by dzfoo · · Score: 1

      >> The C64 was a better value, but it had its own problems (like the glacially slow floppy drive).

      And the cheap power supply that had the knack of burning after a few hours of continuous use.

            -dZ.

      --
      Carol vs. Ghost
      ...Can you save Christmas?
    54. Re:Sure by Gordonjcp · · Score: 1

      To answer your and the previous poster's question, the drives write something more like QAM to the disk - one "bit time" may contain several bits encoded. When you read the drive back you're looking at pulses of varying phase and frequency.

      If you wrote all zeros to an MFM drive you'd see a recognisable pattern that would be the same every time. If you wrote a sector of all zeros to a modern drive twice, you'd see two completely different patterns. Both would resemble noise ;-)

    55. Re:Sure by Underfoot · · Score: 1

      I had an Apple II+, and I loved it. It's where I cut my teeth as a programmer.

      --
      I mentioned tinker-toys once in a post - now I'm modded down for life.
    56. Re:Sure by Anonymous Coward · · Score: 0

      I would find is difficult to believe there is a practical use for this

      The practical use that I can see for needing to do something like this would be if the poster is researching data recovery techniques, either due to physical damage to the disk or to the data being erased in some manner. If he's examining the actual HD plates being used, he obviously needs to know the exact spot on the disk to look for the data that he put there. If the controller is able to map logical sectors to different physical locations on the disk, it would be the proverbial needle in a haystack situation.

    57. Re:Sure by multipartmixed · · Score: 1

      A PC-XT MFM controller like the ST-506 will work just fine in a 486, and most 486s came with a few ISA slots.

      Hell, you can probably find Pentium-III machines with ISA slots at the local flea market.

      --

      Do daemons dream of electric sleep()?
    58. Re:Sure by marcosdumay · · Score: 1

      It may be easier to just reprogram the controler.

    59. Re:Sure by FiloEleven · · Score: 1

      Last part of last sentence:
        "Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

      Pretty clear submitter will take what he can get.

    60. Re:Sure by marcosdumay · · Score: 2, Insightful

      Some people think that is ettiquete for posting on Slashdot. This site is inherently linked to free software.

    61. Re:Sure by Anonymous Coward · · Score: 0

      My thoughts exactly... Too bad he'll probably have no ISA slot for the controller.

      Wait what was ISA again? :)

    62. Re:Sure by TekPolitik · · Score: 1

      It may also be that the question is wrong - it certainly lacks internal consistency, talking in the opening about physical position on the platter and then going on to talk about the file system. If you want to literally control the physical position on the platter, the file system is the very least of your problems. On the other hand if all you want is to bypass the file system, it's a simple matter (on anything with a UNIX heritage) of writing to the right device files.

    63. Re:Sure by Mal-2 · · Score: 1

      Not RLL, FM/MFM only. RLL converts a string of bits into a longer but physically easier string of bits so it can pack in more effective density. Unfortunately, you've already lost control of the bits on the drive at this point.

      Mal-2

      --
      How is the Riemann zeta function like Trump rallies? Both have an endless number of trivial zeros.
    64. Re:Sure by klui · · Score: 1

      These PBX systems ran software from a hard drive, but due to the age the system only supported drives up to (around) 200MB. Nobody made drives that small anymore, so this drive manufacturer re-wrote the firmware for them ($$) so a 120GB drive (the smallest they made at the time) would only recognize & address the first 200MB.

      What they really did was use MHDD to trim the drive's size.

    65. Re:Sure by nerdbert · · Score: 1

      Nobody in the drive industry has built a stand-alone controller for the last 8 years (longer in some cases). These days all the controllers are integrated into SoCs that consist of the controller, the read channel, SATA (these days), and memory controller. You can't chain controllers nor easily overwrite the ROM code for them.

      Further, the software required to control the read channel part of the SoC is very difficult to write, so even if you could manage to get to the controller knowing what to control to get a proper write is very difficult without documentation.

    66. Re:Sure by amn108 · · Score: 1

      As much as I would agree with you on futility of chaining controllers (does not solve the problem in the question), I was referring to standalone controller cards which function in addition to whatever logic comes with the drive. These type of standalone controllers are very much produced today, e.g. by Adaptec:

      http://www.adaptec.com/en-US/products/

    67. Re:Sure by amn108 · · Score: 1

      This is the most useful answer I have read on this whole discussion.
      It solves the asked question in the most acceptable manner (within the constraints defined in the question).

      Indeed, old drives do not have onboard controllers, and so there is no logic to override.

      However, I would say one perhaps would still need some sort of controller to actually write the data to the drive, and then we are back to the part of problem - can one override this particular controller behavior, throwing out error correction, data distribution algorithms, etc?

    68. Re:Sure by nerdbert · · Score: 1

      You guys are somewhat right. Bits ARE written to disk as 1's and 0's logially, but as +1 and -1 in a magnetic sense since the direction switches as you go over each magnetic pole. Note that those signals interfere and destroy each other's signal if they get too close, a phenomenon known as high frequency zeros in the business -- write a 101010 pattern to the disk and if you put those bits too close together you get 000000 back out when you read it.

      The UBD (user bit density) is the number of bits stored in an area of 50% of the width of an isolated pulse.

      Old drives (pre-'96 or so) used peak detectors to find patterns. There we used high frequency "boost" or pulse slimming to read 1s and 0s and get around the high frequency zeros problem, but the UBD was limited to less than 1.

      About '95 or so IBM introduced a much more complicated technology called PRML, for Partial Response, Maximum Likelihood detectors. These use intersymbol interference in a controlled way using things like Viterbi detectors and even more complicated backends. This more sophisticated technology allows drives to get UBDs to above 3+. It's not totally unlike QAM, but most of the details are pretty different. Besides, when I was doing QAM systems the data rate (not the carrier frequency) is much, much lower than it is in a drive, so it was a heck of a lot easier to do.

      Oh, and writing exactly what you want to a drive is almost impossible anyway. You remember that PRML stuff? That requires coding, meaning that only certain patterns are allowed (this has to be a DC-neutral system). Further, in the more modern systems parity bits are written to the disk, special radomizers are added to improve coding efficiency and spread the spectrum, etc. You could no more write an arbitrary pattern to the disk than you could use a soldering iron to patch an i7's microcode.

    69. Re:Sure by Anonymous Coward · · Score: 0

      As a kid, I cut my teeth on a 30 MB MFM. I thought we were hot stuff back then, when we upgraded our IBM PC 5150 (rev B) from having two full-height 5.25" floppy drives to having a half-height high-density 5.25", and the MFM HDD jerry-rigged on.

      We further decked it out with an 8087 coprocessor, and an AST RAM-Page board with a whopping 2 MB of memory! Part of that was used to fill out the lower 640k (only 256k on the motherboard), and the rest was paged for expanded memory. Top that off with a Hayes proprietary V-series 9600 Smartmodem for BBSing, and an upgrade to an EGA video card and monitor.

      That was a sweet rig, compared to the Timex Sinclair 1000 we had before... ;) And, I learned not to be afraid to dig into machine guts at an early age (in the mid- to late-1980s). Ah, good times.

    70. Re:Sure by adolf · · Score: 1

      There's no problem using an RLL drive on an MFM controller, if that's the combination that happens to be available.

    71. Re:Sure by RockDoctor · · Score: 1

      Also, you could probably get an adapter and use a 128MB CompactFlash card.

      And the last time you saw a new 128MB CF card was ... ?

      (I occasionally trawl eBay for exactly these - for my PDA, which went out of production a decade ago. And when a "better", modern PDA can acheive a month's use on a pair of AAs, then I'll think about replacing it. I'm in no hurry.)

      --
      Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
    72. Re:Sure by RockDoctor · · Score: 1

      A PC-XT MFM controller like the ST-506 will work just fine in a 486, and most 486s came with a few ISA slots.

      Not the VL-bus one that I invested in so long ago. That was the wages of my first international job.
      Cutting Edge = Bleeding Edge.

      MFM or EDSI, with controller card should do the trick.

      --
      Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
    73. Re:Sure by multipartmixed · · Score: 1

      You probably should have gone into the BIOS and set the ISA bus speed down as low as possible. I'm pretty sure the ST-506 would run at 8MHz though.

      --

      Do daemons dream of electric sleep()?
    74. Re:Sure by Mal-2 · · Score: 1

      There's no problem using an RLL drive on an MFM controller, if that's the combination that happens to be available.

      That is true, because there is no physical difference in the drives. One has been tested as reliable with RLL, and the other has not. That's the only difference between an ST-225 and an ST-238R. Both will work with either kind of controller, but the ST-225 was not tested for it. At this point in the hardware lifecycle, I hardly think it matters.

      --
      How is the Riemann zeta function like Trump rallies? Both have an endless number of trivial zeros.
    75. Re:Sure by RockDoctor · · Score: 1

      You probably should have gone into the BIOS and set the ISA bus speed down as low as possible.

      You miss my point : the motherboard in question may well have had an internal ISA bus for connecting hard-wired peripherals to (it's a long time ago) ; but it had no ISA slots into which an ISA controller card for anything could be plugged. IIRC, there wasn't even an un-used space for a header to be soldered. It was intended to be a new generation motherboard for people who were confident that the way things were going to go was VL-bus, not this PCI piece of crap.
      If you see me jumping one way in a standards war, you know who the losing side is. If I'd been around when the question was live, I'd have got a BetaMax (I got a video in 1999; VHS).
      SCSI external bus was the obvious way to hook up my brand-new weeks-wages-worth of a CD burner? Of course.
      Luggable or Laptop? No contest.
      Pascal or C? Pascal.

      I've stopped investing in new technologies until the standards war for their replacement is being fought. It's safer that way.

      Oh, I did jump the right way once ... Spend £100 on a copy of SCO's Xenix, or the Coherent Unix-alike, or think about it for another few weeks ... just before some Finnish nut-job started to write his own Free Unix-alike.

      --
      Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
  4. Hard disk firmware hacking by Anonymous Coward · · Score: 1, Insightful

    I'm fairly sure you would have to go fairly deep and directly hack/modify hard disk firmware to do what you describe. Such hack would be non-trivial and most likely model-specific.

    1. Re:Hard disk firmware hacking by Eric+Smith · · Score: 1

      I doubt that you could do it even then. The drive hardware most likely isn't even *capable* of recording raw ones and zeros on the media, since that's not how your data is stored. Aside from the interleaved Reed-Solomon error correction, the drive uses PRML (Partial Response Maximum Likelihood) to record multiple bits simultaneously as an analog waveform. There isn't a one-to-one correspondence between a data bit and a flux transition on the medium. This is all done by the drive hardware, so even rewriting the firmware isn't going to circumvent it.

    2. Re:Hard disk firmware hacking by makomk · · Score: 1

      Actually, I wonder if even replacing the entire drive controller would allow you to write raw transitions... not sure what exactly the amplifier chip on the head stack does.

  5. man dd by Anonymous Coward · · Score: 0

    (nt)

    1. Re:man dd by maxwell+demon · · Score: 1

      RTFS

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:man dd by 1s44c · · Score: 2, Informative

      RTFS

      Knowing everything there is to know about dd isn't going to tell you where on a physical disk your data is stored. dd only sees a long string of zeros and ones that are a far abstruction from what physically happens on the drive.

      There doesn't seem to be any way to be sure exactly where the data is written except by a deep understanding and maybe a replacement of the drive firmware.

    3. Re:man dd by maxwell+demon · · Score: 1

      And why are you replying to me instead of the OP?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    4. Re:man dd by qubex · · Score: 1, Informative

      *abstraction*, not *abstruction*

      --
      "Place me in the company of those who seek Truth, but deliver me from those who believe to have found it."
  6. Butterflies by Nowhere.Men · · Score: 0, Redundant
    1. Re:Butterflies by dotgain · · Score: 1

      Reading the discussion to see if three others have already posted exactly the same comic (a sure bet with xkcd) and been modded down (becoming a similarly sure bet) is also obligatory

    2. Re:Butterflies by Anonymous Coward · · Score: 0

      I moderate all xkcd link comments as redundant.

  7. No. by Anonymous Coward · · Score: 1, Informative

    No, there aren't.

    You would need to completely bypass the drive firmware in a way that would make the drive quite unusable afterwards; this is generally not possible in hardware. It's not like they're going to let you control the voice coil circuitry directly as permanent damage to the drive would likely result! This is likely going to be a highly custom solution and you will need special equipment to do it. Contact the drive manufacturers or a very big data recovery specialist.

    1. Re:No. by PiSkyHi · · Score: 1

      Never mind the MFM or GCR encoding that is required to know how many 1's or 0's you've actually written.

      The heads essentially detect change within a certain timeframe - if the timeframe is too long, the head cannot be certain how many consecutive bits were written.

    2. Re:No. by number11 · · Score: 2, Insightful

      You would need to completely bypass the drive firmware in a way that would make the drive quite unusable afterwards

      "Afterwards" wasn't part of the spec. He just wants to write the 1s and 0s. Reading them wasn't part of the spec that he gave us.

      Seriously, if he just wanted to use a HD for data storage and retrieval, he already knows how to do that. Maybe he just wants a magnetic platter decorated with his logo printed in magnetic domains, a la lightscribe. Or something entirely different. Since he didn't tell us, but yet wants to do something so unusual, we can't make assumptions.

  8. That is gonna be hard by PaulIsTheName · · Score: 5, Insightful

    You would need to replace the firmware inside the drive or use an undocumented manufacturer mode. Whatever they use to write the servo tracks would be interesting to you. You will be in the situation of the firmware writer: There will be problems all the way. Be prepared to find a way to position the heads (ever tried to find a servo track?). Most likely you also need to at least parametrize the amplifiers in the DSP part of the firmware that does the analog-to-something-to-digital so you can have direct influence on the "bits". Good luck

    1. Re:That is gonna be hard by troll8901 · · Score: 1, Funny

      ... parametrize ... influence ... situation ... position ...

      You sound like a corporate buzzword generator.

    2. Re:That is gonna be hard by omglolbah · · Score: 2, Insightful

      Yet to someone who is not a troll and has technical knowledge it makes perfect sense! :-p

    3. Re:That is gonna be hard by makomk · · Score: 1

      As far as I'm aware, all the manufacturers use special hardware to write the servo tracks - it's just not possible with the drive hardware itself.

    4. Re:That is gonna be hard by lobsterturd · · Score: 2, Informative

      For the benefit of the poster, who doesn't seem the type to know what a servo track is:

      A servo track is how the hard drive knows where the heads are over the disk. Older hardware could just read the angle of the arm, but with vast increases in density it became necessary to put position data on the platters themselves where more precision is possible.

    5. Re:That is gonna be hard by PaulIsTheName · · Score: 1

      That's what I thought too but I am still not sure. What got me thinking was the "Excalibur" machine mentioned in a story about a tour through WD's premises and the comment in the text:

      The drive gets inserted into a bay, whereupon its media is filled with a servo pattern to fill the tracks with data. This will confirm that all of the media is able to store information.

    6. Re:That is gonna be hard by ThreeGigs · · Score: 1

      Why not look at it as a reverse-engineering of what the drive controller will actually write?

      There are utilities that allow you to write to a specific sector of the drive.

      You can determine which ECC/encoding scheme the drive uses from manufacturer's specs.

      If you want to write a bit in a particular position within a sector, reverse the Reed-Solomon algorithm to determine what data you need to send to the hard drive in order to get the R-S output that fulfills your need written to the disk.

      However, it may not be possible to generate certain patterns because of the constraints in the encoding... you won't be able to completely fill a sector with all zeroes, for example.

    7. Re:That is gonna be hard by b4dc0d3r · · Score: 1

      Imperfect sense, rather. While technically correct and informative, it doesn't really help the poster. It can be summarized as: Get an older MFM/RLL/GCR drive, pay off the drive manufacturer, use a floppy with catweasel instead, they will all have the effect described above.

      A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts: "Excuse me, can you tell me where I am?"
      The man below says: "Yes, you're in a hot air balloon, hovering 30 feet above this field.
      "You must be an engineer" says the balloonist.
      "I am" replies the man. "How did you know?"
      "Well," says the balloonist, "everything you have told me is technically correct, but it's no use to anyone."
      The man below says "You must be in management."
      "I am" replies the balloonist, "but how did you know?"
      "Well," says the man, "you don't know where you are, or where you're going, but you expect me to be able to help. You're in the same position you were before we met, but now it's my fault."

    8. Re:That is gonna be hard by Anonymous Coward · · Score: 0

      I'd say it can be summarized as "you might be able to do that in a manufacturing mode if one exists. It'll be difficult even if one does exist - expect X, Y and Z"

      Actually seems pretty helpful in a general sense.

    9. Re:That is gonna be hard by Jon+Harms · · Score: 1

      I agree that kidcharles might be asking for more than he thinks. Normally, the drive is accessed using LBA. Depending on how the physical media was grown (where defects formed) the LBA will correspond to different parts of the platter on every drive, even if they came off the assembly line in pairs. Furthermore, when you say you want to control where the 1's and 0's are stored, this is a bit of a misnomer. The data is NRZI encoded, and the ones and zeros are actually stored in the presence or absence of a domain wall. If you were referring to controlling the relative placement of the data (inner or outer part of the platter) then you may have some luck with the firmware. As others have pointed out, in this case your best shot would be to ask for a drive with custom firmware. It will cost you, but they already have diagnostic firmware that does this, and they would just need to make a stripped down version that doesn't allow you access to the features they don't trust you with (which is most of them). Good luck :)

  9. You Da Man!!! by KJSwartz · · Score: 1

    First thought was - WoW! Somebody wants to defeat disk caching, ECC and make life bloody difficult to boot. The best way, if you really want to do direct disk RMW operations - is to use Flash. Its fast, reasonably portable, and won't fail you if you use it properly.

    1. Re:You Da Man!!! by maxwell+demon · · Score: 3, Informative

      Besides the fact that Flash doesn't have a hard disk platter (his problem obviously isn't just to save data), Flash chips also contain internal logic to map out defective blocks, and in addition they remap in order to avoid writing single blocks too often in order to prevent them from failing early. So even if the HDD platter isn't really needed, he won't get exact control on Flash either.

      If you had at least suggested a floppy. There you can indeed control exactly where your bits go, and it's even a magnetic medium.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:You Da Man!!! by 1s44c · · Score: 2, Interesting

      First thought was - WoW! Somebody wants to defeat disk caching, ECC and make life bloody difficult to boot. The best way, if you really want to do direct disk RMW operations - is to use Flash. Its fast, reasonably portable, and won't fail you if you use it properly.

      You still won't know where the data is actually written. Flash does wear leveling.

    3. Re:You Da Man!!! by dotgain · · Score: 3, Insightful

      If you had at least suggested a floppy.

      Actually that's the best suggestion yet. After he's spent a week banging bits into the 82072A, he'll either have gone insane, or will have realised he's well and truly barking up the wrong tree. Once again, OP: I'd love to know what you're up to, if it's not trolling Ask Slashdot.

    4. Re:You Da Man!!! by marcansoft · · Score: 2, Informative

      NOR flash doesn't require or use wear leveling, error correction, or bad sector management (as long as your wear pattern isn't ridiculously unbalanced) - use that if you want true "write raw bits" style functionality. Most microcontrollers use this type of flash, and chips are readily available, though they are expensive compared to NAND flash and only exist in smaller sizes.

      NAND flash requires you do your own wear leveling, error correction, and bad sector management. You can still control all the bits, but be prepared to have the chip eat some of them.

      Only "cooked" NAND flash devices such as SSDs and SD cards actually do all that on a built-in controller.

    5. Re:You Da Man!!! by marcansoft · · Score: 1

      Flash chips also contain internal logic to map out defective blocks, and in addition they remap in order to avoid writing single blocks too often in order to prevent them from failing early.

      Flash controllers do that, not flash chips (well, some very smart flash chips have a built-in controller, but they aren't exactly common). It's very easy to buy a raw NOR or NAND flash chip and control every bit (with NOR you don't even need bad block management, as all blocks are guaranteed valid within the specified number of writes).

    6. Re:You Da Man!!! by Anonymous Coward · · Score: 1, Interesting

      . Once again, OP: I'd love to know what you're up to, if it's not trolling Ask Slashdot.

      My first thought was steganography using bit position. My second was a defeating mechanism for NSA-level data-recovery methods which use bit position to help infer overwritten data. Those seem the only reasons anyone would ever want to worry about their bit position on a track.

    7. Re:You Da Man!!! by infolation · · Score: 1

      Once again, OP: I'd love to know what you're up to

      It surely has to be for hard-drive disk wipe purposes, like low-level DBAN?

    8. Re:You Da Man!!! by vlm · · Score: 1

      After he's spent a week banging bits into the 82072A, he'll either have gone insane, or will have realised he's well and truly barking up the wrong tree.

      Yup barking up the wrong tree. Skip those ancient controller chips and use a DSP chip. Heck, data rates on old floppies was so low, that a plain jane microcontroller would probably work. Now by microcontroller I don't mean the lowest end PIC ever made because thats fast enough but has too little memory, or an interpreted basic stamp which probably has the memory but is way too slow, I mean a real mid-high range PIC at minimum.

      Of course if you'd settle for very simple patterns of 1/0 to look at with ferrofluid or something, then probably any microcontroller would work?

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    9. Re:You Da Man!!! by hedwards · · Score: 2, Insightful

      Considering he's asking this question to begin with, what makes you think he hasn't gone insane already? This isn't something that most people technically inclined enough to program would be silly enough to even consider asking.

    10. Re:You Da Man!!! by Anonymous Coward · · Score: 0

      I dunno, it looks to me like the goal is research on the actual bits on a modern hard drive. As in, trying to generate some statistics on just how likely a single-bit failure really is. For that, an old floppy really wouldn't be appropriate.

  10. How about by Anonymous Coward · · Score: 0

    I'm not 100% sure, but on a *nix system you might be able to do this by writing to /dev/, where device represents the HDD.

    1. Re:How about by maxwell+demon · · Score: 1

      That would bypass the file system, but not the drive's internal logic.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:How about by ComaVN · · Score: 1

      This only skips the file system, not whatever the firmware does.

      --
      Be wary of any facts that confirm your opinion.
    3. Re:How about by PaulIsTheName · · Score: 3, Informative

      They (the bits you write to your typical /dev/sd* device) would still be wrapped up in sectors, the sectors be enhanced with error correction, then encoded (NRZ, Manchester or whatever is appropriate to the magnetic storage) and then written out. What OP wanted is to manipulate the bit that comes out of encoding. Given the usual stack of SCSI-like commands (and not direct access to the write head signal as early HDD controllers had) this does not seem feasible.

    4. Re:How about by vikingpower · · Score: 1

      Exactly. You could use raw devices on your *Nix, but that is as far as you can possibly go. Ergo: it can not be done.

      Did William of Ockham have a beard ?

      --
      Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
    5. Re:How about by Anonymous Coward · · Score: 0

      NRZ/Manchester/whatever has only historical significance. Drive data has not been encoded like that for more than a decade. The "encoding" is usually a multi-layered process, where original data is first prepended/appended with necessary sync/crc/housekeeping regalia, then it's fed through a chain of encoders, each of them increasing the size of the data, finally being serialized and sent to the write amplifier.

  11. Your own Disk controller chipset? by Anonymous Coward · · Score: 3, Insightful

    If you don't need lots of bytes, you should use an old disk. I mean very old, maybe going back to those 300-400MB disks we had on 486 computers or even older.

    Recent disks have embedded error-handling mechanisms which will prevent you from writing what you want, where you want (physically speaking of course). The disk controller translates your "physical" disk addresses into its own internal mappings. The only way to bypass this would be to remove the disk controller's chip and put your own in place.

    Maybe your question would be: "how hard is it to create my own disk controller's chipset?"

    1. Re:Your own Disk controller chipset? by ranulf · · Score: 2, Informative
      > I mean very old, maybe going back to those 300-400MB disks we had on 486 computers or even older.

      Hahaha. 300-400MB isn't "very old". It's only 20 years since I bought a 80MB hard disk for £150 and that was considered massive as a couple of years earlier 20MB was cutting edge and cost a few hundred pounds.

    2. Re:Your own Disk controller chipset? by Anonymous Coward · · Score: 0

      Agreed :-). But at what point did we start to get "smart" disk controllers? I was assuming that 400Mb drives were still mostly mechanical beasts, but I might be wrong...

    3. Re:Your own Disk controller chipset? by squizzar · · Score: 1

      When we got IDE - Integrated Drive Electronics. Before then the controller was on the motherboard.

    4. Re:Your own Disk controller chipset? by Anonymous Coward · · Score: 5, Informative

      I think anything > 120MB may be unsuitable for this purpose, as they are likely to use ZBR, i.e. different sector densities depending on the circumference of the track. I'd also recommend a really old MFM or RLL disk, where the head movement is controlled with one set of wires and the analog signals from the read/write heads use another set of wires. MFM and RLL drives use the ST506 interface, which should be "easy" to control with microcontroller and a little bit of glue logic.

    5. Re:Your own Disk controller chipset? by jabberw0k · · Score: 1

      Hard to believe parent -- the only technically accurate post for miles around -- got modded down.

    6. Re:Your own Disk controller chipset? by jonadab · · Score: 1

      > you should use an old disk. I mean very old, maybe going back
      > to those 300-400MB disks we had on 486 computers or even older.

      Much older. I'm pretty sure you have to go pre-IDE.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    7. Re:Your own Disk controller chipset? by Aging_Newbie · · Score: 1

      IDE drives do not allow you access to the physical data format. It is written on the disk when it is created and not changed. In the old days, hardware wore out soon enough that the physical format could become unreadable and need to be replaced with a new one. Fun, huh?

      Actually you have to go back to the early 80s when BIOS had the low level init utility for hard drives and the drives themselves were simply bit writing and reading devices. At that time you could establish an arbitrary physical format on the drive before you wrote the OS format. In fact, I remember how you could take a 20 MB drive and make it a 30 MB drive with a different RLL (Run Length Limited) encoder that stashed bytes more compactly. That process exceeded the capacity of the processors of the time so was in hardware. So, I guess, just go back and get a 10 or 20MB drive with interface card and have at it.

    8. Re:Your own Disk controller chipset? by Hyppy · · Score: 1

      If there is a fairly good reason for someone to have posted that anonymously, I'm all ears. "I'm a lazy turdwaffle" doesn't quite cut it.

  12. Why by Anonymous Coward · · Score: 0

    What possible reason would need to do what your suggesting
    may be its my lack of imagination but why

    1. Re:Why by RivieraKid · · Score: 1

      The only time I've seen something like this is back in the day when software companies marked floppy disk sectors as bad for copy protection. The OS wouldn't touch them so when you copied the disk it either wouldn't copy due to read errors, or it would copy but the crucial data written in the bad sectors would be missing so the software wouldn't run.

      --
      "Necessity is the plea for every infringement of human freedom. It is the argument of tyrants; it is the creed of slaves
  13. Slashdot trolled by dotgain · · Score: 5, Insightful

    The submitter appears to know enough about what he's asking to know that it's also impossible / completely impractical. Recording ones and zeros directly isn't done for a reason, submitter appears to understand this.

    1. Re:Slashdot trolled by bertok · · Score: 5, Interesting

      The submitter appears to know enough about what he's asking to know that it's also impossible / completely impractical. Recording ones and zeros directly isn't done for a reason, submitter appears to understand this.

      Keep in mind that the question is not just why the submitter wants to write directly to the magnetic domains of a hard disk, but why the submitter asked the question of how to write directly to a hard disk.

      I can think of a number of reasons for the latter:

      - The submitter could be an author writing some cyberpunk techno-thriller, and wanted some technical feedback from the 'experts' on Slashdot.

      - The submitter could be a CIA drone trying to write a report on how it's impossible for the terrorists to somehow 'hide' data on hard drives that even 'dd' can't read.

      - The submitter could be a troll.

      That's just off the top of my head.

      On the other hand, I seriously can't think of a good reason why anyone would want to actually damage a hard drive that way. If all you wanted to do is very precisely create a surface with a complex pattern of specifically oriented magnetic domains, there's easier ways. For example, there are equipment suppliers that can provide high-precision two axis steppers with ready to use computer control interfaces. It's not hard to get equipment that'll go down to atomic precision.

    2. Re:Slashdot trolled by AHuxley · · Score: 2, Interesting

      The magnetic domains of a floppy disks and removable storage devices did spook the FBI in the Phillip Hanssen case.
      http://slashdot.org/article.pl?sid=01/02/22/0622249&mode=thread
      Did any of the old black box recorder like devices write in a loop directly?

      --
      Domestic spying is now "Benign Information Gathering"
    3. Re:Slashdot trolled by mbone · · Score: 3, Interesting

      The submitter doesn't appear to know enough to say why he wants to do this. If this were a consulting job, I would say, what are you really trying to do ? My guess is that, whatever that is, there is a better way to do it.

    4. Re:Slashdot trolled by Anonymous Coward · · Score: 2, Insightful

      Or maybe the submitter is a developer who has been told to do something impossible/completely impractical by someone in management. Management doesn't believe that what they are asking for is impossible/completely impractical so this is the submitters attempt to get an informed body of people to say the task is impossible/completely impractical so management will believe him.

    5. Re:Slashdot trolled by sam0737 · · Score: 1

      I start to thinking he is betting $100 with someone that...arguing that this is not technically possible.
      The other one insist the other way and will only give up when even Slashdot crowd can't solve such questions.

      I hope he get his $100, and share with us if possible.

    6. Re:Slashdot trolled by quanminoan · · Score: 1

      The AFMs you cite only use stepper motors for the first stage of precision movement. The precision movement at the atomic level is handled by piezo devices (i assume called piezoelectric actuators). These are very difficult to control since they have complex hysteresis involved with their movement, and change their properties over time. Expensive as well. He *is* better off using the hard drive components to do what he wants...

    7. Re:Slashdot trolled by Lumpy · · Score: 0

      Incorrect. You can do it and quite easily. you throw a useless OS out the window though and boot the PC from a CD that contains your assembly language program to do the task.

      the program Spinrite does this. It does not write to the drive, but it can read a specific sector.

      By using assembly and sending the right commands to the drive, you can target a specific sector and write the correct bit pattern to target a specific bit at that location on the platter.

      This is not hard at all. Just tedious. All you need is the drive interface specifications for your hardware interface. If it's a PC then BIOS calls can work. Otherwise build a arduino or PIC -> IDE interface and send the command s directly without all the bloat of a full blown PC.

      --
      Do not look at laser with remaining good eye.
    8. Re:Slashdot trolled by SharpFang · · Score: 4, Interesting

      - Submitter wants (for whatever weird project of theirs) a surface with magnetic image on it (a'la LightScribe, only magnetically).
      - Submitter missed the actual point, and wants to write raw data to drive (some embedded project) circumventing partitioning and filesystem overhead - quite frequent.
      - Submitter wants to record a lot of analog/unreliable data - skipping error checking and using the extra space to store more data (errors = acceptable noise)
      - Submitter doesn't care about data storage and wants to use disk heads as a very fast magnetic field sensor/generator

      This is quite doable with ANCIENT pre-ATA drives. The computer controlled everything then, the head position, the moment of writing and so on.
      It is doable with old ATA drives that run PIO modes, probably with a bit of electronics tinkering.
      It is about impossible with modern drives. You'd have to replace the whole electronics with your own and drive the head and the motors with your own.

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
    9. Re:Slashdot trolled by dotgain · · Score: 3, Informative

      You have got a lot of catching up to do. Drives just don't work like that any more.

    10. Re:Slashdot trolled by Anonymous Coward · · Score: 0

      AFM might be an easier way for creating a pattern, but certainly not cheaper than an old HDD and couple months of e.g. PhD candidates hacking software.
      That said, if the submitter has access to a device and the people that can look at the pattern (AFM, SP-STM, XMCD microscopy, neutron scattering, reflectometry measurements, whatever) he should have access to some that can write the patterns, too...

      And what good would a pattern do that you can not look at?

    11. Re:Slashdot trolled by iamhassi · · Score: 2, Funny

      "I hope he get his $100, and share with us if possible."

      gives new meaning to "my 2 cents worth"

      --
      my karma will be here long after I'm gone
    12. Re:Slashdot trolled by houghi · · Score: 1

      I seriously can't think of a good reason why anyone would want to actually damage a hard drive that way

      Speed and encryption. If you order all the zeros and all the ones, you could much easier do encryption of the HD. Probably he has some system that knows what zero and what one goes where.

      --
      Don't fight for your country, if your country does not fight for you.
    13. Re:Slashdot trolled by vadeskoc · · Score: 5, Insightful

      If I had to guess, I'd say this is a physics grad student who is looking to use this hard drive for something other than data storage. Where I work (in academia) we repurpose hardware all the time for purposes other than it's intended one, in order to do science, since commercial stuff is often engineered way beyond our capability to build it from scratch. That is, provided we can overcome details of its implementation that arise from its original (true) purpose. This may be one of those cases where the thing is engineered beyond hope of hacking, but I'm kind of disappointed at the "you're-an-idiot-because-hard-drives-aren't-meant-to-do-that" attitude in these posts. Is this really indicative of the level of imagination and curiosity on Slashdot?

    14. Re:Slashdot trolled by Crudely_Indecent · · Score: 2, Insightful

      The submitter doesn't appear to know enough....

      Or the submitter is a consultant who knows enough about his non-disclosure agreement to reveal only the bare minimum about his goals without revealing the purpose of the project and violating his NDA.

      --


      "Lame" - Galaxar
    15. Re:Slashdot trolled by Anonymous Coward · · Score: 0

      Or the submitter is a consultant who knows enough about his non-disclosure agreement to reveal only the bare minimum about his goals without revealing the purpose of the project and violating his NDA.

      Ah. Yet another "consultant" who doesn't know how to do what he was hired to do, you mean?

    16. Re:Slashdot trolled by c++0xFF · · Score: 3, Interesting

      I was stumped as to why one would want direct access to the drive like that, until I read your post. Thank you.

      But I also agree that this is just about impossible, depending on what he's trying to do. There's no way he can control the heads of the disk: too many layers of abstraction exist between the user and the hardware. But it should be possible to control where data is placed on the disk: this is what disk defragmentation does, after all.

      But even then I'm not sure that what the device reports is necessarily what happens on the platters. Flash memory drives, for example, relocate information to balance the number of writes and extend the life of the drive.

      I would recommend contacting the drive manufacturer and then making my own block device driver for Linux based on their recommendations. But even then I'd question the core reasoning: is this really, really necessary?

    17. Re:Slashdot trolled by ElizabethGreene · · Score: 3, Informative

      Spinrite may "write" 00000000 to a specific location on the disk, but that 00000000 is actually encoded as something else when it is written to the disk to maintain a minimum number of bit transitions. In the Telecom world, B8ZS is commonly used for encoding. AFAIK, the HDD manufacturer's algorithms are proprietary.

      It is also worth mentioning that a hard drive head does not read a binary signal from the platter. It reads an analog waveform and converts it to digital via the encoding and ECC algorithms the OP is trying to bypass.

      -ellie

      Scott Moulton of http://myharddrivedied.com/ is the smartest HDD guy I know. If you absolutely have to have a solution, talk to him.

    18. Re:Slashdot trolled by SEWilco · · Score: 4, Funny

      It is about impossible with modern drives. You'd have to replace the whole electronics with your own and drive the head and the motors with your own.

      Find a drive with characteristics similar to what you want, and contract with the manufacturer to modify the drive to do what you want. The manufacturer has the tools and engineers to alter the existing firmware. It won't be cheap. If the manufacturer refuses the proposal, buy the company.

    19. Re:Slashdot trolled by Hognoxious · · Score: 4, Interesting

      Where I work (in academia) we repurpose hardware all the time for purposes other than it's intended one

      What you say is all well and good, but you don't think that knowledge of that purpose might help with the solutions?

      I'm kind of disappointed at the "you're-an-idiot-because-hard-drives-aren't-meant-to-do-that" attitude in these posts.

      It's nothing like that at all. It's more like that-won't-work-so-what-are-you-trying-to-achieve-maybe-something-else-will-work, which is fair enough.

      Is this really indicative of the level of imagination and curiosity on Slashdot?

      A lot are asking "Why do you want to do that?", which sure looks like curiosity to me.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    20. Re:Slashdot trolled by Interoperable · · Score: 1

      You'd have to replace the whole electronics with your own and drive the head and the motors with your own.

      I'd say replacing the electronics would be sufficient to make use of the existing read/write head and motors. If he wants to write 1s and 0s in individual magnetic regions of the hard disk he's out to lunch, but using the existing head to write something to disk and read it again should be possible.

      There's marvelous technology in hard disks that can be re-purposed for applications other than data storage, but for data storage, stick to the existing firmware.

      --
      So if this is the future...where's my jet pack?
    21. Re:Slashdot trolled by Anonymous Coward · · Score: 1, Interesting

      I've found quite often, that the computer science crowd is quite different from the engineering crowd. The first believe hardware was created with a purpose and use it as a programming library. The engineer most of the times refuses to believe that the object in question has a single purpose (and it's stubborn enough to want to write it's own code, rather than using pre-written libraries).

      I guess this is a good example of the crowd around and how they see/face problems. Great stuff for a next slashdot poll.

    22. Re:Slashdot trolled by drachenstern · · Score: 1

      While you raise some exceedingly good points, the problem with this is that the drives really are over engineered beyond hope of hacking.

      Trust one of the /. crowd here, we would pretty much all like to see this in action, but the truth of the matter is that you can't do what he's asking. Modern rotating media are by definition NOT binary (hence digital) devices, they are analog. There must exist a translation between analog and digital, and the controller does that.

      Now, if he wants to avoid using a filesystem so he can gain extra overhead (think no FAT tables, no redundant tables, no file information like size and location pointers) then *that* is a perfectly reasonable thing to do, and ext2fs is a great starting point.

      Otherwise, what he wants (as stated above) is impossible. Let the drive do the analog-digital conversions.

      --
      2^3 * 31 * 647
    23. Re:Slashdot trolled by Idbar · · Score: 1

      You know, I'm somewhat old already from when I took classes about this. Now, how is it that a filesystem works and why is there different filesystems?
      This is an honest question, since I'd like to know how different filesystems manage to put data in a harddrive these days, and how would anyone would write a new one, if you're not able to tell the harddrive what to do? Are HDD drivers already "embedded" in the HDDs? What commands/data goes through a SATA or any other type of HDD connector?
      I kindly thank you for any reference you may point me to.

    24. Re:Slashdot trolled by Richy_T · · Score: 0, Flamebait
    25. Re:Slashdot trolled by vadim_t · · Score: 1

      I'm kind of disappointed at the "you're-an-idiot-because-hard-drives-aren't-meant-to-do-that" attitude in these posts. Is this really indicative of the level of imagination and curiosity on Slashdot?

      Why? Without any additional information it's the right answer.

      It's a very unusual thing to do. If the submitter really needs to do this, then an explanation of why is it needed would help with giving an answer relevant to the requirements (is an old MFM drive/floppy a viable option? doesn't say)

      In the more likely case that the submitter has the wrong idea I think it's much better to just say that instead of making them get involved in a huge project that they don't need, when a much simpler solution could be used instead.

    26. Re:Slashdot trolled by FatdogHaiku · · Score: 1

      You forgot one... developing a new unbreakable DRM based on some unreproducible hard drive identification via modification.

      Naa, that would be too ironic...

      --
      You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
    27. Re:Slashdot trolled by ultranova · · Score: 1

      Speed and encryption. If you order all the zeros and all the ones, you could much easier do encryption of the HD.

      Um... What?

      Probably he has some system that knows what zero and what one goes where.

      Yeah, it's know as the hard disk controller chip ;).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    28. Re:Slashdot trolled by node+3 · · Score: 1

      I didn't get that he knows it's impossible. The key thing here that makes it impossible is that drives don't actually write discrete ones and zeroes anymore. They write complex signals that represent a series of bits. Even with a very precise and accurate needle, one could not scan the surface of a drive and find discrete ones and zeroes.

      Now, there *might* be a way to alter or specifically design the signals written to look like what a pure one or zero would look like (in the way people tend to imagine they would look), but that would require an extremely clever hack, assuming it's even possible at all.

    29. Re:Slashdot trolled by ultranova · · Score: 1

      Now, if he wants to avoid using a filesystem so he can gain extra overhead (think no FAT tables, no redundant tables, no file information like size and location pointers) then *that* is a perfectly reasonable thing to do, and ext2fs is a great starting point.

      If you're using Linux, as ext2fs would suggest, simply fopen() "/dev/hda1" (or "dev/hdb3" or whatever) and you're done. An OS that treats everything as a file is sometimes very convenient :).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    30. Re:Slashdot trolled by Hes+Nikke · · Score: 1

      Drives just don't work like that any more.

      Quick! Someone tell Steve Gibson!

      Or are you talking about SSDs? SSDs don't work that way, but hard drives sure do!

      --
      Don't call me back. Give me a call back. Bye. So yeah. But bye our, well, but alright we are on a shirt this chill.
    31. Re:Slashdot trolled by b4dc0d3r · · Score: 1

      kidcharles no! kidcharles you got in my head. I'm the Juggernaut bitch. Comb your beard - I don't wanna hear that shit. Man I custom made your suit.

    32. Re:Slashdot trolled by cayenne8 · · Score: 1
      "Ah. Yet another "consultant" who doesn't know how to do what he was hired to do, you mean?"

      Hey...as long as you get paid, that's the important thing!!!

      :)

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    33. Re:Slashdot trolled by drachenstern · · Score: 1

      Yeah but opening it as a file doesn't let you position things where you want, hence I was commenting on the usefulness of the underlying mechanics of a filesystem.

      But I agree, if you're mostly using a write once style system, open it like a file and just write...

      I think that this really is a troll on slashdot, twould be nice if the submitter would come back into the discussion at some point.

      --
      2^3 * 31 * 647
    34. Re:Slashdot trolled by Crudely_Indecent · · Score: 2, Insightful

      He was smart enough to consult with his peers.

      The problem with doing something that hasn't been done before is that you have to figure out how to do it.

      The first step is research. Slashdot seems a likely place to find that research starting point or a glimmer of wisdom that might point in the right direction.

      --


      "Lame" - Galaxar
    35. Re:Slashdot trolled by bws111 · · Score: 1

      Nonsense. Asking a drive to write logical sector 1234 is trivial. Asking a drive to write a 1 to the location on platter 2, x microns from the edge, at y degrees of rotation (the actual physical address) is not possible without special drive electronics and firmware.

    36. Re:Slashdot trolled by marcosdumay · · Score: 1

      Not quite so. Piezzo actuators are quite cheap (compared to other precision mechanical devices, you could by some for some personal project if you want, not pocket change, but quite accessible for somebody not living on India's median salary). Also their hysteresis is the smalest and most easily calculated of the lot of mechanical actuators (some shapes don't even display measurable hysteresis, but then, you are out of the cheap domain). It is only that any histeresis is a problem on atomic scale positioning devices.

    37. Re:Slashdot trolled by marcosdumay · · Score: 1

      - Submiter wants to improve/defeat shred.

      Also, needing to replace the entire control board doesn't make it impossible, just harder. That may even be the answer he is looking for.

    38. Re:Slashdot trolled by smhsmh · · Score: 1

      Regardless the motivation behind this project, if I wanted to experiment with using a disk to store something other than regular data "blocks" I would try experimenting with an old 3.5" floppy rather than a modern hard disk. (Also, I'm incredibly cheap.) Old floppy drives and media are available for pennies. Control of the device, and especially formatting, is much closer to the processor. (There wasn't much smarts in floppy drives.) One could perhaps find formatting code in some early Linux distros. It might be that the proposed project needs to use a real HD made out of real metal, but this might be a way to experiment. I concur with earlier observations that there is so much smarts in a modern HD between the computer and the drive components that making the drive work without all that stuff would be daunting.

    39. Re:Slashdot trolled by bws111 · · Score: 2, Informative

      Quick! Go read his FAQ! Right there under 'Can I low-level format my drive' it says 'not possible on any modern hardware'. Randomly poking bits at specific PHYSICAL locations (which is what the poster wants to do) is low-level formatting.

    40. Re:Slashdot trolled by Richy_T · · Score: 1

      Flamebait? That's probably fair. But the truth is, this stuff is all extremely well documented and not at all hard to find for anyone who's genuinely interested.

    41. Re:Slashdot trolled by Anonymous Coward · · Score: 0

      He was smart enough to consult with his peers.
      The problem with doing something that hasn't been done before is that you have to figure out how to do it.
      The first step is research. Slashdot seems a likely place to find that research starting point or a glimmer of wisdom that might point in the right direction.

      Indeed, why bother to figure anything out yourself when you can just ask a bunch of non-paid online yokels? They're not under non-disclosure!

      "Turns out it's not possible. Here's my invoice, sign right there, please..." :)

    42. Re:Slashdot trolled by Hurricane78 · · Score: 1

      Go on Trollerators! Mod me down. I got so much karma, I can play this all week long!
      While you get angrier, and angrier. And in the end, all you have gained, is an ulcer and lost hair.
      With all your mod points lost, I’ll still be laughing in your face!

      BRING IT ON, FUCKERS! :D

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    43. Re:Slashdot trolled by ae1294 · · Score: 1

      Spinrite may "write" 00000000 to a specific location on the disk, but that 00000000 is actually encoded as something else when it is written to the disk to maintain a minimum number of bit transitions. In the Telecom world, B8ZS is commonly used for encoding. AFAIK, the HDD manufacturer's algorithms are proprietary.

      I think this is what the post was trying to get at but he should have been more precise. What a hard drive writes/reads isn't the same as what you write/read from the drive. In fact what the drive writes might be totally different from what it reads back before the on-drive controller rebuilds/decrypts and corrects for errors.

      To do what he is asking one would have to create a custom firmware, maybe even replace the on-drive controller completely. You could never get remotely close to the areal density of a modern drive without storing ECC data some place although I guess you could store it on another device.

      Then again if you created a virtual drive simulation program (ask/steal the required data from the manufacturer) you might be able to feed it data until you got the pattern you where trying to write but that's still not going to give you bit level control. Plus without changing the firmware the drive will write a lot of ECC data blocks so you end up back at plan A unless you are OK with that.

      But really if you turn that ECC stuff off then you got yourself a pretty useless paper weight.

      I guess you could take the drive apart and use some sort of laser like EM device to write to the platters but then you really don't have a hard drive anymore.

    44. Re:Slashdot trolled by Jane+Q.+Public · · Score: 2, Informative

      No, they don't. Not anymore. Take a typical WD drive for example. Clusters are composed of areas of data, separated by areas of correction code (ECC) data. The latter are written by the drive hardware, or firmware at least, and depend on what is written to the data area. (In other words, it's meta-data, for detection of bad writes or corrupted areas of the disk.)

      So even aside from boot sectors and so on, the data areas of the drive are separated by areas written by the drive's control firmware, so the latter are not directly writable by the user. Unless there is some kind of low-level command that can be sent to the drive, telling it to not write ECC data at all (and I don't see any reason for the existence of such), then the answer is NO: you just can't do that with a newer drive.

    45. Re:Slashdot trolled by Jane+Q.+Public · · Score: 1

      I'm kind of disappointed at the "you're-an-idiot-because-hard-drives-aren't-meant-to-do-that" attitude in these posts. Is this really indicative of the level of imagination and curiosity on Slashdot?

      It isn't that they aren't meant to do that (although some people who are unfamiliar with modern drives might be taking that stance), but rather "they aren't built to do that". There is just too much going on behind the scenes in a modern drive's hardware/firmware to do what the poster is asking. In order to bypass this, it would require ripping out the drive's control electronics and replacing it with a custom solution.

      If the OP really wants to do this, I strongly suggest he get hold of a drive that is at least 6-10 years old, and the appropriate controller card if his newer computer does not have an IDE (PATA) controller built-in. If the drive is old enough it may be low-level writable, with the possible exception of boot sector.

    46. Re:Slashdot trolled by countach · · Score: 1

      Isn't lseek() your friend?

    47. Re:Slashdot trolled by plover · · Score: 4, Informative

      The difference between the way you learned hard disks worked long ago and the way we use them now is due to IDE technology. Internally, the drive is still commanding cylinder, head and sector. Externally (to the PC), the interface is very different.

      Way back when we used to have the computer telling the drive controller board to operate the physical drive mechanisms, with the controller telling the drive which cylinder, head and sector to retrieve. This was called Cylinder-Head-Sector (CHS) addressing. If you ever worked on an original IBM PC-AT, you might remember having to set the "heads and cylinders" in the BIOS settings. You, the human, had to select from a list in the BIOS how many heads and cylinders the disk drive had. (And the older the PC, the fewer the choices. That meant every drive you could buy already had to be supported in the BIOS, but since there were so few originally, it didn't matter too much. As I recall, the max size drive supported by the original AT BIOS was 33MB, even though the largest drive IBM offered at the time was something like 20MB, if you had all the money.) The protocol was called ST-506, named after the first commercially available 5-1/4" hard drive.

      Integrated Drive Electronics (IDE) changed that. The controller board was moved from the PC to the drive itself. So now the controller board was set up by the drive manufacturer to know exactly how many heads and cylinders the drive had. To talk to an IDE drive, ATA was developed as a protocol. The computer would no longer send commands for a specific physical drive geometry, but would instead ask for a "logical block number", and the IDE would do a translation (looking it up in a map) to command the hardware to move to the correct physical cylinder, head and sector to retrieve the data. This is called Logical Block Addressing (LBA).

      So unless the original story author knows exactly what drive he's dealing with, and can download the lookup table from the drive, what he's asking for is no longer realistic. Each individual drive has its own unique mapping from LBA to CHS, because each drive maintains its own map of bad sectors. A computer asking for logical block #52 might physically get it from head#0, cylinder#3, sector#21 on one drive, but due to bad block mapping on a different drive it might get it from head#0, cylinder#4, sector#35.

      SCSI works on a similar principle, and Serial ATA has made further improvements on the scheme for performance and size changes. But all modern drive interfaces use some form of logical block addressing to access the data, and none use direct cylinder-head-sector addressing.

      --
      John
    48. Re:Slashdot trolled by Anonymous Coward · · Score: 0

      Now, there *might* be a way to alter or specifically design the signals written to look like what a pure one or zero would look like (in the way people tend to imagine they would look), but that would require an extremely clever hack, assuming it's even possible at all.

      You mean "modular arithmetic"? Yeah, tough.

      The real hard part is that the algorithms they use are proprietary.

    49. Re:Slashdot trolled by klui · · Score: 1

      Heck, even the Apple II's floppy disk drive doesn't write in 1s and 0s to denote the same at the lowest level.

    50. Re:Slashdot trolled by Nutria · · Score: 1

      The problem with doing something that hasn't been done before is that you have to figure out how to do it.

      Except in this case, people (in the form of engineers at companies) have been doing it for 55 years.

      --
      "I don't know, therefore Aliens" Wafflebox1
    51. Re:Slashdot trolled by ElizabethGreene · · Score: 1

      Maybe that was the OP's intent. To make magnetic art that could only be "seen" by destroying the disk and chucking iron filings onto it. That would be a pretty neat trick.

    52. Re:Slashdot trolled by Hognoxious · · Score: 1

      There's still a layer of abstraction between the stream you see and what's physically on the disk.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  14. Data Recovery by ResistanceIsIrritati · · Score: 1

    Presumably there is a way of at least reading specific sectors. Surely data recovery people use something like this to get raw data from a damaged drive bypassing anything the drive might do to try and correct errors. Maybe a data recovery specialist could help you.

    1. Re:Data Recovery by Anonymous Coward · · Score: 1, Interesting

      My guess would be that data recovery is exactly what they are looking to do. The tools they use from my understanding for these sorts or purposes tend to be firmware specific to to particular drive manufacturers, models, and even batches. All of these things also tend to be super proprietary and super locked up in NDAs and the like.

      Your best bet is going to be going through data recovery guys. If this is a company project that your company demands to have done entirely in house without contracting out any of the work prepare for things to get very expensive. If you outsource this though or use some data recovery people to get you equipped and set up for this project it might have a cost, but no where near what it would be to building this yourself.

    2. Re:Data Recovery by RivieraKid · · Score: 1

      Except he's asking about writing to the platters - data recovery would only ever need to read.

      --
      "Necessity is the plea for every infringement of human freedom. It is the argument of tyrants; it is the creed of slaves
    3. Re:Data Recovery by paulatz · · Score: 2, Funny

      Once you can read, you can also write. I've learned it at schools some 20 years ago

      --
      this post contain no useful information, no need to mod it down
    4. Re:Data Recovery by obarthelemy · · Score: 2, Funny

      Good. Go write "Paulatz wuz here" next to the HOLLYWOOD sign.

      --
      The Cloud - because you don't care if your apps and data are up in the air.
    5. Re:Data Recovery by RivieraKid · · Score: 2, Insightful

      Wow, nice contribution. You totally miss the point, which is that writing arbitrary magnetic fields to an arbitrary physical location on the platter is the very last thing you want to do during data recovery. Now, if you just want to write arbitrary data at arbitrary logical locations on the disk, then you can already do that with the disk in it's current state.

      Neither of these scenarios are remotely data recovery, since by definition, you are overwriting data.

      For what it's worth, I'd disagree that once you can read a human language, that you can also write it since there are visual and linguistic cues in written language that you have to provide when writing. In most people, the two are closely linked, but I'd be willing to bet that while learning to read/write, your reading aptitude probably has a slight lead over your writing aptitude.

      --
      "Necessity is the plea for every infringement of human freedom. It is the argument of tyrants; it is the creed of slaves
    6. Re:Data Recovery by Anonymous Coward · · Score: 0

      I knever lerned how to rigt but eye kan rite just phine

  15. Read before write by deniable · · Score: 1

    How are you planning to read the data back? Solve that, then think about writing. As others have said, you'll probably have to build your own drive controller.

  16. Wrong. by feepness · · Score: 5, Insightful

    Your requirements are wrong, sorry.

    Yes, I don't what they are. Still wrong.

    1. Re:Wrong. by Anonymous Coward · · Score: 0

      Yes, I don't what they are.

      Your sentence is wrong, sorry.

    2. Re:Wrong. by xtracto · · Score: 2, Funny

      No, its only that his writing algorithm a word.

      --
      Ubuntu is an African word meaning 'I can't configure Debian'
    3. Re:Wrong. by julesh · · Score: 1

      Your sentence is wrong, sorry.

      Your grammar naziism is wrong. Sorry.

    4. Re:Wrong. by weirdcrashingnoises · · Score: 2, Funny

      But how can be sure?

      --
      sigs... don't talk to me about sigs....
    5. Re:Wrong. by Anonymous Coward · · Score: 1, Funny

      Your sentence is wrong, sorry.

      Your sentience is wrong, sorry.

    6. Re:Wrong. by jellomizer · · Score: 3, Interesting

      It would be nice to know why the poster thinks this feature is important. The only things I can think of is the following...
      He is using parts from a hard drive to make a robot. So he wants to control a Robot using the hard logic board, to control the mechanisms.
      He is using the high speed nature of the drive and the noses it makes to make a speaker out of it by moving writing bits in the right spot.
      Trying to make a full real-time application.
      Researching better algorithms for drive storage.
      Attempting to make some sort of digital watermark on the drive.

      The first two are just silly hacks which would get geek creds but not overly useful.

      The Real Time System You probably need more then off the shelf and free software to do the trick

      And the Research you could probably program a simulator to simulate the results.

      The Watermark idea will work until someone fills up the drive.

      So I would agree with the poster unless you come up with a good reason where there isn't an other approach I don't see the need to do this.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    7. Re:Wrong. by Anonymous Coward · · Score: 0

      Feed a troll and they fap all over your thread. Blast! I've done it again!

    8. Re:Wrong. by LukeWebber · · Score: 1

      You've got my vote. I can't think of a single good reason why you can't do this using a file on disk rather than an actual disk.
      Seriously, if the OP wants an answer to such an obscure questions, shouldn't he tell us why he thinks he needs to do this?

  17. Some ideas by Anonymous Coward · · Score: 0

    You could try this, or ask yourself again: is this what you really want to do?

    Seriously, you are out of luck. Unless you come across a sympathetic hard drive manufacturer there is very little you can do.

  18. Be careful! by Anonymous Coward · · Score: 5, Funny

    I can't help directly, but can give one important advice - careful how you distribute the bits! If too many ones get on the same side of the platter this will destabilize it, causing it to wobble due to the weight difference ( a one weighs quite a bit more than a zero, you know!) and potentially tearing the platter in two!

    1. Re:Be careful! by jlebrech · · Score: 1

      I've noticed a full hard drive seems to weight more than an empty one. But that may just be a placebo effect.

    2. Re:Be careful! by Anonymous Coward · · Score: 5, Funny

      I can attest that improper bit stacking is a very real danger - one that almost cost me my life.

      It was in 1999 in Sierra Leone, and my last assignment before I left for Sydney was to punt three hundred reams of bit-printed A4 four kilometres up the Moa to a nearby monastery.

      It had been a hectic week and the crew the boss had assigned to load the raft had already worked a double shift. Subsequently, they failed to read the job sheet properly and loaded the raft with the all the paper with the zero-bit set on one side and the one-bit set on the other.

      I got about three hundred meters from the dock when I was startled by a large black snake swimming past. I quickly moved from where I was sitting on the zero-bit stack to the one-bit stack, and of course the raft immediately capsized.

      I was told when I reached the shore that the snake had most probably been a mamba - one of the deadliest snakes in Africa. If I had been bitten I would have been dead within minutes.

      I hope this serves as a warning to anyone involved in any kind of data stacking. In short, always properly disperse your bits - your life may depend on it!

    3. Re:Be careful! by Anonymous Coward · · Score: 0

      why the snake has gotta be black?

    4. Re:Be careful! by Anonymous Coward · · Score: 1, Funny

      Virus: Let me trim the FAT off your hard disk. (Also works for solid state drives that support TRIM operation.)

      By the way, compression makes your data occupy less space, by converting all the bits from 0 to 1. Because 1 weighs less. Also, it makes the hard drive faster (after defrag) because 1 is more aerodynamic than 0.

    5. Re:Be careful! by sskinnider · · Score: 1

      At 15000 RPM, these things are deadly when they break up.

    6. Re:Be careful! by Anonymous Coward · · Score: 0

      Wh. Oo. Sh.

    7. Re:Be careful! by scrib · · Score: 1

      If you write the heavy bits on the inside tracks it reduces the rotational inertia, too. This leads to faster spin up and shorter boot times! It's why optical disks all store their data starting near the hub - nulls have no mass.

      --
      Help! Help! I'm being repressed!
    8. Re:Be careful! by Anonymous Coward · · Score: 0

      I thought that was the platter spinning up.

    9. Re:Be careful! by gardyloo · · Score: 3, Funny

      Oh, hell yeah. Sometimes on a slow day, when there's little wind and a crowd outside the building, my colleagues will send around a bunch of emails full of ones. The cables outside twist and swing, and people look around for the source of wind.

          Those recent communication satellite crashes? Too many ones got in their relay buffers, weighing them down and destabilizing their orbits.

           

    10. Re:Be careful! by Anonymous Coward · · Score: 0

      cuz it be in Africa!

    11. Re:Be careful! by jokkebk · · Score: 1

      Your story, sir, is just not plausible. You really had me going with the monastery stuff (monks need their ones and zeroes), but everyone knows printed zeroes weigh more than ones. See: 0, 1!

      OTOH: On a hard drive, it's all digital so ones and zeroes generally have the same weight, the difference comes whether they are just random noise or contain valuable information - for example the entire library of congress stacked on one platter would need to be padded out with proper amount of useless stuff like slashdot comments and lolcats. This is consequently also why writing ones and zeros directly to the platter without having a hard drive controller circuitry handling error correction and lolcats is a really bad idea.

      It all makes sense when you really think of it!

      --
      http://codeandlife.com
  19. Hm ... by garry_g · · Score: 5, Insightful

    This kind of copy protection has been outdated for quite some while and should have died with floppy disks ...

  20. Tell us your project? by marcansoft · · Score: 5, Insightful

    These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?", where XYZ is one or more of complicated, ridiculous, vague, nonsensical, etc. Try telling us what your project is, and then we might be able to suggest a useful solution, possibly not involving XYZ at all, or involving a very particular/practical version of XYZ.

    1. Re:Tell us your project? by xtracto · · Score: 1

      What you don't know is that his project is the implementation of an übersecret disk-writing algorithm to millionuple the speed of access to your hard drive.

       

      --
      Ubuntu is an African word meaning 'I can't configure Debian'
    2. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Sounds like he is trying to develop a new hard disk firmware...

    3. Re:Tell us your project? by hany · · Score: 1

      patent pending, copyright, TM, ... :)

      --
      hany
    4. Re:Tell us your project? by Scutter · · Score: 4, Insightful

      These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?", where XYZ is one or more of complicated, ridiculous, vague, nonsensical, etc. Try telling us what your project is, and then we might be able to suggest a useful solution, possibly not involving XYZ at all, or involving a very particular/practical version of XYZ.

      Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

      --

      "Tell me doctor, with all of your defenses, are there any provisions for an attack by killer bees?"
    5. Re:Tell us your project? by QuoteMstr · · Score: 0

      Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

      If he fucking wants a yes man, he can pay for one.

    6. Re:Tell us your project? by visualight · · Score: 1

      You're confused. Maybe your one of the hundreds of people that post 'answers' in community forums, "Don't do that, never do that. Do this instead". In any case, what you're posting here today isn't a yes, it's a no.

      --
      Samsung took back my unlocked bootloader because Google wants me to rent movies. They're both evil.
    7. Re:Tell us your project? by Hurricane78 · · Score: 1

      I disagree. The actual project is completely irrelevant. There is such a thing as a generic solution to a problem. Which usually is the best/most elegant one by definiton.

      Your inability to think up generic solutions is rather your own shortcoming.
      I already provided a good genetic solution below. So as you see, it’s not that hard.

      I bet you’re someone who doesn’t try to find a general algorithm, but will have a huge list of a thousand IF/ELSE statements with custom solutions. ;)

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    8. Re:Tell us your project? by Anonymous Coward · · Score: 0

      absolutely, is he trying to get a geometric magnetic pattern on the disk, etc ... I don't care if it's to fake a RFID, or other key, but it does help understand what he's really trying to achieve

    9. Re:Tell us your project? by mikael_j · · Score: 2, Insightful

      I bet you're one of those people who force the rest of us to post extremely long and verbose questions on forums, IRC and mailing lists because you always come up with completely irrelevant answers if you don't get a wall of text explaining in detail why someone is looking for a specific type of solution (and even then you probably try to sneak in your irrelevant suggestions).

      An example of what I meant by the above: Let's say you have a motherboard where you need to update the BIOS, the computer has no optical drive, no floppy drive and you have no USB memory sticks available, the machine is using grub2 and you're looking for a way to flash the BIOS anyway to get around some silly bug without having to wait until monday morning so you can buy extra hardware just to flash the BIOS. The correct answer would then be something like "Check out flashrom, you should be able to flash the BIOS directly from Linux without even rebooting then". The answers that are likely to show up on any random *nix forum or IRC channel are:

      1. Get a new motherboard
      2. Get a CD-RW drive
      3. Get a USB memory stick
      4. Get a floppy drive
      5. Edit /boot/grub/menu.lst (no can do since it's grub2) and make a FreeDOS boot floppy (right after you replace your boot manager just so you can do a one off BIOS flashing, yay)
      6. Install Windows
      7. Create a FreeDOS boot floppy (see: No floppy drive)
      8. etc ad nauseum...

      In fact, even if you explained all the above chances are some people would still give stupid advice and sometimes it's even beneficial to not explain yourself because you know from experience that 90% of those who read your question don't know enough about the subject matter to understand it and will instead give irrelevant answers.

      /Mikael

      --
      Greylisting is to SMTP as NAT is to IPv4
    10. Re:Tell us your project? by Anonymous Coward · · Score: 0

      What is this XYZ project you speak of - I'm interested in complicated, ridiculous, vague, nonsensical stuff - where do I sign up ? - is it open source?

    11. Re:Tell us your project? by Lehk228 · · Score: 5, Insightful

      nobody has the solution he requested, because the solution he requested is stupid.

      --
      Snowden and Manning are heroes.
    12. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Yeah so the majority of people are stupid... what a great new finding. Be sure to publish it properly!

    13. Re:Tell us your project? by Bicx · · Score: 1

      Seriously. I hate it when someone asks how to accomplish a particular task and simply gets bombarded with remarks like "Why would you want to do that?," "LOL just use Python, it does it in two lines of code," etc...

    14. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

      Alternatively, he doesn't know what he's talking about, maybe some kid with no experience? Whereas stating what the project is, what it needs to do, to several thousand highly skilled and experience people in the same field, is likely to reveal a lot of useful information and suggestions from those that have already been down the road.

    15. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Amen. I get tired of asking questions about things on the Internet (with me being an expert) and have some idiot telling me "You don't want to do that". You're exactly right. If they don't want to help the guy with his personal goals, then they should not even bother replying. sheesh.

    16. Re:Tell us your project? by Hognoxious · · Score: 2, Interesting

      Except he doesn't want your alternate solution. He wants the solution he requested.

      And I want a pony. Point is, nobody at all can understand a good reason for doing it, so that tends to make people think he's jumped prematurely to a diagnosis - fussing about "how" before he's really sure "what".

      He's stating a half-assed solution, rather than expressing what the problem is - for which the best solution might be entirely different.

      http://catb.org/~esr/faqs/smart-questions.html#goal

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    17. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Nonsense, OP is right. There is a problem to be solved here, but it's clearly not "how do I write a single bit to a drive" - especially since there is no such thing as a "single bit" on any kind of magnetic drive, even going back to single-density FM floppies.

      The idea of placing the bit "precisely" is also naive when you consider clock variance and mechanical wobble. What precision is required? 1mm? 1um?

      This Ask would certainly be a lot easier to answer if more details about the raison d'etre existed.

      I suspect he's just playing around for fun, in which case he needs to read a book about FM floppies and the 34-pin interface, buy a 5 1/4" drive and some discs, then get an Arduino and program it to talk to the drive.

    18. Re:Tell us your project? by j00r0m4nc3r · · Score: 1

      nobody has the solution he requested, because the solution he requested is stupid.

      Unless the solution is part of building a time machine. Or a donut replicator.

    19. Re:Tell us your project? by marcansoft · · Score: 0, Offtopic

      He didn't even ask for a solution, he asked for a way to accomplish a poorly specified abstract task that is nontrivial. It's pot luck whether a solution will be valid, and chances are it won't, unless he explains the actual project. For example, if he's trying to test modern disk error correction by introducing errors, suggestions such as "use an old 20MB drive" are useless; on the other hand, if he is just experimenting with magnetism on a drive (e.g. even trying to write "analog" audio data onto a platter) then making his own drive controller for a modern drive is both ridiculously complicated and probably worse than just feeding audio data to an old stepper drive's heads.

    20. Re:Tell us your project? by peragrin · · Score: 1

      Except in this case the industry hasbeen moving away from just such things. Drive firmware, os drive interface, file system, os file system API, etc.

      While it may not be what he wants. I can basically say that it probably has been tried before and it sucked back then and it still sucks now. Manually editing 8 trillion bytes plus error correction found on the typical 100gb hard drive just sounds like he is asking for something stupid and expensive.

      If he had any real idea of what is involved he would be asking seagate or western digital not slashdot. Therefore he is a moron

      --
      i thought once I was found, but it was only a dream.
    21. Re:Tell us your project? by cpartrid · · Score: 1

      If you are asking for help it sometimes requires offering a bit of incentive is nice. Sometimes all the incentive that's needed is an explanation of why? While there are some people who are happy to spend their time coming up with solutions to acomplish and arbitrary task just for the sake of the challenge, other people would rather not waste their time doing that if the actual problem could have been fixed in an entirely different and esier way. So it would seem that as the OP you would have more chance of getting a useful reponse if you offered some sort of backgorund. You should also consider that it might just be the case that the OP would be happy with an alternative solution to the problem if one was forth coming. Anyway, I know absolutely nothing about HArd Drives at this level so have no useful input.

    22. Re:Tell us your project? by marcansoft · · Score: 1

      There is such a thing as a generic solution to a problem.

      There is no generic solution to this problem (or, equivalently, there are many useless ones). The problem is so open-ended and poorly defined that there are dozens of solutions that strictly speaking meet the requirements, yet the chances of them actually working for his project are slim. If you think you can provide a solution, you're making many assumptions about the project.

      I bet you're someone who writes an expert system instead of actually solving the task you set out to do.

    23. Re:Tell us your project? by Mashdar · · Score: 1

      nobody has the solution he requested, because the solution he requested is stupid.

      Amen.

      There is no advantage in the world to writing a specific bit to a specific location, when physical locations are already mapped byte-wise to an address space. Oh, you several single-bit data to write? Use XOR and do it like anyone who ever had to set/clear flags on a micro-controller does. And if this causes you to have to cache (gasp) seven bits of data waiting for the eighth, GOOD.

      PS I doubt that there is a GP processor on the planet which does bit wise operations with a single-bit register. Maybe if you have a very weak computer from 1950...

    24. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Doesn't it seem odd that he's been tasked with a project that absolutely requires very low level control over hardware, but he's asking how to even go about this on Slashdot??

      That suggests to me that this project might not be fully thought out, and that there may very well be an alternative solution that is much more viable.

    25. Re:Tell us your project? by Anonymous Coward · · Score: 0

      Perhaps it's not the request that is stupid, but you who are stupid.

      There can be a very valid reason for wanting to write the specific bits at specific locations on the HDD platter. It's most likely that you are just too simple-minded to comprehend them.

    26. Re:Tell us your project? by IICV · · Score: 3, Insightful

      This bash quote is, I think, appropriate:

      <glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"
      <glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers

      When someone comes in with a question like this, it is entirely worth asking what he's actually trying to accomplish - because writing ones and zeros directly to a hard disk platter is the deepest sort of black magic, and there's absolutely no reason why this is the only way to accomplish what he wants to do.

    27. Re:Tell us your project? by Anonymous Coward · · Score: 0

      non sequiter

    28. Re:Tell us your project? by Xorlev · · Score: 1

      nobody has the solution he requested, because the solution he requested is stupid.

      You don't know why he wants it, but it's possible as long as he can replace the firmware. As stated above, Seagate et. all usually can help with unusual firmware requests.

    29. Re:Tell us your project? by Sneftel · · Score: 1

      The solution he requested is stupid, because I don't have the solution he requested.

      Fixed that for you.

      --
      The opinions stated herein do not necessarily represent those of anybody at all. Deal with it.
    30. Re:Tell us your project? by Dammital · · Score: 1

      These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?"

      There's a technical forum that I frequent where it is rather common for someone to ask "How do I do XYZ", and also rather common for the people who don't know how to do XYZ to demand "what are you trying to accomplish" or "why do you want to do XYZ?"

      If a responder doesn't know how to answer a question, then he should just move along -- not try to change the question to something he does know the answer to.

    31. Re:Tell us your project? by TangoMargarine · · Score: 1

      I ask how to do stupid things in CS classes on a fairly regular basis, just so I can understand the way stuff work. And let's not forget the classic nerd answer, "because I can." Although if this is in a research context, obviously it doesn't apply.

      --
      Unity? Screw that: XFCE. Slashdot Beta? Screw that: SoylentNews. Australis? Screw that: Pale Moon. UX developers DIAF
    32. Re:Tell us your project? by Anonymous Coward · · Score: 0

      and your deep knowledge of the problem is what entitles you to say that his solution is stupid
      hell, maybe once you hear the problem you find out that it's an incredibly creative solution that you'd have never came up with.
      He asked a question, either answer it or don't, but there's no reason to judge.

    33. Re:Tell us your project? by marcansoft · · Score: 1

      There's a reason why I qualified "How do I do XYZ" with "for a project" (implying a higher goal that is nonetheless unstated) and "where XYZ is one or more of complicated, ridiculous, vague, nonsensical", such that answering is difficult and/or would prove useless most of the time. This isn't a case of a straightforward question being left unanswered; there is a genuine need to know more about the project in order to provide a reasonable and useful answer.

    34. Re:Tell us your project? by Anonymous Coward · · Score: 0

      If a responder doesn't know how to answer a question, then he should just move along -- not try to change the question to something he does know the answer to.

      Many of use work in IT and are regularity asked to help someone do something very difficult or practically impossible. I'd be worthless at my job if my response to such requests was, "Sorry, no idea." Or worse, to actually send someone down a long time-wasting road. Instead, I start asking questions, generally, "Why do you want to do that?" In the end a simple solution is often found and everyone is happy. Why should this situation be any different?

      I know some IT people lack any form of creativity and simply follow requests literally. I work with a few and their productivity is very low. You job isn't to just follow rules, but to maximize your contribution to your organization.

    35. Re:Tell us your project? by dominious · · Score: 1

      Exactly. I hate people when they accuse others for being stupid when they have no idea what the real purpose of the project is. Who knows? ok not a time machine, but it could be something completely different from what someone thinks and quite interesting all together.

    36. Re:Tell us your project? by marcosdumay · · Score: 1

      I don't know... He probably won't get the answer he needs because he didn't ask the right question. But that is an interesting question nonetheless and the comentary may benefit other people.

      I tought on a way to solve a problem of mine by just reading it, and thinking on how hard drivers work.

    37. Re:Tell us your project? by Carnildo · · Score: 1

      Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

      Except that odds are he doesn't want the solution he requested. Odds are, he wants to accomplish some higher-level task, and has prematurely decided that writing bits directly to a hard drive platter is how to do so.

      I frequent a Macintosh programming forum. It's very common for people to ask "how do I do X?" (the usual formulation is "how do I get another program's window?"), where the correct answer is "you can't". After a few days of back-and-forth, it usually develops that X is a low-level step in accomplishing some higher-level task in Windows, and the question the person wanted to ask is about something quite doable on MacOS, such as "How do I send synthesized keystrokes to another program?" or "how do I hide another program?".

      --
      "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
    38. Re:Tell us your project? by Anonymous Coward · · Score: 0

      These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?", where XYZ is one or more of complicated, ridiculous, vague, nonsensical, etc. Try telling us what your project is, and then we might be able to suggest a useful solution, possibly not involving XYZ at all, or involving a very particular/practical version of XYZ.

      Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

      This is a very common problem in IT. People think they want solution X to problem Y. So they request solution X from the IT manager. Since the client doesn't know IT, they don't know why it won't work to solve problem Y.

      If they have a good IT manager, they get asked why they need X, and the manager (or their staff) can analyse problem Y to see if X is in fact correct, or if A, B, or C would be a better solution.

      If they have a bad IT manager, they get solution X. This may or may not work, and often has them going back to the IT manager saying why didn't X fix my Y? This is the point at which the IT manager explains why it's better to come to them with a problem instead of a solution.

    39. Re:Tell us your project? by Cwix · · Score: 1

      I suppose if he knew how to do that, then he wouldn't have a question on how to write to the disk.

      --
      You are entitled to your own opinions, not your own facts.
    40. Re:Tell us your project? by Lehk228 · · Score: 1

      but you gain nothing from it, looking for a harddrive controller that does all the drive voodoo EXCEPT the logic parts?

      now getting a hard drive to input / output the A/D signal strength instead of the interpreted bits would be nifty for learning.

      --
      Snowden and Manning are heroes.
  21. If you have to ask, it's hopeless by vadim_t · · Score: 4, Insightful

    "I'm working on a project to build a nuclear powerplant. Is there documentation on how to do it? Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

    It seems to me that if you're involved in such a project and have to ask how to do it, it's doomed.

    Also, the whole idea of it seems rather impossible. Why would you want to do this in the first place? Have in mind that hard disks don't write bits as is, not just because of ECC. They use an encoding to ensure that there are no long strings of 1s or 0s. If you just wrote some data without regards to that you'd run into a sequence you'd be unable to read later, due to not having a clock signal to figure out where a bit ends and the next begins.

    Modern hard disks require using special encodings and servo data in order to be readable at those densities. It just makes little sense to me to want to bypass it. Unless you're working for a disk manufacturer this just seems very odd, but in that case you'd have access to the required equipment and information.

    1. Re:If you have to ask, it's hopeless by infalliable · · Score: 1

      One simple reason is to study the bit error rates caused by/associated with various write patterns. If you can't control the write pattern, you can't do it.

    2. Re:If you have to ask, it's hopeless by SkipF · · Score: 1
    3. Re:If you have to ask, it's hopeless by Anonymous Coward · · Score: 0

      lol

    4. Re:If you have to ask, it's hopeless by vlm · · Score: 4, Insightful

      It seems to me that if you're involved in such a project and have to ask how to do it, it's doomed.

      Agreed, except that he may only need that initial kick to find terms to google.

      For example, I know that to do what he wants, he needs to learn about the MFM vs RLL interfaces from the mid 80s, not because he will emulate either, but if he doesn't understand both and how they worked and relate to each other, he's has no chance. He is more or less trying to make a hard drive version of the catweasel floppy controller. If he never heard of a catweasel he would have a hard time figuring out he needs to learn about it.

      Image scans from the very detailed technical manuals for DEC's minicomputer hard drives are available online. This is from the era of individual TTL chips, he's basically going to replicate / emulate / reverse engineer that hardware into his microcontroller in order to write individual 1/0, after all they had a solution that worked 40-50 years ago. If he didn't already know that, he would have a hard time figuring out he needed to know that.

      Now if he already knows that stuff, and is really asking how to get MPLAB working so he can program his PIC, well yeah then he's well and truely lost.

      But given those first steps/hints, I think a reasonably experienced EE/CE type could probably figure out the rest of it.

      Adding to your nuclear analogy, if someone went back in time and told folks after 1920 to play with neutrons and U-235, they would get quite the head start on the rest of the world that didn't get that idea to try that until much later. They had all the prerequisites by 1920 but it took many years to get the right combination of ideas...

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    5. Re:If you have to ask, it's hopeless by clyde_cadiddlehopper · · Score: 1

      Next request ... "I am working on a project to understand women (or men). Is there documentation on how to do it? Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

      --
      Obi-Wan: "I felt a great disturbance in the Force, as if millions of voices suddenly cried out in terror and were sudden
    6. Re:If you have to ask, it's hopeless by Anonymous Coward · · Score: 0

      Also keep in mind that some sectors in modern hard drives are reserved for the drive to boot. You wont be able to control all the sectors.

    7. Re:If you have to ask, it's hopeless by gnieboer · · Score: 1

      "If you have to ask, it's hopeless"

      Seriously??

      Pretty much any major scientific endeavor started off with individuals with only a vague clue how to accomplish the task they wanted to complete. While I'm sure sometimes scientists slave away in private, most commonly they collaborate with their peers/co-workers to bounce ideas and seek inspiration.
      I would say:
      "If you don't have to ask, you aren't reaching high enough"

      And actually there have been a couple plausible suggestions floated here, so it'd definitely not impossible (RLL/MFM HDD, floppies, custom firmware)

    8. Re:If you have to ask, it's hopeless by vadim_t · · Score: 1

      "If you have to ask, it's hopeless"
      Seriously??

      Quite, yeah.

      Pretty much any major scientific endeavor started off with individuals with only a vague clue how to accomplish the task they wanted to complete. While I'm sure sometimes scientists slave away in private, most commonly they collaborate with their peers/co-workers to bounce ideas and seek inspiration.
      I would say:
      "If you don't have to ask, you aren't reaching high enough"

      Well, this works for when you have a real dedication to something, and are willing to spend years or a lifetime on it. But I doubt that's the case here.

      The question seems to me like the sign of lack of research. Before signing up for a project like that, you should figure out whether it's technically doable, and whether you have at least in theory the knowledge and skills to accomplish it. It looks like the submitter doesn't.

      If your life's goal is to write a game, then yeah, you can go to a programmer, ask what is needed to make a game, learn programming, study computer science, learn enough math/physics/etc for the kind of game you want, and get it done, maybe 5-10 years later.

      But if you've got a job, you've been given a project to make a game and know so little that you can only make a very general "how do I make a game?" question, then you're completely screwed, as nobody is going to wait for you to figure all that out, and unless you really, really want to do it like above, you won't have the commitment either.

      And actually there have been a couple plausible suggestions floated here, so it'd definitely not impossible (RLL/MFM HDD, floppies, custom firmware)

      Sure, but if the submitter could actually pull it off they'd be asking a different question. It wouldn't be "how do I write arbitrary bits to a disk platter?", it'd be something a lot more specific, like "I'm using a MFM controller, want to get X done (detailed explanation), do this (detailed explanation), and get this result, which is not what I want. Why is it doing that?"

      But with the question being made here it seems very likely that if you gave them a MFM drive and controller they wouldn't know what to do with it.

    9. Re:If you have to ask, it's hopeless by alder · · Score: 1

      if he already knows that stuff, and is really asking how to get MPLAB working so he can program his PIC, well yeah then he's well and truely lost.

      The "request for information" about controlling "bits" on a platter also brought up a file system... along with the idea that it, the file system, controls positions of those "bits"... "Truly lost" would be a nicer outcome, I'm afraid it is much much worse than that.

      However, and due to the lack of a useful information in the request this would be a very wild guess, maybe he did not really ask about "bits" and about positions of those "bits". Maybe the question rather was about the writing to the hard drive bypassing the file system and the cache. In this case he only needs to read about O_DIRECT or "raw devices" while they are still in the kernel. That is if he understands, or is able to find out, that one cannot and should not assume anything about the physical layout (number of platters, heads, cylinders and sectors) of a hard drive.

    10. Re:If you have to ask, it's hopeless by noidentity · · Score: 1

      Exactly. Sort of like how optical discs don't have bits directly encoded, instead pits and lands of varying lengths along the spiral. The guy is looking for things that just aren't there (except maybe on really old hard drives).

    11. Re:If you have to ask, it's hopeless by jez9999 · · Score: 1

      Also, the whole idea of it seems rather impossible.

      I think everyone's missing the rather obvious answer here: butterflies.

    12. Re:If you have to ask, it's hopeless by dominious · · Score: 1

      people like you are very narrow minded. you use words like the project is doomed, why would you want to do this in the first place etc... He knows why he wants to do it in the first place. That's not the point. He tried for some help that maybe will save him some time. But if he doesn't find it then he can go on and do some research on his own and spend some more time on it.

    13. Re:If you have to ask, it's hopeless by dominious · · Score: 1

      you are wrong

    14. Re:If you have to ask, it's hopeless by dominious · · Score: 1

      Also this guy just summed it up for /.

      http://slashdot.org/comments.pl?sid=1569010&cid=31344062

    15. Re:If you have to ask, it's hopeless by vadim_t · · Score: 1

      Fine, if we're going to do it this way:

      I disagree, and:

      What the reply to the post you linked said

      This looks like it's going to be a really exciting conversation.

    16. Re:If you have to ask, it's hopeless by Josef+Meixner · · Score: 1

      in order to write individual 1/0, after all they had a solution that worked 40-50 years ago.

      Sorry, but that is simply not true. Not even with MFM you could control the exact layout of 0 and 1. A 1 is signaled by a level change, the zero just keeps the last level. There are limits on how long you can go on without a level change (the level change is used to synchronize the clock). So even that stone old technology wouldn't work in the specified way, after a certain "number" (rather length depending on the clock of the system) of one kind of magnetic domain a change has to occur. And as long as the system doesn't have an alternate system to get the clock information, you will always run into the same issue. You could perhaps use one platter as "clock platter", but if that would work with the heads, I have no clue. In the past I doubt anybody would have used something like that as it wastes a lot of space.

  22. Re:DD by dotgain · · Score: 5, Insightful
    Read the summary - there's a lot more going on with the data after 'dd' has done with it. Even if I write a continuous stream of zeroes to the disk, that's not what will wind up on the disk. For some reason we've yet to establish, he wants direct control over exactly what bits are recorded where. Unfortunately, doing this will mean it'll be damn near impossible to read the data back, as there will now be no reliable way to determine what track / sector we're located at. There'll be no means to detect errors, let alone correct them. He probably won't even be able to verify what he's just written.

    I'm actually more interested in why the fuck he wants to do this, much less how it would be achieved.

  23. Talk to Steve Gibson author of Spinrite by Anonymous Coward · · Score: 0

    The person who would probably know for sure if it is even possible to achieve that level of control is Steve Gibson from grc.com, the author of Spinrite http://www.grc.com/sr/spinrite.htm. Spinrite has some amazing low level hard drive access, that it uses for data recovery and drive maintenance.

  24. Re:DD by Lord+Byron+Eee+PC · · Score: 2, Informative

    dd only bypasses the filesystem. It doesn't override the HDD firmware, which has to avoid bad sectors and write ECC information to the platter as well.

    I would love to hear why the submitter thinks he needs to write directly to the platter.

  25. Old IDE drives by AC-x · · Score: 1

    Can you tell us what it's for, or is it secret? I assume whatever you're up to involves the destruction of the HD in question?

    If you can find a working *very old* IDE drive (back from the era when they had bad blocks printed on the label that you had to map manually) I'd guess those use purely physical sector / block mapping.

  26. if you have time to waste... by chentiangemalc · · Score: 1

    somehow I doubt whoever is running this project hasn't heard of something called ROI. however if you have money and time to waste some options include: 1) find a better solution to meet your requirement - i.e. think "what is the end result I need to achieve" before thinking of the technical solution "how am I going to achieve this" 2) partnership with hard disk controller manufacturer 3) reverse engineer firwmare on a hard disk controller and remove any error correction code/etc (and take the data unreliability that comes with that) + create your code to actually write and read the disk. In addition this will lock your product to a particular model of a particular brand of hard disk. anyway if you ever succeed let us know how it was done.

  27. Re:Talk to Steve Gibson author of Spinrite by marcansoft · · Score: 4, Interesting

    The stuff Spinrite does stopped working 15 years ago. On modern drives you're pretty much doomed. Considering Gibson has been known to rip off SYN cookies and spout such nonsense as "Windows RAW sockets are going to destroy the internet", I wouldn't go anywhere near him for advice.

  28. You're doing it wrong! by sfraggle · · Score: 2, Insightful

    I need to be able to control exactly where 1s and 0s will appear physically on the platter.

    No you don't. Rethink what it is that you're actually trying to achieve and try again.

    --
    were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
    1. Re:You're doing it wrong! by Anonymous Coward · · Score: 0

      If you're trying to store analogue audio on the platter, for instance, yes. Yes you do. There isn't enough information in the OP to claim that he doesn't need to do this.

      Reference: http://hackaday.com/2009/04/24/analog-audio-recorded-on-a-floppy/

    2. Re:You're doing it wrong! by Anonymous Coward · · Score: 2, Interesting

      You can calculate this by finding out C/H/S parameters (and the physical dimensions of the platter(s)), calculating the LBA, reading the sector where the bit should 'appear' and rewriting it with the 'one' bit changed (ATA controllers read/write 512 bytes at a time (sector size)).
      Simple, LBA .

    3. Re:You're doing it wrong! by Tapewolf · · Score: 1

      At one point I was considering something like this as an alternative to a tape delay, something along the lines of the Binson echorec. However I didn't really have the electronics skill to pull it off unfortunately. I suspect you'd have an interesting time getting it the record bias right for a coating optimised for recording binary data rather than an analogue signal.

    4. Re:You're doing it wrong! by sfraggle · · Score: 1

      Neat hack, but the OP specifically mentions binary data ("writing bits ... in a completely controlled fashion", "1s and 0s") :-)

      --
      were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
    5. Re:You're doing it wrong! by Goaway · · Score: 5, Insightful

      And if he's trying to see if he can read data patterns off platters by hand from a dismantled drive, and needs a known test pattern to calibrate his equipment with?

    6. Re:You're doing it wrong! by machine321 · · Score: 1

      "It was horrible, ones and zeros everywhere... and I thought I saw a two!"

    7. Re:You're doing it wrong! by Anonymous Coward · · Score: 0

      If he is not smart enough to get the bits there, he's not smart enough to retrieve them, by definition.

    8. Re:You're doing it wrong! by Kagetsuki · · Score: 1

      Actually there is absolutely no reason you can't do this in memory and write it to a file. The bits within the file will be ordered, and as long as you aren't using an ancient machine or an underpowered micro controller putting that information back into memory and playing it should be trivial. I think the majority of people reading this who understand it realize that regardless of what the OP is trying to achieve he has some serious misconceptions about how files and file systems work. Or perhaps he does understand how file systems work and he is trying to develop his own, perhaps in a way that is somehow conceptually incompatible with drive access optimization techniques, in which case he needs to start contacting hard drive manufacturers and asking for samples and information. If he has some sort of revolutionary idea he should be able to get some cooperation from some company. If he still can't get support the using a virtual device in memory and creating a demonstration on that would be a good way to get adequate attention.

    9. Re:You're doing it wrong! by characterZer0 · · Score: 1

      Maybe he can get them off by dismantling the drive and he can already get them on by dismantling the drive but he was hoping for a cheaper and easier way to get them on.

      --
      Go green: turn off your refrigerator.
    10. Re:You're doing it wrong! by Rumata · · Score: 1

      And if he's trying to see if he can read data patterns off platters by hand from a dismantled drive, and needs a known test pattern to calibrate his equipment with?

      If that's the case he'll learn that reverse-engineering is hard. In this particular case nigh impossibly hard, if it needs to be done on modern hardware. As others have said easier on MFM drives.

    11. Re:You're doing it wrong! by Anonymous Coward · · Score: 0

      Then he will have to do a bit of trial and error to figure out what encoding schemes the hard drive itself uses, but he doesn't need exact control over what byte goes where. What he is looking for is something to get as close to the metal as he can (you know like using dd) and then trying for statistical analysis of the blocks he reads to calibrate. Yes it's not perfect, but it wont suffer from most of the problems you will encounter replacing the firmware o the drive, then not having it represent anything that you will ind in real life tests.

    12. Re:You're doing it wrong! by SirLoadALot · · Score: 1

      There are companies that do this professionally. It generally requires a clean room, although perhaps not as good as one required for other purposes. Also, if he has the equipment to read a platter himself (which I strongly doubt), writing should be just one more step -- mounting a write head.

    13. Re:You're doing it wrong! by vikingpower · · Score: 1

      That is the best suggestion I've read sofar in this discussion. I can only hardly imagine he is trying to do something else.

      Wait. Maybe he is an artist who tries to create fancy patterns of aligned magnetic fields on the platters in order to do something neat with it, later on ?

      --
      Religous speak to God. Insane are spoken to by God. When all shut up, one can finally hear Shostakovich in peace
    14. Re:You're doing it wrong! by B1ackDragon · · Score: 1

      Yeah, my first thought was that perhaps he is trying to test hardware longevity independently of error correction techniques (e.g., how many times on average can a particular bit be flipped before it's reading starts to degrade?) Perhaps even across different manufacturers or drive densities. This seems like it could be useful information to a) people who buy tons of hard drives and want to fine tune their reliability, or b) some enterprising young individual doing a science project, or c) what do I care why he wants to know?

      Seriously, why is everyone hating on him so much? Is this not slashdot?

      --
      The snow doesn't give a soft white damn whom it touches. -- ee cummings
    15. Re:You're doing it wrong! by Goaway · · Score: 1

      Seriously, why is everyone hating on him so much? Is this not slashdot?

      If you ever tried asking help for a complicated issue from a bunch of nerds, you'd know that the thing they like the most is telling you you are an idiot for wanting to do that, and that you should be doing something else. Obviously you could never have thought things through yourself in your tiny little brain. This is how one establishes one's own superiority over the lusers and idiots (that is, everyone else).

    16. Re:You're doing it wrong! by Goaway · · Score: 1

      By what definition would that be, then?

    17. Re:You're doing it wrong! by Anonymous Coward · · Score: 0

      This is why so many people ask "What are you really trying to accomplish" when presented with vague posts like this. IF that was what he were trying t accomplish, it'd be MUCH easier (relatively speaking) to ask the drive manufacturer what all the encoding's are, to determine for a given input, what will actually end up on the platter. Of course, drive manufacturers hold this type of information very close, and it'd involve much lawyer time, and money to actually get this information.

      The best answer I've seen here is the person who recommended contacting hard-core data recovery companies, like kroll ontrack. They DO have this information, but have very detailed contracts and NDA's in place with drive manufacturers and are simply not able to give out all the information to provide the vague requirements the poster has asked for. No current hard drive is capable in any way shape or form of doing what the submitter is asking. You need external, expensive hardware to do it. Not a disk drive.

      So, I am definitely int he camp of, that the H__L are you REALLY trying to accomplish. Artwork?

    18. Re:You're doing it wrong! by Anonymous Coward · · Score: 0

      And if he's trying to see if he can read data patterns off platters by hand from a dismantled drive, and needs a known test pattern to calibrate his equipment with?

      Then he's trying to re-create, from scratch, the accumulated knowledge of hard drive restoration. And his research involves asking Slashdot for advice instead of talking to people who know what they're doing, which doesn't bode well for his chances.

    19. Re:You're doing it wrong! by Eivind+Eklund · · Score: 1

      If you've been part of a group of geeks that gets asked for advice, you've also noticed that half the time people are asking for the wrong thing - they don't understand the tools available, and are trying to follow the first solution they thought of (a solution that is hard, while there exists easy ways to solve the same problem.)

      And in general it's a question of the people that ask having less experience than the people answering, at least in my experience.

      Though there's some that insist on keeping to their initial solution without giving the contextual information that's necessary to give a good solution to the problem - while harsher than I would have formulated it, I agree with your characterization of them as "idiots". And they're usually so arrogant that they think they just have to have "thought the problem through". (There's occasionally people asking how to do things the hard way for a good reason, too, but they're much less common.)

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    20. Re:You're doing it wrong! by SuperQ · · Score: 1

      After thinking about the original question a bit, I think the only actual goal here is to turn off sector re-mapping to prevent absurd seeking when streaming data to/from the disk. But as many other people have posted, most of what is being asked for is completely impossible with modern drives.

    21. Re:You're doing it wrong! by Hyppy · · Score: 1

      Even ext3/NTFS/whatever doesn't write ones and zeros directly to the hard drive. It goes through the controller, which intermingles the original data with multiple proprietary error correction algorithms and location information, and then spits it out to the platter. Once written, it isn't even ones and zeros. The heads themselves read the data as an analog waveform.

    22. Re:You're doing it wrong! by Goaway · · Score: 1

      Somehow people do ask me all kinds of questions, yet I can deal with it without being a goddamn asshole.

      You'll also find that if you show people respect and don't treat them like idiots, they'll be far happier to accept your suggestions.

    23. Re:You're doing it wrong! by Eivind+Eklund · · Score: 1

      I think what looks like a "goddamn asshole" is different from the inside and outside.

      Looking at it from my point of view, your two previous comments are filled with slurs, implied attacks, and go into the "asshole" category of behavior; but I expect they don't feel that way from the inside (for you).

      I hope the way I help/helped people feel reasonable to them (over the years, I've had quite a bit of thanks and very occasionally had people send me stuff as thanks), but it's hard to say from the inside - I know what intent I have behind each thing I write, so it naturally has a particular "inflection", while people can read it totally differently.

      If the above is obvious to you, you could try following your own advice (showing respect and don't treating people as idiots) - because showing respect and not treating people as idiots is obvious to me, but it's also obvious to me that a lot of people start out with a wrong idea and that's why the need help.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    24. Re:You're doing it wrong! by Kagetsuki · · Score: 1

      I'm sorry I should have been more clear: the bits will be ordered -within memory-. So when you put the information back into memory it will be ordered.

  29. I tried it once by Taco+Cowboy · · Score: 4, Funny

    Got myself a disk editor, and wrote something on the very first sector.

    After that I can't use the HD anymore.

    The computer can't even recognize it anymore.

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:I tried it once by lightversusdark · · Score: 2, Interesting

      I had a drive fail last year with some personally valuable information on (during the 3 hour window of time I had repurposed its backup drive for a data transfer - sods law, should have just gone and bought another drive).
      I ended up sending it to a data recovery company who told me that the first sectors were corrupt, which is where the "softest" part of the firmware was stored and consequently there was no possibility of recovering the data, even with a controller swap or extracting the platters.
      A friend of mine who works for the UK police data forensics team (paedo-investigator) said that other options that exist were mind-numbingly expensive.
      I guess this is what you did.

      --
      "There is nothing nice about Steve Jobs and nothing evil about Bill Gates." - Chuck Peddle
    2. Re:I tried it once by FuckingNickName · · Score: 1

      other options that exist were mind-numbingly expensive.

      I am confused. Erased firmware+metadata should be one of the least problematic things, unless that firmware happens to contain your only copy of some decryption key (yes, sector reallocation tables might be lost, but that accounts for a small proportion of data loss). In the generic case, attach a device in the middle which sends the software to the drive when it tries to read the initial sectors, and sends reads to the hard drive directly otherwise. This might not be practical for the home hobbyist, unless perhaps he is an electronics engineer, but a non-cowboy data recovery company would already use such equipment. Was it explained to you why it would be so expensive?

      Also, which drive is only keeping a single copy of firmware?

    3. Re:I tried it once by lightversusdark · · Score: 2, Interesting

      It's a Hitachi 2.5" 160GB manufactured in APR-07 labelled as having "Apple HDD Firmware 2006". It was from a white MacBook.

      The guys that looked at it (ABC Data Recovery in Sheffield) gave me the explanation above.

      My friend said that if that was the case, if the data could be extracted, it would have to be reconstituted by hand which would be expensive.
      He recommended MJM Data Recovery in Somerset to do this.

      --
      "There is nothing nice about Steve Jobs and nothing evil about Bill Gates." - Chuck Peddle
    4. Re:I tried it once by Anonymous Coward · · Score: 0

      How much valuable information could there have been put on this drive over the three hours that its friend was elsewhere? Couldn't it be reconstructed by re-entering (or whatever) the work over the past 3 hours? Or was it all dynamic web-transaction stuff? Even so, only 3 hours should have been lost.

    5. Re:I tried it once by Anonymous Coward · · Score: 0

      that is a funky one, you will have to restore the mbr sector and write a new partition table after that, else windows (at least before vista, don't know about that one and up) will never recognise it for sure.

      linux though doesnt care too much about it, using a boot disk you will always gain access to the harddrive except when your controller is broken (which won't happen through writing to the first sector some random data), so you can always use grub and company to restore a broken mbr (linux doesnt even care if you activate the hdd in the bios, it will be detected through analysing what the controller itself says)

      on the other side, (win)do(w)s fdisk /mbr might do the job already.... as long as it accepts that the harddrive is there (which doesnt mean that any drive letter is available yet, fdisk only has to list it and then you can go on) (you better boot from windows install disk and get into repair console for that one - too bad if you only got a recovery partition, but no windows install cd.... freedos might do the job as well, but i am really unsure about that one)

      the mbr btw (should) contain(s) a small boot loader which is being called by the bios to take over the reading of partition tables, detecting which one is the active one and getting the loader there into memory. you simply broke the code which does that and for whatever reason windows rejects harddrives with broken mbr code (though it does not when it contains root kit mbr code lol)

    6. Re:I tried it once by natehoy · · Score: 1

      If the backup drive was repurposed, it probably didn't contain any backups at all for that three hours. In other words, he wiped his only backup to complete a data transfer, and Murphy caught him at it and made sure the now-unprotected original got tossed into the bit bucket.

      In retrospect, not a smart thing to do, but how many people run with no backups AT ALL, and what are the odds of losing your primary drive during a 3 hour window?

      --
      "This post contains words, known to the State of California to cause thought. Wash brain thoroughly after reading."
    7. Re:I tried it once by Chaos+Incarnate · · Score: 1

      It sounds like its friend was wiped before being taken away for those three hours (with the intent of restoring it afterward).

      --
      Benford's Corollary to Clarke's Law: "Any technology distinguishable from magic is insufficiently advanced."
    8. Re:I tried it once by Anonymous Coward · · Score: 0

      Windows? Try fdisk /mbr

      Otherwise

      Get a Linux live cd, say "dd if=dev/zeros of=/dev/sda count=1000000 bs=512 " (sda if first scsi/sata drive, sdb if second scsi/sata drive, hda if first ESDI drive, hdb second etc.). Then use the live cd fdisk to repartition, it'll complain but work fine anyway.

    9. Re:I tried it once by xOneca · · Score: 0, Offtopic

      That's not funny, you insensitive moderators!

    10. Re:I tried it once by Anonymous Coward · · Score: 0

      I believe ESS Data Recovery could do this (www.datarecovery.com). There is a chance it could come out in some form of raw recovery (missing some directory structure or file names perhaps) but you'd still get your data. Data recovery is pricey, so might be more than you're expecting, but there isn't really a way around that when a company like this has to support the capabilities it does. There aren't that many companies around that can do things the top tier companies can.

      sorry for AC

    11. Re:I tried it once by Anonymous Coward · · Score: 0

      Very funny!

    12. Re:I tried it once by Anonymous Coward · · Score: 0

      All seagate drives appear to have a 3,3V serial interface that can be used to diagnose and modify the various settings/controllers/firmware images on the drive, including the "proper" firmware that is stored in some reserved location on the drive itself (as opposed to the flash based firmware that can only bootstrap the real thing). There's some info how to interface with it here.

    13. Re:I tried it once by netsharc · · Score: 1

      On the topic of encryption, I think all modern drives do that anyway, with the decryption key either stored passwordless, or stored encrypted using a user-modifiable password - this is done so a user can quickly change the password in BIOS without needing to decrypt and re-encrypt the whole disk, just the decryption key.

      Neat huh? Finding citation is an exercise left to the reader!

      --
      What time is it/will be over there? Check with my iPhone app!
    14. Re:I tried it once by Anonymous Coward · · Score: 0

      linux though doesnt care too much about it, using a boot disk you will always gain access to the harddrive except when your controller is broken (which won't happen through writing to the first sector some random data), so you can always use grub and company to restore a broken mbr (linux doesnt even care if you activate the hdd in the bios, it will be detected through analysing what the controller itself says)

      Linux has as much access to the whole disk as any other OS. If one meant the partition table got corrupted then, yes, it's recoverable still.
      The real problem would be if the "private" part of the disk gets corrupted, particularly the part where the firmware resides. If you damage that, the disk is gone.

      I suppose there's a way to rewrite the firmware section, but certainly it is vendor-specific and not documented.

    15. Re:I tried it once by MistrBlank · · Score: 1

      Which is why now I have a time machine drive for myself, and one for my wife's macbooks and then another drive in between that's big enough to store the contents of the two in the event that it all goes kaput. ...except that drive was a seagate 1.5TB and is now headed back after the click of death started. At the very least though, we both still have our backups and we're being extra careful in the meantime.

    16. Re:I tried it once by Anonymous Coward · · Score: 0

      but a non-cowboy data recovery company would already use such equipment. Was it explained to you why it would be so expensive?

      Spastic.

    17. Re:I tried it once by Anonymous Coward · · Score: 0

      Insensitive cloderators!

  30. Hmmm. The twisted, it is strong in this one. by Noryungi · · Score: 4, Insightful

    Short answer: no, it's not possible to do that. It's not impossible, simply incredibly hard to do. Unless you happen to be very handy with a soldering iron and go dumpster-diving in the backyard of an HDD company (as many others have pointed out).

    Longer answer: how about creating a 'virtual' hard drive? There are utilities out there that probably let you create (a) a virtual interface (let's say IDE) and (b) a virtual hard drive, attached to said interface. The next step, of course, is to hack these (VirtualBox?) in order to make them do whatever it is you want them to do. This being said, I strongly suspect it involves non-trivial virtual machine hacking and that it probably does not respond to whatever your needs are.

    Other than this (very twisted) idea, sorry, bare metal writing has been disabled a long time ago, and for good reasons, too.

    --
    The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
  31. Tape by Anonymous Coward · · Score: 0

    Use a linear tape drive, you'll be able to control exactly where the ones and zeroes are on the tape. ...Oh, platter? Fuck that.

  32. Solution: by VulpesFoxnik · · Score: 5, Informative

    Old MFM hard drive should do the work. The entire device was controlled via software in dos. I have one lying around. A whopping 5 MB!

    http://en.wikipedia.org/wiki/Modified_Frequency_Modulation

    Now all you need is a 8 bit ISA slot and you are set.

    --
    RES PUBLICA NON DOMINETUR
    1. Re:Solution: by langelgjm · · Score: 1

      Now all you need is a 8 bit ISA slot and you are set.

      Won't a 16-bit slot do just as well? AFAIK, it's backward compatible.

      On another note, projects like this (well, not exactly like this, but "hard hack" or bottom-up projects) tend to rely on what is now obsolete hardware. While reading through the "Will the serial port ever die" article the other day, I kept thinking about how useful the serial port is for people interested in microcontrollers or any kind of custom made hardware. Back in high school, I built the serial "black cable" to hook up my TI-86 to the computer. Later, I used it to program Basic Stamp clones and PIC microcontrollers.

      Same goes for the parallel port... utterly simple to interface with, if you quickly want to throw together some basic hardware. I'm no engineer, but I was able to build the hardware and write enough code to function as a driver to read data from a magnetic stripe card reader into the parallel port. Today, if I had to do the same task via USB, the hardware alone would be much more complex... I'd probably need a microcontroller to sit between the reader and the USB port, instead of directly tying the two.

      You can pick up prototyping boards that fit directly into ISA slots. You can also get them for PCI, but level of complexity begins to increase. What about PCI express?

      Obviously the cost of microcontrollers that have built-in USB capability has dropped, but as consumer-level technology advances, does it become less friendly to homebrew and DIYers?

      --
      "Anyone who [rips a CD] is probably engaging in copyright infringement." - David O. Carson
    2. Re:Solution: by Anonymous Coward · · Score: 0

      Actually it was controlled by the BIOS not DOS and any ISA (8/16 bit) or VLB http://en.wikipedia.org/wiki/VESA_Local_Bus slot will do.

    3. Re:Solution: by Anonymous Coward · · Score: 0

      On another note, projects like this (well, not exactly like this, but "hard hack" or bottom-up projects) tend to rely on what is now obsolete hardware. While reading through the "Will the serial port ever die" article the other day, I kept thinking about how useful the serial port is for people interested in microcontrollers or any kind of custom made hardware. Back in high school, I built the serial "black cable" to hook up my TI-86 to the computer. Later, I used it to program Basic Stamp clones and PIC microcontrollers.

      Synchronicity. At the same time you were reading "Will the serial port ever die", I was thinking about RS-232 serial ports on modern hard drives.

      Then this nut shows up on Ask Slashdot, wanting to go one level even deeper down the rabbit hole of abstraction layers :)

  33. DRM? by ilo.v · · Score: 5, Interesting

    The cynic in me wonders if he is working for some hack start-up company trying to develop a DRM scheme for a hard drive, similar to the crap the studios do to DVD's to make them difficult to rip. Typically this involves creating some sort of currupt/invalid area on the disk that your particular device will know to ignore, but will lock up anyone else trying to read the data off the drive.

    The optimist in me wonders if he is trying to defeat such a scheme.

    1. Re:DRM? by Anonymous Coward · · Score: 0

      I think it's probably a first-year PhD student. Look at all the layers of abstraction and technology needed to go from magnetic bits to "fread"/"fwrite"!!!! Wouldn't it be faster or more power-efficient if the HDD controller understood the filesystem and serviced the system calls directly?!?! Wouldn't it?!?!

      My gut feeling is "probably not". But the way to find out is to make a HDD simulator and connect it to a virtual machine, as someone else suggested. That way, you find out where the performance/energy bottleneck actually is, without needing to reverse engineer an actual HDD controller.

    2. Re:DRM? by L4t3r4lu5 · · Score: 1

      The Solipsist is considering suing myself for copying my idea.

      --
      Finally had enough. Come see us over at https://soylentnews.org/
    3. Re:DRM? by PhilHibbs · · Score: 1

      Or a rootkit. But if he's working on rootkits (implementation or detection) then he should know more about his subject than the vast majority of the slashdot crowd already.

    4. Re:DRM? by kalidasa · · Score: 1

      I think he's writing a rootkit for a grad school project. Notice the emphasis in "open source."

    5. Re:DRM? by chord.wav · · Score: 1

      At first I thought he wanted to do a platter printer kind-of thing. Upload your pic and see it being "printed" on the disk. For art, you know.
      Immediately, I thought you could hide an image or a printed message in a disk with full of junk data. Guess you can't fight your inner self...

    6. Re:DRM? by halcyon1234 · · Score: 3, Funny

      The cynic in me wonders if he is ... trying to develop a DRM scheme for a hard drive. The optimist in me wonders if he is trying to defeat such a scheme.

      The romantic in me wonders if he is trying to create a piece of art. Next week's front-page headlines are like "Hard-Drive Hacker Recreates 'Starry Night' Directly On Platter".

    7. Re:DRM? by Anonymous Coward · · Score: 0

      Seems to me that using a file system directly from sector 0 (no partition nonsense) would defeat every OS out there.

    8. Re:DRM? by marcosdumay · · Score: 1

      Well, if he is trying to make some DRM by reading physical disk data, we can do nothing but encorage him, and teach other DRM researches to follow his steps.

      Now, if he is trying to read physical data from disks he actualy has physical access, there is already plenty of help on other comments.

    9. Re:DRM? by Lunzo · · Score: 1

      My first thought was that it was for an artwork. I couldn't think of any other application where you would want to write 1s and 0s without going through a controller of some sort.

    10. Re:DRM? by jokkebk · · Score: 1

      Actually, perhaps he really wants to create magnetic patterns to a medium (in this case, a hard drive platter). That would explain the need, and modern harddrive capacity would allow for some really intricate ones.

      Other option is that the guy wants to do research on how long strings of ones and zeroes are really stable on modern hard drive platters, or some other such thing - it's hard to simulate this reliably, especially if you're more of a DIY type of guy than a physicist.

      --
      http://codeandlife.com
  34. You can't do it. by PhunkySchtuff · · Score: 4, Informative

    It can not be done with off-the shelf equipment and software for many reasons, some of which are:
    Line Codes
    Error Correcting Codes
    PRML
    SMART
    LBA
    etc.

  35. Re:Talk to Steve Gibson author of Spinrite by Joce640k · · Score: 3, Informative

    No it doesn't.

    If I read it correctly (it was a couple of years ago) all Spinrite does is move the head to different tracks before trying to read the data. The theory is that a seek from different distances might align the drive head slightly differently to the data.

    As far as I know there's no way to position drive heads directly via IDE/SATA, much less write individual bits. IDE/SATA are high level protocols, all the low-level logic is inside the drive controller.

    --
    No sig today...
  36. There is a real possibility to do this. by Anonymous Coward · · Score: 2, Funny

    >Any good utilities out there to do this?

    Yes. My solution involves a screwdriver and a sharpie. And you can write bits of information to the bare metal, like "this drive is broken, dont waste your time trying to fix it".

    My colleague was not happy finding the drive on his desk and told me its a low level joke. Well, yes.

  37. So dismantle the drive! by 91degrees · · Score: 1

    Remove the control hardware. Build your own.

    If that's beyond your skill then you're attempting to do a project beyond your skillset.

  38. CHS mode by Anonymous Coward · · Score: 0

    Use an old drive and take clue from
    http://en.wikipedia.org/wiki/Cylinder-head-sector

  39. I know the solution!! by drewhk · · Score: 0

    ...but I tell you only when you tell us what do you want to achieve.

  40. Perpendicular or normal? by Anonymous Coward · · Score: 1, Interesting

    I guess you want to use modern drive technology to write fine magnetic structures to a plate. Probably producing the equivalent of a magnetic image or a hologram. What you need to do is keep the disk's platter, motor, head, etc. and dump all the electronics. Draw a line on the disk, radial to produce an index and use an optical sensor to read it. Drive the disk at a reasonable speed and then draw your patterns one scan line at a time, using the optical as a trigger to your circuit. You can step inwards from the edge after you are sure that each line is drawn correctly, perhaps with a second head linked to an o.s.
    Have you considered the difference between previous tech and perpendicular recording? I suggest perp. is better for you.

  41. Mel, is that you? by evilmatt · · Score: 5, Interesting
  42. Re:DD by Slashcrap · · Score: 1, Insightful

    I guess the dd utility is not enough for your needs, otherwise you would have already tried it.
    Right?

    I was just thinking that the submitter might be an idiot. Then I read your post. You're definitely an idiot.

  43. get a drive by Anonymous Coward · · Score: 0

    start with a drive less than 528 mb

  44. 8-bit ST412/506 MFM + Linux circa 1994-5 by aussersterne · · Score: 5, Informative

    Get yourself an old, totally unintelligent S412/506 MFM controller from out of an IBM PC or PC/XT. These were fairly dumb devices (g=c800:5 in debug, anyone?) for which you were meant to enter a "bad sectors list" printed on the front of the drive after performing the low-level format yourself. The earlier the drive, the closer to bare metal, so you might want to look for any of the 2, 5, or 10MB (yes, MB) full-height (2 x 5.25" drive bays stacked on top of one another) drives that were floating around then. You'll also want to get yourself a set of ribbon cables.

    You should be able to use a drive/controller combination like this with any machine with ISA bus slots up through about the 386/486 era, and that would let you also go back and grab an early Linux distro (say, kernel 1.2.13 days, like Slackware 3 or so) that included drivers for such a controller that were actually in use and known to work at the time, giving you a base on which to build more code.

    If 10MB is too small, you might just have luck going up to the largest of the MFM (80MB) or even RLL drives (160-200MB, just get an RLL controller instead) drives. I don't remember whether there were any ESDI drives back in the day that didn't remap their own sectors, but if there were, these controllers were 16-bit ISA and somewhat smarter (also with Linux drivers from the period available) and went up to 680MB or so.

    But if you're looking for the best chance of success for your purposes and don't need tons of storage, my educated guess would be that the MFM controller out of an IBM 5150 PC plugged into a 5MB ST506 hard drive and connected to a SIMM-based 80386DX mainboard with 8 SIMM slots (for 8MB ram) might be the easiest combo to find and get working in practical terms that has a chance of doing what you want.

    --
    STOP . AMERICA . NOW
    1. Re:8-bit ST412/506 MFM + Linux circa 1994-5 by Pegasus · · Score: 1

      Actually I have one such system down in the basement. 386DX fully loaded with 32mb ram, 40MB mfm disk with 8bit ISA controller. Last time I played with it I put in isa scsi card and a 4gb scsi disk + cdrom, but I still had to boot the installation from floppy, which is a bit of a pain to do these days. Debian 4 works fine on it and afaik also supports mfm/rll disks.

    2. Re:8-bit ST412/506 MFM + Linux circa 1994-5 by perigee369 · · Score: 1

      Get yourself an old, totally unintelligent S412/506 MFM controller from out of an IBM PC or PC/XT. These were fairly dumb devices (g=c800:5 in debug, anyone?)

      Refresh my memory - g-c800:5 was the command to low-level format the drive, wasn't it? Damn, my age is showing... lol

    3. Re:8-bit ST412/506 MFM + Linux circa 1994-5 by aussersterne · · Score: 2, Informative

      Depending on where you had set the base address of the BIOS in memory (many controllers had jumpers that let you shift it around).

      Some controllers also had multiple routines in addition to the lowlevel format: various kinds of analytics, verify passes, some had self-tests that you had to be careful with because you could tell it to seek to a cylinder way beyond the drive boundary and knock off the heads with a few hundred rapid bangs, which was actually sort of okay because you could literally replace head assemblies and platters between drives sitting on your workbench. Not safe in theory, but actually in practice sort of okay. Once we even forgot to reinsert the air filter (yes, the air filter) in a drive and it started losing sectors much faster than we thought was normal. When we realized, we popped it back out (we used to use the drives in a variety of old minis and a couple embedded systems but manage them on PCs) and put the air filter back in and mapped a bunch more sectors out, and the drive continued in service for another 2-3 years.

      On some you could also use BIOS routines adjust the stepper timing in ranges, from dozens of milliseconds to just a few microseconds, which could rapidly speed up your drive in use, but of course would rapidly lose your data if the stepper couldn't step reliably at that speed, which was often impossible to know if they had spot-sourced the stepper. :-)

      --
      STOP . AMERICA . NOW
    4. Re:8-bit ST412/506 MFM + Linux circa 1994-5 by EriktheGreen · · Score: 1

      Yes, that was the command. Thanks for bringing back those nightmares.

      (I'll skip talking about different ROM addresses for diff. controllers since someone already did. I had machines with multiple controllers in them, and god help you if you picked the wrong address).

    5. Re:8-bit ST412/506 MFM + Linux circa 1994-5 by Rene+S.+Hollan · · Score: 1

      FWIW, The biggest MFM drive I ever had in a PC had 150MB capacity and used an ST-506 controller on an EISA bus.

      --
      In Liberty, Rene
  45. Re:too late? by Anonymous Coward · · Score: 1, Funny

    yup

  46. pen? by Anonymous Coward · · Score: 0

    how about taking the hard drive apart and then using a pen to write 1s or 0s exactly where you want them on the platter. To control exactly where these are written you might need some kind of clamp and robot arm but you should be able to get these fairly simply and use open source software to control it

  47. Not on modern hardware by AlecC · · Score: 2, Informative

    I don't think what you want to do is possible, because I don't think modern drives actually write the 1s and 0s in the way that earlier ones did. They use Viterbi coding, which means that the exact change to the magnetic field to encode a 1 or 0 depends on what the preceding pattern of 1s and 0s is. They literally can only write sectors at a time.

    Then again, what is meant by a sector has changed with time with different servo technologies. With the embedded servos in current drives, you would need to know a lot about the particular geometry of the particular drive you are using.

    And to do any of this, you would have to bypass the controller completely - which, I am pretty certain, cannot be done without serious hardware modifications

    --
    Consciousness is an illusion caused by an excess of self consciousness.
    1. Re:Not on modern hardware by jbeaupre · · Score: 1

      Bypassing the controller actually sounds kind of fun. Not necessarily easy, but fun. Ultimately there are only a few analog wires (carrying digital pulses, but still analog) that control the essentials of a hard drive. Simplified a bit:

      A couple wires for moving the arm.
      A couple wires for writing to each platter.
      A couple wires for reading from each platter.

      Probe those wires while the drive is running normally to get a sense of voltage and current patterns. Then get a D/A and A/D board so you can simulate the digital pulses, plus read output.

      That much reverse engineering might be more trouble than this guy wants. But it would give you a degree of control far beyond anything purely software based. You could play with areal density, make custom bit sizes (dots and dashes) and so on. Which could be useful if you really are getting into some exotic research.

      --
      The world is made by those who show up for the job.
  48. That's nothing! by L4t3r4lu5 · · Score: 5, Funny

    I'm working on a project that requires writing protons to an atom nucleus in a completely controlled fashion. I need to be able to control exactly where protons will appear physically on the nucleus. Normally when atoms are created during fusion the actual atoms that get created are determined by the energy input of the fusion reaction as modified by whatever kind of atoms are being fused (e.g. hydrogen into helium). All of the modern innovations in nucleosynthesis and alchemy are great for particle colliders and crackpots from the Middle Ages, but they are making my particular task quite daunting. My question for Slashdot: is there a way to get down to the 'bare metal' and transmute lead into gold in a cost-effective manner? Any good utilities out there to do this? Obviously a free and open source solution would be preferable, but I'm open to anything at this point.

    --
    Finally had enough. Come see us over at https://soylentnews.org/
    1. Re:That's nothing! by drewhk · · Score: 5, Funny

      "transmute lead into gold in a cost-effective manner"

      Rob a bank with a gun?

    2. Re:That's nothing! by Anonymous Coward · · Score: 0

      LOL I actually choked on my coffee reading this... good show ;)

    3. Re:That's nothing! by sydb · · Score: 1

      Best slashdot comment I've ever read, thank you!

      --
      Yours Sincerely, Michael.
    4. Re:That's nothing! by BetterSense · · Score: 1

      Just make sure you have something equivalent to exchange, or it might end up costing you an arm and a leg.

    5. Re:That's nothing! by sintax0r · · Score: 1

      LOL nice one.

    6. Re:That's nothing! by LeadSongDog · · Score: 1
      --
      Oh, I'm sorry sir, I thought you were referring to me, Mr. Wensleydale.
  49. Well, how about mbr rootkits by roland_mai · · Score: 1

    Hmm, I was thinking of how Mebroot installs itself in the MBR of the drive. Maybe looking at that code might help you. :) However, I don't think one has to deal with firmware. I think writing a simple filesystem that writes or seeks sequentially only might be a better way of dealing with this issue. I think there are a couple such file systems for NAND flash that pretty much work this way. Then, you can put all your directory structures at one end and all files on the other end of the drives.

  50. Re:Defrag software? by Anonymous Coward · · Score: 0

    There are several abstraction layers below HDD sectors.

  51. A real (but expensive) solution: by Hurricane78 · · Score: 5, Informative

    You know how data restoration companies do it?
    They take out the spindle with the platters, and put it in their own reading device with its own controller. And with that you can read and write the exact bits (as long as quantum physics allow it). But the head has to be compatible (e.g. perpendicular recording needs entirely different heads).

    I bet those devices can be bought, and I bet their controller is actually just software on the computer (for flexibility). I also bet they come with different head configurations.
    But they are definitely not going to be cheap.

    Hey, at least it is a real solution. :)

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
    1. Re:A real (but expensive) solution: by omglolbah · · Score: 1

      And this is so expensive to do that most recovery companies with a high volume of drives coming through will keep a library of working drives of all brands and models.
      If the electronics are fried, swap out the electronics, if the heads are screwed, replace em.

      The last chance special reading devices are expensive enough to use that you try to avoid using it... (expensive in terms of time, you want to use it on the drives that need it the most)

    2. Re:A real (but expensive) solution: by dotgain · · Score: 1

      He's actually dead serious, as you'll see near the top of the page where he insults my arrogance for neglecting to mention such a thing.

    3. Re:A real (but expensive) solution: by xtracto · · Score: 3, Insightful

      I like your reply because it is one of the only to suggest a real sollution.

      In a way, the provided answers show the current technically "watered down" slashdot community. I guess 10 years ago this questions would have given really interesting answers.

      I myself had a similar question about 2 or 3 years ago. What I wanted to do was to use the LCD from an HP laptop for some DIY project. The problem was how to interface VGA RGB output with the propietary input of the LCD (made by samsung IIRC). I did a lot of research, got schematics/specs of the particular LCD I was working for and got into the point where I knew I had to create a RGB-to-something decoder/controller (I just let it go so now I dont remember). I even realized that creating the decoder/controller was a really challenging task (mostly time consuming, time I didn't had) or I could buy a 3rd party controller which was quite expensive.

      Although I have very little knowledge of hard disks, I would suggest the OP to first focus on one specific type of drive, second, get the schematics of the drive controller and then depart from there.

      I specially hate these post crying DRM or whatnot. Even though I "am new here" (see my /. ID) I really wish I could find a slashdot like page frequented by real tech geeks /nerds.

      --
      Ubuntu is an African word meaning 'I can't configure Debian'
    4. Re:A real (but expensive) solution: by straywasp · · Score: 1

      Almost all data recovery does not involve removing platters. It is one of the last resorts. Try to find the shop where you can buy this magical machine to read bare platters. It doesn't exist. I have heard of something similar that could access old Western Digital drives without the original PCB and firmware. I think it was only a proof of concept though and was specific to a certain model of drive. It was certainly never released as a product and may have been a total fraud. It's not a real solution. It's your idea of a real solution that simply doesn't exist.

    5. Re:A real (but expensive) solution: by popeyethesailor · · Score: 1

      i don't know what you're talking about. The replies have been pretty good so far. It's a sort of inane question, and the submitter isn't participating. What do you expect? Ask the submitter to post the actual requirements or atleast hint at them.

    6. Re:A real (but expensive) solution: by GatorMan · · Score: 1

      You know how data restoration companies do it? They take out the spindle with the platters, and put it in their own reading device with its own controller. And with that you can read and write the exact bits (as long as quantum physics allow it). But the head has to be compatible (e.g. perpendicular recording needs entirely different heads).

      I bet those devices can be bought, and I bet their controller is actually just software on the computer (for flexibility). I also bet they come with different head configurations. But they are definitely not going to be cheap.

      Hey, at least it is a real solution. :)

      Having worked for a successful "data restoration company", I can say that you are absolutely incorrect. There is no mysterious 'reading device with its own controller'. Why would you even need one when the drive you're working on is often modular? Individual components can often be replaced (head stack, spindle motor, PCB, etc) from another drive that matches the original in a very specific way (this differs by manufacturer). Have you actually ever been trained to perform invasive data recovery, or are you just going by what someone told you over the phone?

    7. Re:A real (but expensive) solution: by evilviper · · Score: 1

      Even though I "am new here" (see my /. ID) I really wish I could find a slashdot like page frequented by real tech geeks /nerds.

      That's what /. was, until we let the riff-raff in, somewhere around the 650,000 mark... Now that we're past double that, the old guys like myself simply get drowned out. And it seems the same phenomenon turned the moderation and meta moderation systems to crap as well, making it even worse.

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    8. Re:A real (but expensive) solution: by Hurricane78 · · Score: 1

      Sure those machines exist. I’ve seen them myself. But they are of course custom made, since the market for them is tiny.
      Yes, it’s a last resort. But exactly because of that they are used. The clients using them have loads of cash.

      Right after I submitted the above comment, I also thought that usually, just swapping the controller is easier. But my point still stands: It actually is a real solution. And my comment also does not contain the load of arrogant dickishness and lack of thinking outside the box, that pretty much every other comment showed.

      But hey... crab mentality... right?

      --
      Any sufficiently advanced intelligence is indistinguishable from stupidity.
    9. Re:A real (but expensive) solution: by PhunkySchtuff · · Score: 1

      In a way, the provided answers show the current technically "watered down" slashdot community. I guess 10 years ago this questions would have given really interesting answers.

      In this particular case, the ways in which modern hard drives operate is getting pretty close to magic. There is a lot of smoke and mirrors in a modern hard drive controller and the drive is operating very close to the limits of what is currently possible. Even going back a number of years, writing ones and zeroes to the disk doesn't result in physical N and S magnetic domains that match the bit pattern that you write.

      There needs to be transitions in the signal, which is how the signal clock is recovered, so (for instance with CDs) when you write 8 bits, 14 physical bits are written to the disc (EFM - Eight to Fourteen Modulation) such that even if you write a continuous series of zeroes (or ones) this is not the bit pattern that gets written to the disk.

      This is a fundamental way that hard disks, CDs, floppy disks etc all operate, and it can't be changed and have the equipment operate reliably.

    10. Re:A real (but expensive) solution: by Anonymous Coward · · Score: 0

      It doesn't have to be that expensive.

      First buy a hard drive. Then carefully dis-assemble the case and expose the drive platters and read write heads. Using a torx screwdriver disassemble the head actuator so that you can move the heads completely off the drive and remove them.

      Next disassemble the spindle retention ring. Usually there is a spring clip which uncovers a press fit bearing and dust guard. There is a sort of weird pad like thing that has some lubricant on it (it drips lubricant over the platters during the life of the drive.

      Remove the spindle bearing cap and disassmble the platter retention rings. You should be able to lift the platter(s) straight up and out of the case. You now have the hard disk out where you can manipulate it.

      Now the easiest thing to do for this next step is to re-use one of the read/write heads that were on the drive, however if you don't care how much surface area the bits take up on the platter you can make your own head (note that the existing heads are probably set up for perpindicular recording).

      You will want to connect a signal to the read write heads, Normally at the front is an erase head and then the write head and then the read head. These will look like on the drive head like three little "gaps". When the drive is rotating and it starts writing it usually turns on all three where it erases, then writes, then reads to verify that what it is writing is actually being written. During a read operation usually only the read head is active.

      Depending on how precisely you need to place the ones and zeros you can use either a magnifying glass, a steroscopic microscope, on a scanning electron microscope, to push the head to exactly where you want to write. Often a drive is "erased" to zeros so you really only have write ones and you can assume that where do you didn't write is still zero.

      Now by moving the head to each place where you want to write a one, and then energizing the coil in the write head with just enough current to cause the magnetic domain to flip (you will probably have to use trial and error here to get it to work reliably) you can write your one bits. You won't be able to see them so its important that you remember where your wrote them.

      I suggest a piece of paper where you trace the outline of the disk (be sure and mark one part of the edge as the "top") and then when you write a one bit you can use a pen or pencil to note on the traced outline where you wrote it.

      Depending on how carefully you can move the head around you can probably write several thousand one bits. Usually the head would "float" a small distance over the disk platter as the platter turned but since you are only concerned with writing ones and zeros as specific places I think you can just rest the head on the surface of the platter when use it to write the bits.

      Once you have all the bits where you want them, what do you plan to do with the disk?

      --Chuck

  52. Are you sure that's your requirement? by Zarf · · Score: 5, Funny

    "I'm working on a project that requires writing bits to a magnetic hard drive platter in a completely controlled fashion."

    Are you sure?

    The reason I ask is I'm working on a project that requires me to move data faster than light. At least that's what I spent last Monday working up the math to prove that data replication between our different data centers has an upper bound enforced by the fabric of the universe and that it was impossible for me to achieve the project's stated goals without essentially inventing warp drive. As it turns out after a meeting it was determined that the goal was just a stated guideline. It also turns out the price of faster data transfer rates is prohibitive and after a further meeting the stated project goal was total baloney. Yes. Baloney. We had sandwiches. It was a nice meeting.

    --
    [signature]
    1. Re:Are you sure that's your requirement? by TubeSteak · · Score: 3, Funny

      The reason I ask is I'm working on a project that requires me to move data faster than light. At least that's what I spent last Monday working up the math to prove that data replication between our different data centers has an upper bound enforced by the fabric of the universe and that it was impossible for me to achieve the project's stated goals without essentially inventing warp drive.

      I have a solution for your problem:
      1. Declare your main data center King. This requires a coronation ceremony and a crown.
      2. Declare your backup data center Crown Prince. This does not require a ceremony.
      3. Push the big red button that kills your King (the main data center).

      Thus, by the laws of royal succession, your backup data center will instantly become King with all the knowledge of its predecessor. And that is how you to move data faster than light without violating the laws of physics.

      --
      [Fuck Beta]
      o0t!
    2. Re:Are you sure that's your requirement? by Anonymous Coward · · Score: 0

      One merely needs to counteract the Higgs field with vacuum energy to enable superliminal travel.

    3. Re:Are you sure that's your requirement? by Anonymous Coward · · Score: 0

      Who knows, he just might require a vintage IBM 5100 for an upcoming task in the future. A hairbrained FTL project just might prove useful afterall.

      My guess as to what may seem plausible for the current problem is that some undocumented jumper pin setup on an older IDE drive that may yield results. (Perhaps a config for an external controller instead of on-board?) But then again its more likely to just thrash the drive, and even if such a direct mode were available it's likely not to be documented anywhere outside of manufacturer testing. Even if this was the case for a given model, it would take a good while to figure it out and likely ruin a few drives without any insider knowledge.

      A better bet would be to put some money on the table with a drive manufacturer or two rather than asking random slashdot people. Especially ACs that don't care much about karma and can't be arsed to register.

    4. Re:Are you sure that's your requirement? by makomk · · Score: 1

      You've been reading too much Pratchett, haven't you?

    5. Re:Are you sure that's your requirement? by Anonymous Coward · · Score: 0

      Terry, is that you?

  53. I think he's planning to do some... by SpurtyBurger · · Score: 1

    hard disk art :) Maybe a 1/32 pic of Fatty Arbuckle?

  54. Ask Chuck Norris by frenchbedroom · · Score: 1

    The man can write bits on any hard drive platter just by glancing at it menacingly.

  55. The C64 still dominates by agent420 · · Score: 0

    This was easy to do on the C64. Commodore is still waiting for the mainstream to catch up.

  56. Headlines are superfluous by thasmudyan · · Score: 5, Insightful

    Don't you hate it when people refuse to accept the premise of a technical question and write long monologues why the submitter is working with false assumptions even though they don't know what exactly they are dealing with? Yeah, me too. Makes them look arrogant, ignorant and smug. I'm going to go ahead though and reject the submitter's premise: there is no chance in hell that you're on the right track with whatever project you're attempting to do. But instead of merely dissing you for incompetence, I'll lay out a few scenarios (might as well, since you didn't supply any of your own).

    If the actual physical bits matter to you...
    you're either a hard drive manufacturer or a clueless person who should read up on how drives actually work. And we both know you're not working for a manufacturer. What you need to know is that there are several layers of indirection between the write call from within an OS down to the actual magnetic platter. These layers are there for a reason. At the very least, the onboard controller of the drive abstracts away the physical block allocation, and the drive won't work without the controller at all. Since the intricacies of the drive's physical address space are not accessible from the outside, there will never never never be a reason to try and fiddle with it directly. Because you can't.

    If you are looking for disk I/O without a filesystem...
    we're finally in saner territory. There are valid reasons to do this, e.g. speed and overhead considerations. Some database vendors actually have features like these. In this scenario, you're using the entire drive as one big addressable blob. A good starting point would be to have a look at the source code of a simple filesystem, such as ext2. Strip away all the actual file handling stuff and learn what you can from the disk I/O routines. On the other hand, if you didn't arrive at this conclusion yourself, that's not a very encouraging sign.

    If you simply want a drive without error correction...
    you're not developing software that will run on any modern system. If you accept this caveat, you can buy an ancient drive off ebay and use that. However, keep the first scenario firmly in mind: there is simply no reason to control the exact placement of every single byte if you don't plan on literally putting the drive under a microscope afterwards. Otherwise, this has no practical implications and, again, you are on the wrong track.

    If you're a DRM/malware/virus developer...
    I will sleep very comfortably tonight, because you had to ask about this on Slashdot, signaling once more that you're doing it wrong.

    1. Re:Headlines are superfluous by Anonymous Coward · · Score: 2, Interesting

      except for "If you are looking for disk I/O without a filesystem..." i agree to all your arguments

      in linux though, you have the /dev/(sd[abcde...|012345...]|hd[abcde..|012345...]) block device files, which you can directly access through normal filedescriptors like a normal file.

      These give you linear access to the whole harddisk, accessable through open, read, write, seek and ioctl. Windows surely has something similar, else partitioning programs like fdisk or partition magic would have a real hard life...

      I guess though, that this kid really meant the physical bits, and without building his very own harddrive with its very own controller he is totally out of luck, not even the firmware is capable of that! (rle(yes i am old) and other encodings are done in hardware from what i remember, while the firmware takes over the logical structure of the data positioning etc)

      The bits you send to the harddisk are not what is written to the platter, but a special encoding representing them.

      You might have luck with some 1950's style harddisks, which might not havent gotten to those features yet.. but you will have to find them in a museum

      No kind of harddisk (controller) on any ibm compatible ever gave you access to that part.

      btw harddisk recovery from broken drives is seldom done with special controllers, but through replacing the broken controller board on the harddisks themselves through a similar model

      now back to the part about why he is wanting to do this.... while it is possible this would be used for drm, this would never work realiable without taking care of what the used filesystem wants to do... you need to allocate the used blocks as a file, else they will be overwritten at random times.....

      Even the good old protection style to make use of unused bytes in filesystem blocks at the end of files wont work on most filesystems today anymore, as they can put more than one (small) file into single blocks nowadays to save space

    2. Re:Headlines are superfluous by Zarf · · Score: 1

      If you're a DRM/malware/virus developer...
      I will sleep very comfortably tonight, because you had to ask about this on Slashdot, signaling once more that you're doing it wrong.

      I see what you did there.

      If said project was a DRM project I would equate this to the project requirement I got they didn't ask for "faster than light travel between Seattle, Atlanta, and New York" instead they asked for "millisecond data replication between all three data centers" ... which I had to call "baloney" on. Your DRM project should specify "make it cheaper to buy the product than it is to steal the product" then everyone will be happy.

      --
      [signature]
    3. Re:Headlines are superfluous by Idaho · · Score: 5, Insightful

      Don't you hate it when people refuse to accept the premise of a technical question and write long monologues why the submitter is working with false assumptions even though they don't know what exactly they are dealing with?

      In fact no, I hate it more when people do not state their actual purpose, especially in cases where what they are asking combined with the fact that they *need* to ask, cannot prevent one from wondering whether they really understand what they're doing, or whether they are addressing the right problem from the right angle (which, in this case, appears extremely unlikely).

      The problem with this topic is *exactly* that we don't know what we're dealing with, and the first thing any decent engineer would do is to try and figure that out (in fact, you started out to do just that). Surely the stated goal doesn't stop at writing bits in exact locations just for the sake of it, right?

      In fact, if I asked this to a 100 engineers, I'd really expect that at least 99 of them will immediately ask "why the fuck would you want to do that!?". And the one who doesn't probably works at a harddisk manufacturer.

      --
      Every expression is true, for a given value of 'true'
    4. Re:Headlines are superfluous by gardyloo · · Score: 4, Interesting

      Since the intricacies of the drive's physical address space are not accessible from the outside, there will never never never be a reason to try and fiddle with it directly. Because you can't.

      Careful there. I know you're addressing a typical user of the hard drives, but there ARE ways of -- and reasons for -- getting at the "bits themselves". One of my colleagues, as a fresh student at one of the National Labs in the US, was tasked with recovering data from a crashed (literally crashed, so that the controller was destroyed and platters bent, with lots of data loss) disk. Of course there are ways and means of doing so, usually involving fantastically specialized equipment and lots of expense (and, often, the complicity or orders at the Federal level).

            He ended up building a sweet little system which could scan the surface (in a low-level clean-room, of course), albeit slowly, and interact directly with the bits.

            I'll have to ask him how they figured out the filesystem, the error-correction, and so on, without any of the usual partition tables and so forth.

    5. Re:Headlines are superfluous by your_mother_sews_soc · · Score: 2

      I think the original question is valid and shouldn't be dismissed, as well. During the 1980's in the peak of mainframe development, a few of us were writing channel programs, small but really cool pieces of "machine code" that would be executed on a disk controller. We did this to add a big performance gain to our software. Remember, back then memory was expensive and a resource shared by possibly hundred of concurrent jobs (programs).

      With a channel program one could directly control the reading and writing of consecutive blocks, cylinders, and tracks. If you could get cylinder allocations to meet your needs, then all the read/write heads are aligned and you could write to (read from) as many platters the disk had simultaneously. If a disk had 11 platters, you would chain up the commands to point to the data and do a DMA 'blast" of data out to 11 tracks in parallel. Then, you would step out to the next consecutive track and blast another string of data, and so on.

      The neat thing of channel programming is that these systems would also allow you to query the drives capabilities and you could write them dynamically. So no matter what, your software could adapt to the connected hardware. And, since the disk controllers were small computers themselves, once the channel program was set up (and they were just sets of descriptors - commands and addresses, not unlike any other machine code) the work was done asynchronously with your application code. Or you could wait if you couldn't figure out how to do that.

      I think the inability to control disk I/O programatically is a serious deficiency in modern PC's, whether they are desktop or rack-mounted. Remember, the operating systems of today are not meant for people who read IBM's Principle of Operations and Supervisor Services and Macros. They are designed for the least common denominator.

      --
      My user name was a mistake. Input wasn't restricted, my bad.
    6. Re:Headlines are superfluous by gerwalk · · Score: 1

      You are a gentle soul and you've given this ninny much more of your time and effort than he deserves. Well done.

    7. Re:Headlines are superfluous by Anonymous Coward · · Score: 0

      Here's another one:
      He's developing a magnetoelectric material and thought that it would be splendid to simply coat a HD platter with the stuff and use what he thought was a dumb controller to establish magnetic fields at precise locations while having a different sensor detect the associated electric field. In this way, he wouldn't care at all about the readability, but rather a simple commercial solution that would otherwise cost $$$ from a specialized equipment manufacturer.

      Personally, I hate electromagnetic materials characterization research, so who knows what he's using it for. My point is that his purpose could have nothing to do with reading or writing data, but rather for more fundamental science.

    8. Re:Headlines are superfluous by BitZtream · · Score: 1

      Yes, and in what way do the original question sound like he was trying to recover data manually rather than do something stupid?

      He's talking about writing to the drive, not just reading specific physical locations. Data recovery is not his concern.

      The problem is, theres plenty of people here that can come up with every reason you'd want to write directly to a specific location, and those people also realize there is almost 0 reason anyone wants to do that except a very specific set of people which ... wouldn't be asking the question.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    9. Re:Headlines are superfluous by Foole · · Score: 0
      #866112 +(1393)-

      <glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"

      <glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers

      --
      This is not a turnip.
  57. Re:Talk to Steve Gibson author of Spinrite by machine321 · · Score: 0, Flamebait

    The stuff Spinrite does stopped working 15 years ago.

    What, bullshit? That still works just fine, most of the time.

  58. Really? Do NONE of us read? by True+Vox · · Score: 3, Informative

    No less then *7* posts to the SAME XKCD COMIC?!? Christ, bad enough people don't RTFA, at LEAST read the fine comments!

    --
    "Gratuitous complexity is akin to chaos" - True Vox
    1. Re:Really? Do NONE of us read? by Anonymous Coward · · Score: 0

      Hey, have you seen this comic?

    2. Re:Really? Do NONE of us read? by godrik · · Score: 0, Redundant

      You mean this one ? http://xkcd.com/378/

    3. Re:Really? Do NONE of us read? by noidentity · · Score: 1

      No less then *7* posts to the SAME XKCD COMIC?!? Christ, bad enough people don't RTFA, at LEAST read the fine comments!

      Sense. Your comment makes none. The summary has no links to TFA, and where is anyone linking to an XKCD comic?

    4. Re:Really? Do NONE of us read? by True+Vox · · Score: 1

      Are you serious? Do an inline search for xkcd.com in this page and you'll find plenty (9 at least by now, thanks to the two others above you who were trying to be funny).

      --
      "Gratuitous complexity is akin to chaos" - True Vox
  59. Just call Seagate tech support. by Anonymous Coward · · Score: 0

    They won't understand what you're asking and won't be able to help in the slightest, but please record the call for us.

  60. Re:Defrag software? by Anonymous Coward · · Score: 0

    No, not in the slightest.

  61. He may mean something a bit different. by CFD339 · · Score: 2, Interesting

    Some operating systems have volume management tools that do let you get a great deal more specific about where data is written. Normally, I'm a Linux or Wintel guy, but I have managed some AIX boxes a few times and from setting up a large one once I recall that it's logical volume manager allowed you to create volumes on the SCSI drive systems that were very specific about how and what part of the drive was used. You could specific, for example, that a particular volume use only the outer tracks (or inner or middle I suppose) of the drives -- in addition to a great many options for raid striping and transaction logs and so on.

    The idea is that the outer edges of the platters travel faster under the read/write heads than the inner and so performed differently. Also, you could keep the head from having to jump around as much by keeping all the data that tended to be used at the same time on the same tracks -- reducing your average seek time when reading randomly from that pool of data.

    In practice, I think this mattered a great deal more when us old guys were dealing with 80+ millisecond random seek times on 5 1/4" wide full height (what would now be considered two bays) drives -- or larger disk-pack based drives (aka washing machines) with the massive physical movement necessary for those read/write heads.

    Today, I think the admin is better focused on distributing the data load better across different drives/arrays to even the load out and also focused on reducing overall disk i/o in creating database schema and applications. Focusing on very fine details like this is likely to have only marginal benefit next to those key areas --- but I can't presume to know for sure what this project has in mind.

    --
    The problem with quotes on the internet, is that nobody bothers to check their veracity. -- Abraham Lincoln
    1. Re:He may mean something a bit different. by Culture20 · · Score: 1

      Some operating systems have volume management tools that do let you get a great deal more specific about where data is written. Normally, I'm a Linux or Wintel guy, but I have managed some AIX boxes a few times and from setting up a large one once I recall that it's logical volume manager allowed you to create volumes on the SCSI drive systems that were very specific about how and what part of the drive was used. You could specific, for example, that a particular volume use only the outer tracks (or inner or middle I suppose) of the drives -- in addition to a great many options for raid striping and transaction logs and so on.

      What linux distros have you used where you can't specify where your partitions reside?

  62. I don't think it was EVER possible... by argent · · Score: 1

    I suppose it MIGHT be possible to jigger some drives to format a cylinder in some specific weird format, so it contains information you can only get at if you use a 666 byte sector size, but even this kind of thing hasn't really been possible on hard drives any time... I don't think even ST506 MFM and RLL controllers let you do much more than jigger some encoding of the sector and the sector size, otherwise you'd have been able to upgrade an MFM controller to RLL in software.

    Heck, the ability of the Apple-II and Amiga *floppy* controllers to play clever games at the bit/nybble/byte level was unusual.

    And given that the most common use of that kind of shenanigans was for copy protection, the speculation this fellow is looking for some help in coming up with a hard DRM scheme seems spot on.

    1. Re:I don't think it was EVER possible... by Anonymous Coward · · Score: 0

      I don't think even ST506 MFM and RLL controllers let you do much more than jigger some encoding of the sector and the sector size, otherwise you'd have been able to upgrade an MFM controller to RLL in software.

      LOL, kids.

      Your MFM controllers had software??? Mine consisted entirely of discrete SSI and MSI chips.

    2. Re:I don't think it was EVER possible... by argent · · Score: 1

      I'm not talking about software on the controller, I'm talking about software on the CPU. If it was possible to jigger the process of writing a sector of data on an MFM controller to write raw bits to the disk surface, you could convert the sector to RLL in the driver and write that. That's how a lot of copy protection on Apple II and Amiga worked (the Amiga used the Blitter for encoding and decoding, the Apple II just did it in the 6502).

  63. Magnetic nano-fabrication? by Anonymous Coward · · Score: 0

    Hopefully it's some socially useful purpose like a magnetic scaffolding for nano-engineering such as DNA/drug synthesis, building fuzzy/nano structures (batteries, drugs, whatever) at the areal densities of modern drives. I guess you'd figure out how to distribute the bits, drop the medium onto the platter, and go from there. Probably easier technologies to futz with, but if this is the goal you could probably accomplish a testbed with a hardware/firmware hack, worst case an FPGA etc., but they'd be better off sharing the wealth by partnering with an entity that does this for a living, like a drive manufacturer, or maybe a data recovery house.

  64. My First Hard Drive by bigtallmofo · · Score: 1, Interesting

    My first hard drive was a 40 MB Seagate ST-251 MFM hard drive. I almost got the ST-225 when I was buying the parts for my first IBM-compat from JDR Microdevices.

    I'm still very thankful that I didn't go with my alternate plan of getting the Lt. Kernel 20 MB hard drive for my Commodore 128. I imagine I wouldn't quite have the career I have today had I gone in that direction.

    --
    I'm a big tall mofo.
  65. Bypass the filesystem by sxrysafis · · Score: 1

    So, do you need to write to a specific sector? Or do you have to position the data in a specific *place* on the disk (eg 1 cm from center, 20 rads)? If it's the first, you only need to bypass the filesystem, so just fopen "/dev/sdX" under Linux, or use CreateFile "\\.\PhysicalDriveX" on Windows, seek to the position you want, and write away. For the latter, you need to bypass the drive's logic, so you will have to either re-write the firmware, or implement your own controller board.

  66. This by Alvare · · Score: 1

    What about doing it the other way around? You could study how the filesystem works with one specific set of hardware, and write specific data in specific milliseconds in specific places to force the hard disk to write the 1s and 0s exactly were you want them. You would be very limited, but it could work.

    --
    4 - A robot may not masturbate, except where such action would conflict with the Second Law.
    1. Re:This by Aanalin · · Score: 1

      4 - A robot may not masturbate, except where such action would conflict with the Second Law.

      Pfft.. that actually the first law that already broken !

  67. One more possibility... by Schraegstrichpunkt · · Score: 2, Funny

    Randall Munroe

    1. Re:One more possibility... by bsDaemon · · Score: 2, Funny

      Yeah, but he's a CIA troll who's writing a cyberpunk thriller one panel at a time, so isn't he the 'all of the above' option?

  68. Inverse of the driver. by cpscotti · · Score: 1

    The only reasonable.... NOT.... way to do it in software would be to implement the inverse (you know, ^{-1}) of the disk driver in sw and then just trick the hardware: generating "proper" data such that, after the plethora of bit crunching done by the hard disk driver, you get what you wanted in the first place.

    In short, sounds like big trouble. You're going to need plenty of legal advice before this thing is over. As your attorney, I advise you to rent a very fast car with no top. And you'll need the cocaine. Tape recorder for special music. Acapulco shirts.

  69. I'm working on a project... by Beorytis · · Score: 1

    I'm working on a project that will require me to hire someone experienced in hard disk drive physical systems, encoding and controller firmware. I'm posting a question to Slashdot that resembles the kind of idiotic question that typically comes from a pointy-haired boss so I can offer the job to the person who posts the most rational, knowledgeable and nonconfrontational answer.

  70. A reason for such a task by rzvn · · Score: 1

    It is possible that he wants to achieve something similar to Burning visible images onto CD-Rs with data (beta)

  71. It CAN be done! by symes · · Score: 3, Funny

    You will need a reasonably sized HD, like this one where ones and zeros occupy a space of about postage stamp size.

    1. Re:It CAN be done! by keeboo · · Score: 1

      You will need a reasonably sized HD, like this one where ones and zeros occupy a space of about postage stamp size.

      I saw one of those once (actually a bigger model, _physically_ bigger I mean), in a university IT garbage room.
      The thing suffered a head crash, deep enough you could easily feel it with your fingers. I wonder how horribly it sounded when that happened.
      Those were the days...

  72. Ignorance is Bliss by Anonymous Coward · · Score: 0

    There's a reason for things like error correction that you're trying to omit. The primary benefit of omitting them is that you will never be able to retrieve your data.

  73. There is an API for direct acssess to disk by Anonymous Coward · · Score: 0

    But disk manufactures won't expose it to any one (no without the proper leverage)
    I know that cause use use those api's to simulate bad sectors for testing our embedded system video capability.

    go ahead and talk with some of the manufactures, you'll get the best answer from them.

    1. Re:There is an API for direct acssess to disk by makomk · · Score: 1

      Yeah, there's RAW READ/RAW WRITE, but at best that allows you to bypass one layer of error correction. There's still the low-level encoding, which means you still don't have direct control over what ones and zeroes are written to the drive (or over where exactly they're physically written). Also, the recommended technique for doing that these days is to tell the drive to mark the sector as bad, rather than actually corrupt the data in it.

  74. Scott Moulton by Anonymous Coward · · Score: 0

    Yes, there are ways to do this. I'd start by taking the SANS data recovery class taught by Scott Moulton.

    His website has a lot of info, too:
    http://www.myharddrivedied.com/

  75. Have a Yabadabadoo Time by Anonymous Coward · · Score: 0

    If you'd like to write 1s and 0s will physically on the platter, just borrow Mr. Slate's dictation bird.

  76. Re:XKCD: Butterflies by Anonymous Coward · · Score: 0

    The first XKCD reply (the second reply to the story, and the first of many) was more than 2 hours ago. Congratulations, you fail at internets

  77. ob XKCD reference by oldfogie · · Score: 0, Redundant

    I'm surprised I haven't see this yet: http://xkcd.com/378/

    1. Re:ob XKCD reference by ShadowRangerRIT · · Score: 2, Informative

      It's been posted and modded to oblivion multiple times.

      --
      $_ = "wftedskaebjgdpjgidbsmnjgcdwatb"; tr/a-z/oh, turtleneck Phrase Jar!/; print
    2. Re:ob XKCD reference by laejoh · · Score: 3, Funny

      Nice, 'course there's an emacs command to do that, good old C-x M-c M-modintooblivion...

  78. Can't be done -- the physics by Ancient_Hacker · · Score: 1

    First of all, you don't write "ones" and "zeroes" on a surface. The only thing you can write are flux transitions, changes from north to south magnetic polarity and back. In order to be able to write and then read them back you also have to add clocking transitions and DC-restoration transitions. It takes a fair amount of sophisticated analog and digital electronics to do the writing and reading. The digital parts are semi-programmable, but the analog parts are not-- you're stuck with writing and reading the type of flux transitions that the analog electronics is optimized for.

    I can't imagine why you think you *have to* be able to write a particular pattern. Unless you're going to use the platter to test out some kind of magnetic imaging camera.

  79. Re:DD by Culture20 · · Score: 1

    I would love to hear why the submitter thinks he needs to write directly to the platter.

    I bet he wants access to the magical free space he hears is on every drive but is invisible because of the evil error correction schemes.

  80. What kind of answer do you expect by hey! · · Score: 2, Insightful

    if you describe your requirements so abstractly? It sounds to me like you've come up with a solution ("Let's write the bits directly to the hard disk") and now you want pointers on how to make it work without explaining why.

    If you just want to get around the file system, then use raw block I/O to the device. However it *sounds* to me like for some reason you've decided the *actual physical* layout of bits on the drive is important, in which case you are going to have to write your own disk driver -- if the drive electronics themselves don't defeat your attempt to know where bit is physically written.

    It's inconceivable to me that you'd actually need to know this. Since you only *read* the data through an interface, it should make no difference if you *write* though the same interface, as long as it's consistent. In other words, unless you are going to disassemble the drive and examine it with an atomic force microscope, you have no way of telling the difference between a physical layout and an equivalent *model* of a "physical layout".

    If you can't say *why* you need to do this, at least explain the parameters (how much storage, how fast, what kind of retreival etc.). My first reaction was that you should not use a magnetic disk at all, but an MTD flash device. Even so, you're dealing with an abstraction. You have no idea whether the device itself has mapped a bad bit to a different location at the hardware level. However short of tearing the device apart and putting the flash chips in a special circuit, you'd have no way of telling.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    1. Re:What kind of answer do you expect by John+Hasler · · Score: 1

      > It's inconceivable to me that you'd actually need to know this.

      He may want to use the disk in a way that has nothing to do with storage of data at all.

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
    2. Re:What kind of answer do you expect by hey! · · Score: 1

      Actually, he'd have to have an application that required measuring the state of the platters independently of the drive heads to literally need to control the "physical location" of the bits. Otherwise he's already dealing with an abstraction of the physical layout of the disk. Given that, he might as well build the abstraction he wants on top of the raw disk interface provided by the OS.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  81. What about... by Anonymous Coward · · Score: 0

    1. Screw open harddisk, remove parts until platters are visible
    2. Take felt tipped pen
    3. Write 1's and 0's.

    Sound good?

  82. This is really weird... by Anonymous Coward · · Score: 0

    Why is there so much ill-feeling towards the poster? Technically, what he's asking *must* be doable--though probably very hard--so why not admit that you either don't know how to help him (which is probably true for most people), or point him in the right direction, if you can? Or, if you know for a fact that it can't be done, just calmly explain why.

  83. hardcore freedos or dd your way out by Anonymous Coward · · Score: 0

    There are two ways;
    I would advise you to pick up a copy of FreeDos. Dos gives you less trouble accessing the hardware than Windows, Linux, MacOS X or fill in nearly every other big modern OS.
    Then you can simply use C++ to access BIOS calls to access the harddrive, or write some code that accesses your diskcontroller directly. I do think you probably need to code yourself, or get someone to do it for you.
    This would give you the most flexibility.

    An other option is to use linux and a simple utility called dd, you can simply use that to write a binary-file directly to a certain sector or number of sectors. For example; dd if=sample.bin of=/dev/hdb would write a file called sample.bin to the second harddisk starting from the very first sector.

  84. I have written to a disk drive kind of like this.. by Anonymous Coward · · Score: 0

    I think I've actually done something like this.

    Back in the day, I worked on a Commodore 128, and an external 1581 disk drive.
    It was really cool, the disk drive had it's own operating system, different from the computer.
      you would form special packets on a floppy disk, which the drive would load and execute as code in the disk drive's buffers.
    So you could actually "add" commands to the operating system of the disk drive.
    Was a common copy protection scheme back then.

    To save something to the disk at a certain spot, you could determine the track and sector you want to write to,
    then read that sector, modify the bits you want to change,
    then write that sector to one of the disk drive's buffers, and send a command to write sector to disk, giving it the
    track, sector, and the number of the buffer to write from.

    You had to write your own software to write to the disk drive, I think i used assembly language for that.

    Anyway, a program to do this now might be difficult, but if you step back to DOS operating system and an old drive, need not be mfm,
    you can prove it works by using good old DEBUG. With DEBUG you can read a specific track and sector from disk into a memory location,
    then modify it, write it back to disk, one sector at a time. But it is tedious to do for a big project.

    Or get a DOS track and sector editor and do your tests in that to get it working.
    There are millions of tracks and sectors on a single disk--this would be too slow for a real project,
    but you can get a proof that it works going, and take it to someone who now can see what you are doing and write a
    small executable that can be scripted, or write a new program that will do the whole thing.

    As an aside, because of the nature of the disk drive, you are still limited in writing to existing tracks and sectors, there is not a
    way to write to a specific bit at a polar coordinate. Firmware won't take that command. you have to have some sort of translation
    table in your program too, as the the tracks are larger at the periphery of the disk, and have more sectors per circle (track) than they do
    closer to the middle.

    You have to know about the physical layout of the platter to convert this to a translation table of tracks and sectors that your disc drive
    can write to.

    Consider storing the data instead in a disk file as polar coordinates: value, angle, distance.
    That is information you have to have anyway to decide where to write it on the disk...

    If you can tell us more about it, we can help better.

  85. Not quite the same thing by CFD339 · · Score: 1

    First - I should say I'm not an expert on everything that can be done with the newer logical volume management tools in the Linux distros...I used them rarely.

    That said, this isn't quite the same thing as most people can accomplish with Linux on a SATA drive even with the LVM. You can, so far as I know, specify which blocks, numerically, to use for a partition. There is not (again, to the best of my knowledge) a direct mapping from that block order to the actual tracks and sectors on the physical platter. There is mapping that happens between the drive and the controller (which is on the drive on all modern sata and pata drives) and there is mapping between the system bios and the controller (to account for limitations in the original head/cylinder counts available on the original AT drive specs). I don't know how much effort is made by the drive manufacturers to match what they report as sector order to physical location given that seek times have gotten so low over the years.

    I don't think specifying the block choice used on an sata drive does anything even close to what I was describing.

    --
    The problem with quotes on the internet, is that nobody bothers to check their veracity. -- Abraham Lincoln
  86. Technical Limitations by kenp2002 · · Score: 1

    Since the absolute addressing of physical mapping is handled by the drive controller I doubt a manufacturer is going to allow anyone to get direct control of the hard disk.

    The issue is if a user space application could do so they could write persistent viruses into the sector reallocation reserve space and no OS could remove that data unless the OS also had access to that space and\or a sector gets reallocated into that space wiping the content.

    In addition due to rotational issues you would need to first pre-determine an arbitarary starting point on each platter, write a pattern to identify that and build a custom sector mapping. You have to remember that due to sector remapping sequentially mapped sectors may not in fact be "next" to one another on the hard disk.

    You are trying to pin the tail on a doney travelling at over 7200 RPM which is no small feat.

    You could try building your own custom firmware for the disk controller but I am certain that disk manufactures have specialized firmware and disk options for, shall we say, less then normal buyers.

    --
    -=[ Who Is John Galt? ]=-
  87. maybe writing directly to the device files? by AlgorithMan · · Score: 0
    I think you might want to read and write directly from or to /dev/sdX for the whole disk number X or to /dev/sdXi for the i-th partition on disk X. I'm not 100% shure though, what happens with boot sectors, boot loaders, partition tables and such...

    of course this way you can only work with bytes instead of bits, but that's just a mathematical problem, you can solve this with some bit-shifting.

    int base2[] = {128, 64, 32, 16, 8, 4, 2, 1};

    bool getbit(FILE* device, int num) {
    fseek(device, num/8, SEEK_SET);
    return (fgetc(device) / base2[num%8]) % 2;
    }

    void setbit(FILE* device, int num, bool bit) {
    fseek(device, num/8, SEEK_SET);
    char tmp = fgetc(device);
    fseek(device, num/8, SEEK_SET);

    int basenm8 = base2[num % 8];
    fputc(device, (((tmp/(2*basenm8))*2 + bit)*basenm8) + tmp%basenm8 );
    }

    or something like that...

    --
    The MAFIAA is a bunch of mindless jerks who will be the first up against the wall when the revolution comes
  88. Mod -1 KDAWSONFUD by kenp2002 · · Score: 1

    Why is it every time I read an article that is either A: Horribly Biased or B: Idiotic in Premise it is always posted by KDAWSON?

    I can understand trolls and trolling in comments, but seriously Taco, from your editors?

    --
    -=[ Who Is John Galt? ]=-
    1. Re:Mod -1 KDAWSONFUD by Megane · · Score: 1

      Because kdawson is the "editor" who happens to be on duty during the kook-shift?

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  89. Do you really need that much control? by DarkOx · · Score: 1

    If you wrote your own filesystem or other record delimiting scheme and you could interface the drive normally at the block layer. Sure the controller might map blocks elsewhere but anytime you read the drive its going to reply with the same block from the same "logical" location, even if you move it to another machine.

    So for all practical use, what difference does it make? Unless you were planning to actually remove the platters from the drive and install them in a different drive later, then you have a problem but if that is the case I think you should take a few steps back and reconsider your process..

    --
    Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
  90. Easy Solution? by RavenChild · · Score: 1

    1. Just get any disk.
    2. Format with a FS that allows filesizes as big as the drive.
    3. Create a contiguous flat file on the drive.
    4. ...
    5. Realize you were trying to reinvent a wheel that took >40 years to make in the first place?

  91. Re:DD by sskinnider · · Score: 1

    Sound like an interesting way to build a cryptographic system.

  92. inadequate hardware by TheSHAD0W · · Score: 1

    With the technologies currently used for self-timing data writes on hard drives, it's likely that no hard drive spindle motor will maintain a perfect rotation rate, making your job even more difficult.

  93. Build your own controller by Anonymous Coward · · Score: 0

    If it doesn't have to be a hard disk, I might start with a floppy disk, even just for practice. Really what you need to do is control a stepper motor from code in memory. It doesn't even need to be on a separate disk controller. Once you can control the motor, writing the bits is easy. It sounds like a project we did for assembly language class back in the day. First learn how to program on the 68000, then control a stepper motor, screen, and other peripherals, writing/reading bits here and there, prove it works. After reading other comments, it sounds like most of the schools out there don't do projects like that anymore. At the time, for fun, I even controlled it at home without the PIC and assembly language. It is quite easy to control motors through the parallel port since there are so many data ports. It just a matter of using C to get that done. You can then control the steps of the motor as well as the head with keys on the keyboard. Manually at first making individual movements to prove it works. Then automated/programmed as much as you want later. --you didn't say it had to be marketable or fast or work with current hardware... Really get started with something small and work up from there. We don't know what you are capable of with the limited information you provided us.

  94. It can't be done by nedlohs · · Score: 1

    without using very old hardware or building your own hard drive controller.

    Have fun looking for a new job.

  95. LBA Addressing by Anonymous Coward · · Score: 0

    Just use programmed I/O and LBA addressing.

    Modern hard drives once "blanked", which can be as simple as cat /dev/zero > /dev/sda || /dev/hda ||...etc, contain nothing but an embedded servo track.

    SO, if I write to LBA sector "0", physically, the bits will be on LBA sector zero, which is a deterministic physical location on the actual platter, determined by the servo track.

    Disabling features like automatic relocation is also easy, all modern drives have that functionality.

    This is the lowest level you can go. It disables automatic relocation and defect remapping, it has no file system overhead, no OS overhead, nothing. Nothing but pure and simple 512 byte sectors [ for drives lower than 1TB], and the drives automatic ECC.

    You can arbitrarily write/read any physical LBA sector and the drive will stupidly do what you ask of it.

  96. Who would need "bit-Control"? by Ichido · · Score: 1

    What kind of "Project" would require this kind of "Bit-Control"? It least his post got kidcharles' name in the spotlight and "15 seconds of fame" :-) I am 111010 years old this year! Remember, 1 + 1 = 10.

  97. Cooked Space vs. Raw Space by willy+everlearn · · Score: 1

    Ok, Maybe I missed something (not unusual) but is not the question about cooked space (file system i.e. ext2, fat, ntfs.....so on and so forth) versus raw space (many databases write their own proprietary format)? Oracle does it, so do other open source databases I believe. Or did my train for thought derail?
    http://www.google.com/#hl=en&q=cooked+space+vs+raw+space+database

    --
    No hour on a horse is ever wasted. Winston Churchill
  98. Side benefit that I forgot to mention... by aussersterne · · Score: 1

    Not only does the ST506 interface separate control and data into separate systems (two cables, with actual wires), but the ST506 drive, servo, control, etc. is really easy to work with: very slow circuitry, socketed DIPs, big pins, actual holes through board, lots of wires leading between and to things like the stepper and spindle motors, and you can get at everything (including entire drive disassembly down to magnets and platters) with little more than a computer screwdriver set with a flat head, a philips head, some small torx bits, etc.

    So once you've got a working OS + software + hardware platform up, you also have the freedom with that generation hardware to "edit" the drive in any number of ways by adding your own electronics, etc., with little more than a soldering iron and a leftover box of 74-series logic, if you want to get that basic, and since mainboards of that era have at least two serial ports built in, well...

    Probably given your project you didn't need me to say all this extra, but in case you're not old enough to have ever *seen* an ST506 era hard drive or controller, I thought I'd mention it.

    --
    STOP . AMERICA . NOW
  99. serial port by Anonymous Coward · · Score: 0

    http://sites.google.com/site/seagatefix/
    http://forum.hddguru.com/seagate-terminal-commands-t6411.html
    Some seagate drives have a serial port that you can mess with the drive controller directly. If you can do what you want, I dunno.

  100. LightScribe? by wexsessa · · Score: 1

    The LightScribe feature on some CD & DVD disks/drives appears to be close to what you want to achieve, i.e. it writes 'bits' that create a visible graphics design ("bits anywhere & everywhere"), without regard to what the bits mean as data. So if you can find the tricks behind that, you might be able to find someone who can implement a similar scheme in a HD.

  101. Re:Talk to Steve Gibson author of Spinrite by KlaymenDK · · Score: 1

    I'm not saying that you're right, but it's definitely the case that the tools his company offers, and the explanations about how they work, are unbelievably amazing. Either they're truly brilliant, or the man's a fraud. I don't have the insight to tell which is the case.

    So I don't use his software.

  102. Please help. I'll change my life. by Anonymous Coward · · Score: 0

    I'm working on a project that need to deliver last year. Does anyone know of a free time machine or at least a open api whereupon I can build one. I don't mind if it takes a long time to complete as long as success is guaranteed.

    Thanks in advance.

  103. Re:DD by LordAzuzu · · Score: 0, Flamebait

    <quote><p>Hahaha how cute. This high school student thinks he knows something. And smug as we</p></quote>

    Got nothing better to do than start a flame?
    I tried to give an answer, maybe as stupid as it could be, but better than your for sure.
    Why don't all of the morons who answer with such stupid sentences cut their veins and RIP?
    The world would be a better place, for sure.

  104. Re:Talk to Steve Gibson author of Spinrite by washu_k · · Score: 2, Informative

    The GP is right, Spinrite does not and can not do most of what it claims on a modern HD. The only potentially useful thing it does is re-read sectors up to hundreds of times, but there is safer software that does the same thing.

    More importantly, Spinrite can be downright dangerous to your data. Spinrite writes any data it recovers TO THE SAME DRIVE! It can very easily overwrite other data you want to keep and/or lose the recovered data again because the drive isn't stable enough to hold it reliably. Not writing to the damaged media is data recovery 101 and Spinrite fails badly.

  105. Re:DD by quadelirus · · Score: 1

    Hahaha how cute. This college student knows even less than the high school student he is making fun of and so resorts to mudslinging. And smug as we

  106. Visualizing disk activity by rwa2 · · Score: 1

    On a related note, anyone know of a utility that will let us visualize what the disk is doing? (Other than those disk drives with little windows over the read heads, that is :P )

    I'm sort of looking for something like one of the old DOS/Win3.11 defragger (maybe it came with Stacker?) that showed the layout of used blocks and which ones the defragger was reading and writing to put everything back in order again. I suppose the current Windows defrag utility still sort of works like this, but it's not quite as interesting to watch.

    I'd love to be able to tap into the Linux kernel and just watch the read and write patterns as the system is working. Might also be marginally useful for seeing where different types of commonly-accessed files sit on the platter, maybe it could help rearrange them to optimize readahead buffer hits. I'm thinking of hacking together my own thing using strace and fs block lookups, but just wanted to check if there was something that already did most of this.

    1. Re:Visualizing disk activity by rwa2 · · Score: 1

      Hmm, by way of answering my own question, looks like there's something called bno_plot, which uses blktrace to do most of what I'm looking for...

      sudo mount -t debugfs none /sys/kernel/debug/
      sudo blktrace -d /dev/sda -o - | blkparse -i -

      will print out a realtime text dump of what block activity is going on.

    2. Re:Visualizing disk activity by rwa2 · · Score: 1

      Leaving another usage note on how to actually make the pretty 3D time vs. block# vs. blocks plots, since it's not immediately obvious from the (otherwise well-written) blktrace documentation.

      sudo blktrace -d /dev/sda # do some disk activity, then hit CTRL-c
      btt -i sda_blktrace.* -o summary -B status
      bno_plot.py status_*.dat

      Would be neat to make a near real-time version of this... also if there was some way to associate / cross-reference block numbers with the actual files being accessed.

  107. Re:Please help. I'll change my life. by Anonymous Coward · · Score: 0
  108. Re:Please help. I'll change my life. by Anonymous Coward · · Score: 0

    If you send a million dollars to the Swiss bank account I name I will guarantee your success. I will want to remain anonymous since I am you from the future and I can't interact with you too much or I risk altering my own time line. Simply place the million dollars in the account and you will thank me later.

  109. Not possible by CAIMLAS · · Score: 1

    It's not a possibility: your primary limitation isn't the filesystem, it's the drive itself.

    Modern drives are, for all intents and purposes, black boxes. They do much the same kind of thing internally as an SSD does, but present the data (and drive) to the OS in the more traditional fashions through geometry and the like. The 'beginning' of the drive may not be, as indicated by tests on read/right speed across the platters being reasonably consistent (and many drives being composed of multiple platters). LBA errors result in the internal remapping of 'secret' good sectors to those previously-good but now-damaged sectors. There's precious little way to know exactly what is where on a disk.

    --
    ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
  110. Re:DD by Anonymous Coward · · Score: 0

    Haha, so I was right, but then again, smug high school students who recently installed their first Linux distribution on the family computer (mom made me keep Windoze though... hate her so much! M$!) probably encapsulate a good 75% of all readers of Slashdot. Tell me, do you often give advice when you have no idea what you are talking about? I bet you are THAT guy who sits at the front in each lecture and lets the teacher know of any (no matter how minor or obvious) error he or she does.

    This site would be 10x better if people just you stopped posting pointless comments, maybe then browsing the comment sections would be reasonably enjoyable. Fortunately, I made sure you got your deserved Flamebait moderation, but probably not for long. So many basement dwelling smug idiots here... so few moderation points.

    You are also obviously an American (I'm sorry), so therefore very likely fat. I bet you also watch Anime (sorry, Animu!). Instead of trying to memorize UNIX commands, how about hitting the treadmill once in a while? Just a friendly tip from this AC.

  111. If it's a research / school project... by wideBlueSkies · · Score: 1

    ... just do it in software. Meaning, code up a drive interface in C/C++ ... make it look like system calls to a physical drive, but behind the scenes said code would just write to a big pre-allocated 'drive file' sitting in your comp's filesystem.

    I'm sure there's a bunch of ways to implement this, and problems to solve for sure. But it's probably less effort then overriding the error correction, etc, of modern HD's.

    --
    Huh?
  112. Not practical by clone53421 · · Score: 1

    Why would you need to do that?

    As others have said, your choices are few:

    A) find ancient hardware that will actually let you do it
    B) create your own hardware
    C) write to a disk image instead and emulate the entire thing in software

    Obviously C is going to be the easiest, most portable, but least efficient of the three. Without knowing why you need to do this, though, or what exactly you need to do, I’m thinking C is the best.

    --
    Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  113. Confusion by doogledog · · Score: 1

    When someone says they want complete control over the locations of bits on a drive that could be taken to mean the actual magnetic domains (which aren't simply digital values anyway) or it could just mean the logical digital values that are seen by the OS and filesystem drivers. I wonder if by using phrases like 'magnetic hard drive platter' and mentioning Reed-Solomon encoding, kidcharles has made people think of the lowest level meaning of 'location of bits', whereas in actual fact he just wants something like /dev/sda.
    'A free and open source solution' is mentioned.. but theres no mention of what form this solution might take. In the case of a custom HDD controller (which people have suggested as a solution) this would mean something like a VHDL or Verilog implementation (but it would be highly vendor and model specific, plus there'd probably be IP issues). But when people say 'a free and open source solution' they tend to mean software running on a common desktop OS. Oh and I guess there's the question about 'any good utilities' which suggests that kidcharles isn't after an entirely programmatic approach.

    So, if I'm correct, any decent disk editor will supply the required level of control. I can't be bothered to look any up (Google will help out here) but I know there are plenty (open source, free or proprietry) for Linux, DOS and Windows. Hell, you could possibly do it all with shell scripting under Linux if you so desired :-)

    Alternatively, maybe kidcharles wants to make spirograph like artwork for creatures that can see in the magnetic spectrum.

  114. Emulation by hrieke · · Score: 1

    Would it be possible to create an emulated disk layer which would handle the request?

    --
    III.IIVIVIXIIVIVIIIVVIIIIXVIIIXIIIIIIIIVIIIIVVIIIV IIVIIIIIIVIII...
  115. rewrite the disk firmware. by Medievalist · · Score: 1

    My question for Slashdot: is there a way to get down to the 'bare metal' and write these bits?

    Not using commonly available hardware. The disks sold today contain small computers that take your requests for specific sectors and translate them for maximum reliability and efficiency. This frees your main processor from doing that work and reserves your I/O bandwidth for data; it's more efficient.
    I did what you are talking about in the early 1980s using a PDP-11/34 computer and RL01 and RL02 disk drives. That system is still running today in an aerospace application, but I would never write something like that today. It's no longer an optimal use of resources.

    Any good utilities out there to do this? Obviously a free and open source solution would be preferable, but I'm open to anything at this point.

    I don't know of any utilities specifically designed to re-write the firmware on hard drives with custom code, but the firmwares are definitely writable, so you should be able to do it if you are motivated enough. I'd start by googling it, personally.
    You might also want to look at the various linux bios projects out there; those guys are re-writing the firmware on their motherboards, which is a somewhat similar process.

  116. LigthScribe like by saulot · · Score: 1

    Maybe the author want to make "art" using a light scribe like method... I guess that his guess is that a bunch of "1" could be visible somehow.

  117. Re:Talk to Steve Gibson author of Spinrite by Anonymous Coward · · Score: 0

    The stuff Spinrite does stopped working 15 years ago.

    Don't tell that to the drive I used Spinrite to recover last night...

  118. Re:DD by Anonymous Coward · · Score: 0

    He's trying to hide his child pornography.

  119. You will need to hack the drive itself by rclandrum · · Score: 1

    Every floppy and disk drive I can recall (even back to 8-inch floppy days) uses some type of controller. The controller translates your track and sector requests into stepping motions of the write arm(s) on the drive. Once the controller indicates that the head is positioned over your requested track, there is a latency while you wait for the "index" mark to appear which indicates the start of the track data. At that point you supply special codes to tell the controller that you are starting a new sector, the sector number, sector size, etc, after which you send the data. All of the sector info and data are encoded automatically by the controller and combined (at least in MFM encoding) into a bit stream. My belief is that attempting to work out all the combinations needed to get exactly the series of 1's and 0's you want is probably not a practical solution.

    About the only solution I can think of that would allow you to do this is to actually hack into the signal supplied to the recording head at the end of the write arm. That means that you will need an oscilliscope to locate the signal and determine the voltage and duration required to write 1's and 0's. You will also need to understand whatever mechanism the drive uses to detect the index mark (the start of a track). If the drive does not use index marks, you won't be able to align the bits on one track in relationship to the bits on any other track. Assuming you manage to obtain all this info, you will then need to cut the drive line from the controller to the head and splice in your own drive line that will supply the raw write signals.

    My guess is that this will not be a practical method for achieving whatever it is you are aiming for, in which case I agree with the previous poster that recommended the use of a XY table driving a custom write head over a custom magnetic surface.

    On the other hand, you didn't specify that you need to be able to *read* any of the bits you want to lay down, so why not just hand in any old drive and tell them it was a piece of cake and let them worry about how to verify your work :-)

    On a more practical note, if what you want is to lay down an exact pattern of bits onto a magnetic surface, the easiest path might be to use a cheap off-the-shelf laser printer. Simply create a 300 dpi image of the bit pattern and print it. You can them pick up the pattern off the printer drum.

  120. Re:Talk to Steve Gibson author of Spinrite by Chirs · · Score: 1

    The tools are fine. The descriptions are overblown.

  121. Anonymous Coward by Anonymous Coward · · Score: 0

    Why not use a virtual drive? Write some software that emulates a hard drive in a flat file, and code it to allow you to write to specified locations on the "disk".

  122. without hacking hardware? by vile8 · · Score: 1

    No idea what your trying to do... art, fast file system, error recovery, special new virus etc... but I'd start in one of two places. If you are trying to write your own filesystem because everyone else is "doing it wrong" then check out Oracles "unbreakable" installation.... a bit dated and I don't know if they still do it this way, but the gist is you mount the drives with "rawfs" and they have their own file system stack that runs on top. Pretty effective way to trim down the layers of stuff before reads and writes and speed up raw access. .... again, depends on your implementation if this would be useful to you. If you actually want to write ones and zeros I'd check the source for fdisk and see what its doing.... might be a gem there since it clearly is aware of geometry and has some access to writing in places you normally wouldn't. Good luck!

  123. Write bits directly by Anonymous Coward · · Score: 0

    Good old Steve Gibson of Gibson Research (http://www.grc.com) used to know how to do this trick. He has a utility called SpinRite that allows the software to write and read in places on the disk where the disk intelligence will not allow.

  124. Not Doable by Toad-san · · Score: 1

    Even the very oldest hard drives didn't have physical control of exactly where data was written. Oh, they laid out x sectors on y tracks, and you could maybe measure where track 0 was and where track y was on the platter itself (by marking the actual head position), and determine the physical location of those tracks.

    But the starting sector? Purely arbitrary: CPU or disk controller said "now", there was sector 0, and all the other sectors followed (the length of sectors being determined by the number of sectors).

    Now, you _can_ possibly locate where sector 0 begins (I visualize a tiny spray gun electronically controlled to fire when track 0, sector 0, bit 0 is read). But I don't envy you that job. (Ever try physically modifying the read/write heads of a hard drive? No, I didn't think so.)

    Again, with the older drives (especially the washing machine sized drives back in The Day), you could do physical stuff. Hell, I had an old 25MB hard drive that wouldn't start sometimes. But it had a flywheel (really) accessible between the control board and the drive case, and I could reach in with the eraser end of a pencil and "spin it up". I called it "kickstarting the hard drive", used to amuse hell out of visitors).

    None of the new highly compact hard drives will let you do that sort of physical stuff. And they certainly aren't accessible to external CPU control: way too much (as said above) is done on the controller board.

    So good luck to you. I'd give it up if I were you.

  125. Floppy? by Anonymous Coward · · Score: 0

    Shouldn't this be possible with a plain old floppy drive? Sure, that's just 2 MB of storage (raw bits), but hey, there is a linux utility (superformat) with "example" code to get you started...

  126. Not a Stupid Question - And a suggestion by Jeremy+Lee · · Score: 4, Interesting

    I'm surprised by the number of people who seem hostile to this question, mostly because they can't imagine any circumstances where they would want to do this. I can think of several. In fact, I was thinking about something similar with optical disks just earlier today. (I'm curious whether small holograms could be created by writing an interference pattern directly onto a CD or DVD, but I would need exact control over how the tracks lined up to achieve this.)

    Here's some concepts just off the top of my head:
    * He's come up with a new disk encoding scheme, and wants to try it out.
    * He's doing research into how long disks retain data, and is questioning basic assumptions like whether surface bits permanently magnetize the platter underneath, affecting later bits in the same location. Or how far the domains spread.
    * He's working with self-assembling molecules and needs to give them a patterned magnetic surface to build on.
    * He wants to 'print' a 2-D picture onto a small portion of the hard drive, and bounce a laser off it. (The magnetic alignment of the surface domains would polarize the photons slightly.)
    * He's making a high-resolution rotational position encoder, so by reading across 32 tracks knows the rotation of the platter down to a few nanoarcminutes.
    * He wants to totally destroy the contents of a disk. (I assume this is what most of the hostile people think is the intention, presumably as the payload of some virus)

    Those are just the ones off the top of my head.

    However, the ranting people do have a point that without knowing WHY you want to do this, we can't really suggest the best solutions. A lot of people have recommended going back to super-old MFM hard drives that allowed this, but we don't know if you require the density of modern hard drives.

    To do this with a modern drive, you're basically going to have to rebuild the controller. Either totally remove the controller board (leaving handy raw connections to the stepper motors and drive heads) or cut the connections between the microcontroller and the low-level electrical functions of the drive, and substitute your own. Here's where knowing your accuracy requirements could have help, because if you want relatively large bits, you can get away with fairly low-frequency components. A 20Mhz microcontroller can, with say an external high-speed shift register, push out an 80mbit/s serial stream, which equates to >120,000 bits around the track of a 6,000RPM drive. Not quite the same density as the manufacturer, but better than the old MFM drives.

    Your next problem is going to be this: It's really, really hard to tell where the head is on a platter. I've no idea how modern drives do it, but it used to be done with 'marker' bits either in the track, or on a nearby 'index' track, plus a little timing. Preserving these location marker bits is actually the most important job of the drive controller.

    It's not impossible, merely very difficult. I could probably make one with only several weeks of hard work.

    Alternately, you could try getting into the firmware and re-writing it to your specifications, but that might take longer. You would have to reverse-engineer a lot of stuff that is specifically hardened against this, but at least the hardware would be stable.

    --
    Jeremy Lee | Orinoco
    1. Re:Not a Stupid Question - And a suggestion by dfsmith · · Score: 1

      * He wants to send the disk in to outer space and give the aliens a fighting chance of reconstructing his DNA from the contents.

  127. maybe he's an artist by Anonymous Coward · · Score: 0

    that wants to paint electromagnetic pictures of the Mona Lisa.

  128. Not in 2010, you can't by billcopc · · Score: 1

    Back in the good old days, we had MFM drives. These things were huge stupid spindles that required a separate controller board. If you had one of those, you could design your own minimalist controller chip (as an FPGA or fast PIC), and access the MFM platters directly. That was, oh, 15-20 years ago. Today the controller is built right into the drive, that's that little board on the underside. Today's controllers are quite a bit more complex than the old ones, with much tighter tolerances to support modern bit densities. The short version is that if you're on Ask Slashdot, you do not have anywhere near the level of skill and topical expertise to design your own controller. Either find yourself a hard drive engineer, or hide your porn in the Recycle Bin like everyone else.

    --
    -Billco, Fnarg.com
  129. Maybe you should defraggle it first by Megane · · Score: 1

    This site seems to have the kind of information that the submitter needs.

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  130. Not really that hard by Anonymous Coward · · Score: 0

    Find a drive that support the old ATA command "WRITE LONG" and "READ LONG". These commands write out the entire sector including the ECC PAD so a sector ends up being 512 bytes (arrange the bits in any order you want) and 8 bytes of ECC (again with Write long just write out 520 bytes of data any order you want). This won't actually put the bits and bytes on the drive exactly because the drive has randomize the data on the platter to ensure reliability, but it will give you more physical control of where the actual data is located on the drive.

    In other words if you put the bits on the drive yourself in something remotely human readable you will have a high failure rate in reading them back correctly.

    The only way around this is to follow the other suggestions and use a really old drive that can literally write the bits to the drive directly without any modern ECC, PRML or any other obstructive acronym.

  131. use a pen by Anonymous Coward · · Score: 0

    use a felt pen (the permanent marker kind). but make sure you write legibly. you can then control exactly where the ones and zeros are written, and even control their shape...

  132. it's there by Anonymous Coward · · Score: 0

    Drives today have the ability to do that, problem is it's buried in code used by engineering and the manufacturing test process that isn't accessible to customers. I do it all the time. You wont be able to read it back, encoding and any error correction functions are gone, but the capability is there. Find an independent consultant in the drive industry for help.

  133. Virtual Disk File by stlthVector · · Score: 1

    Have you considered writing to a virtual disk file of some kind? You could create your own "disk" file and write to it any way you want. You just need to create your own virtual controller and disk format - though you could probably come up with some open source tools from something like Xen or Bochs to help you.

    I don't know that this would be easier but it may not be harder and it could be free. If you do manage to get it to work this way you'll have the advantage of not being locked down to any specific hardware.

  134. adaptec datasheets by Anonymous Coward · · Score: 0

    long ago programmed first adaptec products: harddisk controller chips
    which looked to be pre-programmed microcontrollers. the datasheets
    of these chips had the info about extra bits written on disk for the pll
    sync. etc, see also the fd-1791 datasheets.
    maybe analyse such old adaptec controller like this one:
    Adaptec ABC4000 SASI->ST506, (2x Wren CDC 9415-86)
    never seen opensource harddisk controller firmware despite rms.
     

  135. Obligatory xkcd by Anonymous Coward · · Score: 0

    http://xkcd.com/378/

    Use emacs

  136. the first sector is the boot sector by happyjack27 · · Score: 1

    hence your troubles.

  137. Simple Answer by jebrew · · Score: 1

    There are a lot of comments to shift through, so I imagine someone else has already put it out there that the long and short of it is: not without custom hardware. Additionally, if you have the hardware to do something useful with the bits once they've been written, then you should have the means to perform the writes. If you're wanting to get exactly the bits that the drive controller thinks are in particular places without regard for OS caching and so on, then doing direct SCSI passthrough will get you as close to what you want as the drive will allow, though this still leaves ECC and you'll have to deal with sector boundaries (512b for the majority of drives, 520b seems to be mildly popular as well). As has been pointed out by many, knowing why you want to do this may lead to a better solution.

  138. impossible by StripedCow · · Score: 1

    Unfortunately, modern hard-drives are more closed than the iPhone. It's practically impossible to get anything past the built-in controller, unless you're willing to open up your HD and do some hard hacking.

    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
  139. Well, since we're dancing around the short answer by EriktheGreen · · Score: 2, Insightful

    I'll give the direct/short answer to the question you're asking.

    No.

    The reason is that hard drives only write data in precise locations so they can find it later. You can't write anywhere other than those locations because the drive won't do it... not even with new firmware. The read/write heads may not even be capable of addressing the locations you want to write. The only way to write in an arbitrary location is to remove the disks from the drive in a clean room, and use a very precise CNC read/write head to address the locations you want. Disk manufacturers have machines that do this.

    If you confine your request to only writing arbitrary locations within the physically addressable areas of the disk, then you can do what you want if and only if you write new firmware for the drive... it used to be firmware was in EPROM and couldn't be altered, but you can flash it nowadays. So you A) Buy a drive then B) Re-flash the eprom with code to do what you want (custom developed after reverse engineering the original firmware) and then you can write wherever, without worrying about niceties like the end of sector marks the drive uses to keep track of data locations. You'll have to do that sort of thing yourself.

    So, confining our discussion to disk areas that the default drive firmware will write to, If you're looking for a way to ignore/override the OS I/O code, the disk controller firmware and the disk firmware in order to "talk to the bare metal" it may be possible depending on the particular combination of OS, controller, and disk, and assuming you have the right privileges in the OS. But there's no standard way to do it, nor API. You have to know exactly how the hardware in question works, down to the chip level and in some cases below. If the computer you're interested in has a different drive, controller or OS I/O code than you wrote your program for, then you have to re-write it.

    I'm sure a lot of us here would be curious to know what you're trying to do... accessing non data sectors on a disk hasn't been done commonly for years, and when it was it was used for some awful copy protection methods (awful as in they created compatibility issues, even with "standard" PC hardware and also they could still be broken).

    Erik

  140. Easy by Anonymous Coward · · Score: 0

    It is actually quite easy, you need to redefine "bit" though to be whatever is the minimum chunk of data your controller will write to the disk. You can then pad out your data to be all 1's or 0's to fill up that minimum chuck. You can then invent your own parity/error system at whatever level you like. Sure you are not turning on/off individual atoms/whatever but this should achieve the granularity you are seeking, at the expense of capacity.

  141. Probably an "art" project by Anonymous Coward · · Score: 0

    I bet he wants to draw a picture on the platter and sprinkle some magnetic filings on the platter to see it.
    Wow I really hope that's not true, I just made myself puke.

  142. Butterfly by Anonymous Coward · · Score: 0

    Just use a butterfly.

  143. logical vs physical sector by pikine · · Score: 1

    The very first logical sector of a hard drive should hold the master boot record and partition table. If your hard drive was never partitioned by you, it would hold a default partition table that shouldn't be hard to guess. If you destroyed the partition table, your OS would not recognize the file systems on it, but you should see the device in the disk management utility which would offer you to partition and reformat the drive. If you guessed the partition table right and write it back, you'll get all your filesystems back.

    However, logical sector is different from physical sector. Logical sectors are the numbering accessible by software. Physical sector is only meaningful on the platter. Hard drives have been known to hold reserves of physical sectors so it can map out bad sectors to good ones. The drive could theoretically elect to store such mapping in a physical sector, where the first physical sector holds a root mapping.

    I just want to make sure, the data recovery company is talking about firmware in the first logical sector, or the first physical sector?

    --
    I once had a signature.
  144. Re:Talk to Steve Gibson author of Spinrite by dhovis · · Score: 1

    He can't have been too far wrong about RAW sockets. Microsoft quietly took them out of Windows XP three years later.

    http://seclists.org/nmap-hackers/2005/4

    --

    --
    The internet is the greatest source of biased information in the history of mankind.

  145. floopy disk track 40 by pikine · · Score: 1

    Floppy disks had 40 tracks, numbered 0 through 39. But most floppy disks do have enough surface for one or two extra tracks, numbered track 40 and on. If you format it, you could store extra data on it outside of the file system. This is how some DOS games did copy protection because diskcopy ignored the extra tracks and assumed they did not exist.

    --
    I once had a signature.
    1. Re:floopy disk track 40 by gullevek · · Score: 1

      yeah, so that's why everyone used VGAcopy

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
  146. dd by anglophobe_0 · · Score: 1

    Is there any reason why you couldn't use dd with an offset to accomplish this?

  147. Lightscribe for hard disks by Anonymous Coward · · Score: 0

    Ah dude... you do realize theres like a metal cover over the hard disk platters and even if you were to succeed the 1's and 0's would optically look no different.

    There is no reason to do what your asking. If you just want to be able
    to read and write from a disk as a gigantic linear array you can do so with the drive logic in place.

    If you need performance get a faster spindle and use a write buffer.

    Direct access is not going to buy you a damned thing.

  148. kidcharles is Rube Goldberg? by Anonymous Coward · · Score: 0

    Seems like useless requirements.

  149. Why ask us if you already know the answer? by mcmonkey · · Score: 2, Insightful

    Remember this next time you are struggling getting requirements out of a non-technical manager or user. The submitter obviously has the technical background, but is making a common mistake.

    What is it you want to do? "I want to write bits directly..."

    Really? That's your final goal? Just to write bits? No, there's some other task you want to complete, and you've determined the best way to complete that task is to write bits directly to the platter.

    But if you can't write bits directly to the platter, or you don't know what additional issues may arise when you do so, how can you determine that is the best course to take?

    So slow down, back up a step, let us know what your real goal is. You want X, and you think the best way to X is to write bits to the platter.

  150. Re:dd by Anonymous Coward · · Score: 0

    Because that gives you absolutely no control over the physical location...?

  151. reverse? by Anonymous Coward · · Score: 0

    maybe get a new "empty" (possible?) harddrive and do some "test" writing on it.
    i'm sure there's a way to acctually see where the data has been writen to on the
    disk (defrag seem to know?).
    erase the disk to "empty" again (possible?) and repeat.
    i'm sure this way you can figure out what the black-box inbetween the OS and the physical
    magnetic disk is doing. once you figure this out you'll just have to "cheat" your way thru the
    not-so-black-anymore-box to get those ONeS and ZeROeS in the order you want on the disk ....?
    (50% tongue in cheek)

  152. Short answer... by bwcbwc · · Score: 1

    It isn't worth trying.

    It can be done, but pretty much requires a couple of EEs and possibly a semiconductor fab. At a minimum it requires documentation from the manufacturer about how they map the virtual cylinder/head/track/block IDs used by SATA/IDE into the physical locations on the media. Once you have this information, you could create your own disk device driver to force data into the specific locations. This still doesn't get you beyond the structure imposed by the low level format of the drive, though.

    Alternatively, you could rip the controller hardware off the disk drive and reverse-engineer it to figure out the hardware location mappings on your own. You'd then have to build your own controller hardware (hence the fab) to gain the required control and impose your own low level format on the drive.

    As a practical matter, your best bet is to write your own file system driver. That at least is plausible, even if it's reinventing the wheel.

    --
    We are the 198 proof..
  153. Thanks for the advice, but... by Joe+U · · Score: 1

    It would be nice to know why the poster thinks this feature is important

    It would be nice to know, but it's their research project and that's how they want to proceed. So assume the requirements are set in stone and go from there.

  154. It's not copy protection - it's ART by Bryan3000000 · · Score: 1

    This kind of copy protection has been outdated for quite some while and should have died with floppy disks ...

    It's not copy protection at all - he just wants to find a way to write images directly to the platter. I would have to suggest that using lightscribe on a cd would be easier and more cost effective. ;)

  155. Hopefully you're good at Assembly Language by yxyband · · Score: 1

    Kidcharles: You can do it but you'll need: A) lots of experience with ASM B) Controller's Hardware Tech. Manual (you control the controller), your BIOS Tech. Manual, your OS Tech. Manual C) A debugging hardware board and/or a couple of machines to work on. D) You should at least have some experience using BIOS INT 13h calls You may be able to accomplish what you want with just the BIOS INT 13h calls (INT stands for interrupt) which allows some pretty specific disk access. Generally how raw write/reads are done. You can also expect quite a few low level formats from making mistakes. Hope that helps some

    --
    The more complex the task, the simpler the steps need to be.
  156. Anonymous Coward by Anonymous Coward · · Score: 0

    On modern hard drives its very hard to get down to the platter level. Thats one reason why you can't low level format a hd. Can it be done? Yes. Is it easy? No.

    What it would require is for you to write some assembly code to allow you to talk to the hd's controller chip. It has to be in assembler and not a high level language for the simple reason is that most of them do not allow you to access the hardware directly. The other reason why you would have to use assembly is because Windows will prevent it for the most part as well.

    If you google low level disk access you might find some that might help you out and even give you some code. Any drive you do this on might not work anymore so try it first on a drive you don't care about.

  157. talk to Steve Gibson by swschrad · · Score: 1

    if there is any way to do the impossible with hard drives, he's got the notes on it.

    there is no good earthly reason to bit-poke a drive, and few in this universe, which is why the electronics for controlling drive writes/reads are all in the drive now, massively chipped, with sensors to adjust the servos for temperature, pressure and the like to put the bits smack in the middle of the track.

    --
    if this is supposed to be a new economy, how come they still want my old fashioned money?
  158. Requires a lot of research. here is a starting pnt by Anonymous Coward · · Score: 0

    Look up software called victoria or mmhd. Start reading the forums. What you are trying to do is possible but most are right in that you need to bypass the onboard controller using nested int calls. You will need a fair amount of specialized hardware as well and the ability to put the drive in factory test mode. Might want to look into fujitsu as they are a little more loose lipped that lets say, seagate.

  159. Write Bits Directly Onto a Hard Drive Platter? by zazelite · · Score: 1

    I believe the technical term for this is deep magic - or I would, if I thought the poster understood what the words 'write', 'bit' and 'platter' mean in the context of hard disk drive tech. As it is, the question is so nonsensical it's bizarre.

  160. USB to ISA by Anonymous Coward · · Score: 0

    I was going to make some joke about a ISA to USB converter.... but at the last moment before submit I decided to search.

    It exists:
    http://www.arstech.com/item--usb2isax7.html

    Due to the nature of ISA I can't imagine this works well for all ISA hardware.

  161. used to do it with BIOS interrupt int 13h by Anonymous Coward · · Score: 0

    Used to be able to read and write arbitrary sectors with assembly code using BIOS ISR "int 13h". You can only read and write sectors. If you want to read/write bits, you need to get into the firmware loaded on the hard-drive themselves. Contact the hard-drive manufacturers. Some of the obsoleted firmware's source may be available to you if you execute NDA with them. Better yet, go through an University if you have acadamic contacts and the process may be smoother. Even wit firmware changes, I still believe that you can only read/write sectors at a time due to hardware design and not any individual bit within a sector. In any case, hard drive companies will have the final answer for you.

    If you are not able to obtain off-the-shelf-hard drive, use the platters, and find/make a high-resolution CNC machine that you can control using the hard drive components. Use the hard-drive head on CNC machine. At the end of the day, hard drives are all controlled by motors.

  162. Why would you want to do this? by mikein08 · · Score: 1

    Unless, as others have suggested, you have nefarious motives. IO subsystems can be more complex than the OS itself, if you indeed know anyting about either. And you would be trying to re-invent the wheel by trying to do what the poster says he wants. And I can guarantee your "new wheel" whould not be very round or useful. People who write competent IO subsystems tend to have genius level IQs.

  163. what about floppy? by Anonymous Coward · · Score: 0

    Can you do it in floppy disk?

  164. SCSI Drive? by Anonymous Coward · · Score: 0

    If you can use a SCSI hard drive (including SAS, FC, and parallel transports), most of them support the 'write long' command. This allows direct access to the bits on the disk, though the implementation is vendor specific and can vary. I've used this command to write intentional 'bad blocks' on a drive so I can test error recovery. Here is a tiny blurb on this command:
            http://en.wikipedia.org/wiki/SCSI_Write_Commands#Write_Long
    Much more detail in the SCSI block command set:
            http://www.t10.org/drafts.htm#SBC_Family
    In the past I've used the 'scu' utility to perform these operations, as well as vendor utilities of various kinds (I forget names).
          http://home.comcast.net/~SCSIguy/SCSI_FAQ/RMiller_Tools/scu.html

  165. For science? by Anonymous Coward · · Score: 0

    Here is one reason the OP may want to do this: http://cua.mit.edu/ketterle_group/Projects_2007/Pubs_07/Boyd2007%20PRA.pdf (trapping ultracold atoms using the magnetic field from a hard disk platter).

  166. Tell us *what* you are trying to do, not *how* by Snowhare · · Score: 2, Insightful

    Almost every time someone asks a question where they obviously have made an implementation decision that depends on "doing it differently than everyone else on the planet" while providing no information about what they are trying to actually accomplish, the problem can usually be solved in a much simpler way. While it is possible you are doing something exotic like trying to turn a hard drive platter into a meta-material by patterning high density magnetic patterns on it and so you really do need to be able to control the bits at the hardware level, odds are low.

    You provided no information about what you are trying to do. There are pretty good odds that if you provide information about what you are trying to do instead of trying to get people to come up with a way for you to do it 'the hard way' you, will get an answer that will work for you.

  167. Why a physical drive? by lucian1900 · · Score: 1

    If you really need a physical drive, you'll have to make your own controller or use really old hardware. Why not try a virtual drive? I bet qemu has quite a bit of helpful source code. Real filesystem source code might also be helpful, like ext2/ufs.

  168. Tell Us Why WAH WAH WAH WAH by dcollins · · Score: 1

    Geez. This is not the first thread with the majority of wasted posts in the "wah wah why won't you tell us why you need this, you're a big dummy plllbbbb" category, but it's getting more and more aggravating over time. Slashdot seems to be slipping into the idiocracy with this stuff.

    The guy can't tell you why because he's under NDA. Or his higher-ups gave him unreasonable requirements that he tried and failed to dissuade them from, but he wants to be diplomatic instead of making a public stink over it. (That was my case last time I got this treatment here.)

    The fact that the guy's disciplined enough to not respond to the flamebait indicates to me that he probably knows exactly what he's doing.

    --
    We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
  169. Re:DD by Frank+T.+Lofaro+Jr. · · Score: 1

    Or is a terrorist.

    --
    Just because it CAN be done, doesn't mean it should!
  170. Re:Hm ... - Is it outdated? by mykepredko · · Score: 1

    When I first saw the request, I wondered if it was for a copy protection scheme in which an entire (USB/FireWire) disk is loaded with the application and distributed with it.

    Disks are amazingly cheap right now.

    myke

  171. DD? by Anonymous Coward · · Score: 0

    Can't you just specify the offset for what you want to write in DD? Don't need a filesystem, don't need a partition, etc. Am I missing something, here?

  172. PRML by booch · · Score: 1

    Yeah, I was going to mention PRML as the main problem. There ARE no 1s and 0s on the disk surface anymore. Instead, the read head receives an analog signal and tries to statistically determine what the LIKELY values are supposed to be.

    --
    Software sucks. Open Source sucks less.
  173. Several things you need to know. by Measure+Twice · · Score: 2, Informative

    First, ones and zeros on a harddisk platter are not magnetic north and south, they are different frequencies of an FM sine wave. Second, the formatted tracks on a harddisk don't line up physically. The start of the track is wherever the head was when the controller was told to format that track. Third, Sectors aren't written in precise places inside their formatting. The low-level formatting process writes headers across the track that are used later to find the data. There's enough extra space between those headers that a sector of data will fit there, based on the ability of the controller to read where the sector starts and be able to write it. If you really need to write magnetic north & south to specific spots, you should look at Floppies. Floppy disks have a hole to mark one spot on the disk, so the start of track comes much closer to lining up. You can even write ones and zeroes instead of FM patterns if you have an old Apple II, which didn't use FM encoding.

  174. Hire Steve Gibson by LandGator · · Score: 1

    Steve Gibson can get it done for you. http://www.grc.com/

    --
    There is nothing wrong with yr Internet. Do not attempt to adjust the picture. We are controlling the transmission - NSA
  175. Talk To These Folks by not_hylas(+) · · Score: 1

    Talk to these folks, they'll get you on the right track.

    Plan 9:

    http://plan9.bell-labs.com/plan9/

    http://plan9.bell-labs.com/wiki/plan9/mailing_lists/

    If there's a way - they'll set you on the right track.

    --
    ~hylas
  176. hmm... by Anonymous Coward · · Score: 0

    Careful there. I know you're addressing a typical user of the hard drives, but there ARE ways of -- and reasons for -- getting at the "bits themselves". One of my colleagues, as a fresh student at one of the National Labs in the US, was tasked with recovering data from a crashed (literally crashed, so that the controller was destroyed and platters bent, with lots of data loss) disk. Of course there are ways and means of doing so, usually involving fantastically specialized equipment and lots of expense (and, often, the complicity or orders at the Federal level).

    He ended up building a sweet little system which could scan the surface (in a low-level clean-room, of course), albeit slowly, and interact directly with the bits.

    I'll have to ask him how they figured out the filesystem, the error-correction, and so on, without any of the usual partition tables and so forth.

    How much of the "recovered" data do you think he didn't have to fake?

  177. Re:Talk to Steve Gibson author of Spinrite by colinnwn · · Score: 1

    Can you give us some Linux or Windows tools that do what Spinrite does correctly (i.e. tries many times to re-read corruptly read sectors) but fixes what it does poorly (write recovered data back out to another hard drive)?

  178. Re:DD by marcosdumay · · Score: 1

    No, it is not. You build a cryptographic system with math, not with specialized hardware.

  179. DD! by wolf1oo · · Score: 1

    Have you ever heard of the Unix command dd? I think that may be what you want. It writes directly to a disk, regardless of filesystem and/or format.

    http://en.wikipedia.org/wiki/Dd_(Unix)

  180. Weren't RLLs just compressed MFMs? by Wabbit+Wabbit · · Score: 1

    e.g. a 20MB MFM became a 30MB RLL?

    If so, RLLs would be out, because the compression system would get in the way of direct bit placement on the platter.

    I still have a couple of those old Seagates somewhere (including the full-length ISA RLL controller card), along with a (Western Digital?) 150MB ESDI drive. Ah, the good old days.

    --
    Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
    1. Re:Weren't RLLs just compressed MFMs? by RockDoctor · · Score: 1

      e.g. a 20MB MFM became a 30MB RLL?

      If so, RLLs would be out, because the compression system would get in the way of direct bit placement on the platter.

      Yes, and yes.

      An old MFM or ESDI drive should do the job nicely. You should be able to shove the drive and controller into a 386 or 486 system, which should be able to load and run a linux system up to around the early 2.x kernels.

      Who particularly cares about running X on it - you might as well just build the box headless and telnet into it.

      Or, if the original questioner wants to get really close to the metal, dig out a PDP-11 or an early VAX from the local nerd-museum and learn how to drive the 14" platters of the dismountable hard drives. What were they RL-02s and/ or RL-05s ?

      Been to a Stallman lecture? He uses one of the platters for his "St Ignutius" halo.
      One of these : http://stallman.org/photos/st-ignucius/vatican/mid/mid_img_7594.jpg
      not one of these : http://stallman.org/RMS_13_bendicindo.jpg

      --
      Birds are not dinosaur descendants;birds are dinosaurs, for all useful meanings of "birds", "are" and "dinosaurs"
  181. Re:Talk to Steve Gibson author of Spinrite by washu_k · · Score: 1

    Roadkil's unstoppable copier. Works on both Windows and Linux
    http://www.roadkil.net/program.php?ProgramID=29

    dd_rhelp works with dd_rescue to try to recover from disks with bad sectors.
    http://www.kalysto.org/utilities/dd_rhelp/index.en.html

  182. Purpose needed; headless chickens are flapping by MessyBlob · · Score: 1

    Without the purpose of the original question, we're all left running around like headless chickens.

    I can only assume that the unrevealed purpose is kept hidden for a reason. I'll make a punt and suggest that anything legitimate could be done by implementing a file system along with diagnostic tools, or even just with flat files.

    My response would be that the target technology is all proprietary, and the whole chain is carefully-engineered to convert the material analogues into digitals. There's even a fair chance that the near-physical stuff abstracts away the bit-level materials, so you'd have to re-engineer right down to the platter. You'd need a very expensive and shiny lab to do that.

  183. SCSI "write long" command will do this by Anonymous Coward · · Score: 0

    It is optional, but was well supported by drives in the 90s, and may still be. It was typically used by vendors like EMC to be able to predict disk failure before it occurs (i.e., by increasing need for ECC codes indicates a bad sector may be forming)

    So grab a SCSI card and whatever SCSI drives you or someone else has laying around and see if this is supported...

  184. Why not using UNIX system calls by Anonymous Coward · · Score: 0

    In the Linux Kernel, and probably every UNIX, it is possible to write directly to the raw device using system calls.

    If you need to write data that doesn't fit in the regular 512 bits block, you will need to read the full block, modify it and write back the full block. If you need to write bits one by one, it will be terribly slow (maybe 100k/s), but it will works and be very cheap. And the amount of needed code is very small and perhaps there is already some library for that.

    Sure, technically there will be ECC code transparently written to the physical disk, but personnaly I consider this a great feature. If you really need to to access or modify even the ECC bits, or get ride of them (which I seriously doubt), then there is special hardware available that are mostly used for data recovery or forensic analysis.

  185. dd by JeffSchwab · · Score: 1

    1) You want logical locations, not physical locations. I promise.

    2) On Unix-like systems, you can open the device node, and seek directly to the locations of your choice.

            int const fd = open("/dev/sda", O_RDWR);

    3) If you have a predetermined image you want to slam onto the disk, use dd. Depending on what else you want to do, other command line programs may also be useful. For example:

    ~$ uname
    Darwin
    ~$ sudo hexdump -n 600 /dev/disk0
    0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00001b0 00 00 00 00 00 00 00 00 38 2d 00 00 00 00 00 fe
    00001c0 ff ff ee fe ff ff 01 00 00 00 2f 60 38 3a 00 00
    00001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    00001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
    0000200 45 46 49 20 50 41 52 54 00 00 01 00 5c 00 00 00
    0000210 ab 81 40 18 00 00 00 00 01 00 00 00 00 00 00 00
    0000220 2f 60 38 3a 00 00 00 00 22 00 00 00 00 00 00 00
    0000230 0e 60 38 3a 00 00 00 00 48 75 00 00 de 3e 00 00
    0000240 fa 0c 00 00 7d 31 00 00 02 00 00 00 00 00 00 00
    0000250 80 00 00 00 80 00 00 00
    0000258
    ~$

    Good luck.

  186. Memo to Senator Stevens: the posters above are joking. You do not need to introduce legislation to prevent these disasters. Kthxbai.

  187. Just use a floppy drive by Anonymous Coward · · Score: 0

    Just use a piece of old technology that's still available to buy.

    Use a floppy disc instead of a hard disc.

  188. Re:Talk to Steve Gibson author of Spinrite by PhunkySchtuff · · Score: 1

    Yes, except Steve Gibson would develop this über-leet super seekret method for doing it, would call it by some funky name (Project Y?) and then boast about how it's hand-crafted by a virgin in 100% assembly language - all the while it just reproduces the functionality of something that already exists (dd)...

  189. the one who doesn't by mosel-saar-ruwer · · Score: 1

    In fact, if I asked this to a 100 engineers, I'd really expect that at least 99 of them will immediately ask "why the fuck would you want to do that!?". And the one who doesn't probably works at a harddisk manufacturer.

    And yet the who doesn't is PRECISELY who you want to be talking to - the other 99 have NOTHING to offer you.

    .

  190. Good question. by mindstrm · · Score: 1

    A decade or so ago, you could do this.. more or less. Your "low-level" format and all that - nowadays, there is logic on the drive unit itself you have to deal with.... there are more levels of abstraction... so even the lowest-level access I can think of off-hand from a normal modern OS won't actually come anywhere near controlling the drive itself. You'd need to actually mess with drive firmware to do that.... I think.

    And yeah - check out Steve Gibson... Spinrite did stuff like that - not sure how valid that is with current media though (the principles probably still apply, but even he may be dealing with some level of abstraction now)

  191. BIOS by Anonymous Coward · · Score: 0

    Back in the day one could use bios commands to write track sector platter 3d addresses - I know all of the geometry has changed, but the basic technique may be the same with a translation algorithm.

  192. Self servo-write by OffTheWallSoccer · · Score: 1

    When I left Quantum a decade ago, they had already begun developing the technology for hard drives to write their own servo tracks.

  193. All drives encode the bits by mscritsm · · Score: 2, Informative

    If you want an exact image of 1's and 0's that you determine, forget it. Bits these days are encoded as transitions between magnetic phase boundaries. They also encode the clock data needed to recover the data along with the data. As a result, what's put down on the disk has to guarantee a certain number of these transitions or you loose sync. In other words, you may think you're writing '0000000' but on the disk it's a bunch of magnetic transitions, not a constant stream of the same magnetic polarity. It's not even that a single phase transition translates into either a 1 or a 0; groups of these transitions translate into a group of the actual data bits. Some patterns of phase transitions can simply never be written onto the media by the write electronics in the first place because they would not result in reliable data recovery by the read electronics.

  194. Slashdot supertrolled by Skye16 · · Score: 1

    No, that son of a bitch drank all my beer and shit in my bathroom sink. We are most assuredly NOT friends.

  195. Sharks with magnets! by aqk · · Score: 0

    Get one of those sharks with lasers
    Disable the laser.
    Strap a frickin' big magnet to the shark's body,
    Strap some beefsteak ro your hard disk.

    - oh yeah- make sure you're in freshwater, not saltwater!
    Saltwater will play havoc with the electronics on board the drive!
    Trust me- I KNOW from experience.

  196. There is no analog "exact" except by definition - by berkbw · · Score: 1

    Your quandary does not speak of the precision required in locating specific disk areas. In the "OLD DAYS", servo tracks were used- read-only, permanent. Holes in the media were also used, but difficult to retrofit. Temperature and voltage will cause inaccuracies. One would need to construct a controller in order to have "bare metal" write-ability. It seems doable. Good fortune, berk

  197. physical writes to a disk by paulq11 · · Score: 1

    First off, without a more detailed description of what the user really wants to do, it is very hard to say whether it is doable. If he wants to write say, an isolated 1 in a stream of 0s at a certain physical location on the media, that will not happen on any modern drive. Many responses have pointed that out. If he wants to write a 512 byte block of 'something' at a physical location, that is quite doable. If he wants to write a given frequency pattern to a given spot, that is also doable, but very drive specific. All drives have a manufacturing 'special mode' which allows for physical positioning of the actuator. All drives have commands that allow special patterns to be written. Modern disk drives are very complex. The amount of effort required to reverse engineer the controller hardware and firmware of a given drive would be huge. I have worked in the disk drive industry for over 20 years. Don't listen to folks that tell you 'Steve Gibson can do it'. He can't. There are people in San Jose, Colorado, Rochester, etc that do this stuff every day. It is not easy.

  198. HAAAACK ... by Anonymous Coward · · Score: 0

    I would do it LIKE THIS ...

    Build an app that creates a file on a flash drive and then write directly to that file, and use that file INSTEAD of a hard drive.

    IF flash is too slow then you should be using RAM to set your bits instead of a hard-drive MUCH FASTER ! You say you need to set persistent bits, then write to PRAM, but then that is SLOW again, or create an app that launches at startup to reset the previous RAM bits.

    IF you MUST do it on to THE hard drive then it sounds like you are a hacker, so the HD companies are just not going to allow you to do this.

    Now what if you created a disk in RAM, a perfect virtualized image, then twiddled the bits in the OS to full it into believing the RAM image is THE HD, that might work but I am SURE firewalls in the OS will be guarding against this but that does not mean it can't be done.

  199. Tracking reply by acteon · · Score: 1

    Tracking reply

  200. Dear God, please..... by Anonymous Coward · · Score: 0

    .... tell me you are not working for a HDD manufacturer....?

  201. Translation by jmkelly · · Score: 1

    I think what this guy really wants to do is get a lot of Slashdotters to post speculative, mostly-useless, and silly replies.

    He did pretty well.

  202. the answer by ufoolme · · Score: 1

    op:all u need is a very small magnet.
    next question, move on people nothing to see here