How does one generate 'weak bits' on a hard drive?

Does anyone in here know how to generate weak bits (i.e. bits returning random value on read) in a unused sector on a harddrive?

Thanks,
Jacob

Data in a disk sector is protected by an ECC, so instead of getting random bits back, you would I/O errors.
In one particular drive, I’ve seen a SCSI call that would read a bad sector and return the bad data, however I’m fairly sure the call was proprietary, and besides, its not implemented in any QNX driver.

Are you saying that even a sector not been touched by fdisk (ie not included in any partition) has an ECC?

ECC is an feature supported by the disk itself. It’s independant of the OS. Fdisk only modify partition table information and some key files like /.bitmap /.inode.

Mario is quite right. The situation gets even worse however. Modern disks are only logically perfect. When bad sectors are discovered by the disk, they are invisibly replaced with spares. A weaking written sector with random bits being returned would probably appear as a bad sector, and so it would be replaced with a good stable one. If you were hoping to create some type of copy protection by creating a sector that doesn’t always return the same value, you are probably sol. There was a version of this once applied to floppies, but it required special hardware to create the odd ball sector.

if you just want to create a random value there has to be easier (better) ways?

I don’t think you can create a weak bit by software. Unless the HD has some special extension. But I would suspect it would be an internal feature not made public. I think the best solution would be to rent some sort of IDE emulator (I have never seen this but I assume it exists)

Thanks, all, for attending the discussion of this topic. Appreciate it.

Thanks,
Jacob

You didn’t say what exactly you wanted to test, but what about having a program that “randomly” flip bits on the hard disk to simulate “weak bit”.

Actually, the weak bits scheme was supposed to be part of a copy protection scheme, so simulating won’t do the trick. Unfortunately, the hard drive controller protects its disk data to well :wink:

One possible way you might think about doing something like this has to do with data associated with a file, but not part of it.
By this, I mean the extra bytes on a sector, that are not part of the file. These are not copyied if someone does a file by file copy.
They might be able to contain information that could be distinguished even with an image file. Can such data be created and read under QNX 6? Well there might be away?