|
Description
|
currently, in sd, there is a workaround we called it "off-by-one". sd uses READ_CAPACITY
command to get the capacity of a disk, but in sd_send_scsi_READ_CAPACITY(), sd doesn't report right capacity for non-removable devices on x86 platform. see:
#if defined(__i386) || defined(__amd64)
/*
* On x86, compensate for off-by-1 error (number of sectors on
* media) (1175930)
*/
if (!ISREMOVABLE(un) && (lbasize == un->un_sys_blocksize)) {
capacity -= 1;
}
#endif
This workaround causes somewhat uncompatible between x86 and sparc. As casper.disk said if you create a ZFS filesystem on SPARC and move it to x86, there will be unreadable blocks, one at the end of each block.
In addition, once EFI partition method becomes popular, we could encounted more troubles because EFI has a backup partition table to save in the last block of a disk.
|