Again more documenting :).  Especially here it would be good to make it explicit that size must be an integer multiple of the sector size and within the partition not to fail.