Computer Voodoo?
jbeaupre asks: "A corollary to 'Any sufficiently advanced technology is indistinguishable from magic' is that sometimes users have to resort to what I call 'computer voodoo.' You don't know why it works, you barely care how it works, but you find yourself doing the strangest things because it just seems to work. I'm talking about things like: smacking a PC every 5 seconds for an hour to keep it from stalling on a hard drive reformat (with nary a problem after the reformat); or figuring out the only way to get a PC partially fried by lightning to recognize an ethernet card, after booting into Windows, is to start the computer by yanking the card out and shoving it back in (thereby starting the boot processes). What wacky stuff have you done that makes no obvious sense, but just works?"
Usually whenever it would start going on the fritz a good punch or kick to the tower would get it going again. And also stop that damn whirring noise. It always makes me laugh when I'd see people hitting the monitor. Because THAT is where everything is XD
I'm not sure I'm reading your post right (no pun intended), but...
some BIOS require certain devices to be present to pass the POST. I discovered this the hard way when setting up a headless server. I spent 20 hours installing gentoo, got the services all nicely configured and put the machine in the corner, and it never went online... so I pulled it out and brought it back to my desk and it booted fine.
I didn't find out that it was keyboard/monitor missing errors that was preventing the system from booting until I carried the monitor to the other side of the room and plugged it in and saw the keyboard error... then I poked around in the bios and saw the options for requiring keyboard and monitor.
...spike
Ewwwwww, coconut...
The POSIX semantic is: sync() doesn't have to actually write everything, it can just schedule the commit. However, a second sync() won't return until the writes from the previous sync() finish.
On Linux, a single sync is enough, though.
The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
Here's how it works.
:)
IDE drives keep a list of spare sectors to be used if one of the "primary" ones gets damaged. However, if a sector gets damaged and it already contained data, the drive won't reallocate it, because it would have no way of recovering the information. So it keeps "hoping" that some day the data will be readable again, and when that happens, it'll reallocate the sector. However, it never happens.
When you overwrite a defective sector, the drive says "aha! since the user overwrote the information, it means it's not important anymore; so I'll go ahead, mark the sector as bad and replace it with a spare". That's why overwriting gives the drive a chance to remap all bad sectors to clean ones.
This is a trick I learned by reading the documentation on smartd; if SMART reports defective or unreadable sectors, there's a way to figure out which files reside in those sectors and overwrite them with zeroes; the file will of course be lost, but by overwriting you let the drive reassign the sector and everything is peachy again.
By the way, if you reformat the drive with the destructive verification option (-c -c) it's likely that when the test overwrites to verify readability, the same reassigning process will take place; the standard "-c" test is a read-only test that's why you're unable to format a drive without the overwriting procedure.
So you see, not voodoo.
This trick even works non-destructively: dd if=/dev/hda of=/dev/hda bs=512 A friend of mine showed me this method a few years ago and it has helped recover failing drives over a dozen times since.
If I had mod points left I would have done it myself. I never actually thought to try and do that. It makes perfect sense now that you said it. I always assumed that when used dd setting the input file and output file to the same thing would cause it to get stuck in an infinite loop. But now that you posted that and I thought it out some more, it makes perfect sense. DD will just grab the amount of data you specified as the block size from the input file and dump it to the first part of the output file (which in this case would be the same section of the disk). It will then increment by the block size on the input file and place copy it to the output file by the same incrementation of the block size, rinse, repeat ad infinum until it hits EOF...
Again, great little one liner command to remember in the tool bag...
We were all warned a long time ago that MS products sucked, remember the Magic 8 Ball said, "Outlook not so good"
Computers mysteriously start working again when you enter the room? Feh. This hardly qualifies as Voodoo. I mean, it's got a perfectly rational explanation:
Crumb's Corollary: Never bring a knife to a bun fight.
Sometimes taking the drive cover off and watching what it is doing helps. My uncle had a drive that died and would just click at startup. Upon watching it "click", I realized the head was just snapping back from the position it was trying to read. Solution: physically hold the read head in place when it tried to reset. Worked well enough to get the drive booted as a slave and copy all the important stuff off of it.