|
Description
|
fdisk(1M) doesn't clear primary and backup labels/VTOCs when partition starts after or
exceeds 4GB limit. This is due to the fact that implementation of seeking for VTOC sectors
is 32bit limited in usr/src/cmd/fdisk/fdisk.c:clear_vtoc() function:
clear_vtoc(int table, int part)
{
int seek_byte;
[...]
seek_byte = (lel(clr_table->relsect) * sectsiz) + VTOC_OFFSET;
[...]
if (lseek(Dev, seek_byte, SEEK_SET) == -1) {
[...]
}
bytes = write(Dev, &disk_label, sizeof (struct dk_label));
[...]
}
When partition starts after 4GB and it is for example resized by means of "fdisk -F"
command, label/VTOC is not cleared and invalid data (geometry/VTOC) are still being used.
Also sectors somewhere within first 4GB (which might be outside the Solaris partition)
are cleared instead, which may lead to the data corruption.
|