OpenSolaris

Printable Version Enter a New Search
Bug ID 6690194
Synopsis fdisk(1M) doesn't clear VTOC when partition starts after or exceeds 4GB limit
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:fdisk
Keywords
Responsible Engineer Barry Harding
Reported Against
Duplicate Of
Introduced In solaris_2.5
Commit to Fix snv_90
Fixed In snv_90
Release Fixed solaris_nevada(snv_90) , solaris_10u8(s10u8_01) (Bug ID:2174216)
Related Bugs 4807859
Submit Date 17-April-2008
Last Update Date 27-April-2009
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.
Work Around
N/A
Comments
N/A