Acquisition method and device for bad block information of hard disk
暂无分享,去创建一个
The invention is applied to the technical field of computers, and provides an acquisition method and an acquisition device for bad block information of a hard disk. The method comprises the following steps: running an independent file system daemon thread in a user space of an operating system; establishing a communication channel between the user space and a kernel space of the operating system; after an IO (Input and Output) request of block equipment fails, judging whether the IO request of the block equipment is a write request or not; if the IO request of the block equipment is a write request, transmitting the bad block position, corresponding to the IO request of the block equipment, of the block equipment to the daemon thread through the communication channel by the kernel space. According to the method and the device, a hard disk write operation failure result is transmitted to a file system from a kernel of the operating system, so that the file system learns about the hard disk write operation failure result as well as the position of an unrepairable bad block in the hard disk to take further processing measures to avoid data being stored into the bad block with a write error.