Had to hack up this code so that I could replace a failed disk with a new one with different physical sector size.