Lines Matching defs:sector

344        cout << "\nWarning: There is a gap between the main metadata (sector 1) and the main\n"
345 << "partition table (sector " << mainHeader.partitionEntriesLBA
351 cout << "\nWarning: There is a gap between the secondary partition table (ending at sector\n"
353 << ") and the secondary metadata (sector " << mainHeader.backupLBA << ").\n"
358 cout << "\nWarning: There is a gap between the main partition table (ending sector "
360 << "and the first usable sector (" << mainHeader.firstUsableLBA << "). This is helpful in some exotic configurations,\n"
376 << "sector is " << mainHeader.lastUsableLBA << ", but backup header is at\n"
421 << testAlignment << "-sector boundary. This may\nresult "
427 << testAlignment << "-sector boundary. This may\nresult "
432 cout << "\nConsult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/\n"
574 cout << "If stray data exists after the header on the header sector, it will be ignored,\n"
934 << "secondary header from the last sector of the disk! You should use 'v' to\n"
1051 // sector. Applies byte-order corrections on big-endian platforms. Sets crcOk
1055 int GPTData::LoadHeader(struct GPTHeader *header, DiskIO & disk, uint64_t sector, int *crcOk) {
1059 disk.Seek(sector);
1096 // using header as a reference for what to load. If sector != 0 (the default
1097 // is 0), loads from the specified sector; otherwise loads from the sector
1100 int GPTData::LoadPartitionTable(const struct GPTHeader & header, DiskIO & disk, uint64_t sector) {
1108 if (sector == 0) {
1111 retval = disk.Seek(sector);
1229 cout << "Warning! The claimed last usable sector is incorrect! Do you want to correct\n"
1233 cout << "Have adjusted the second header and last usable sector value.\n";
1371 // Write a GPT header (main or backup) to the specified sector. Used by both
1376 int GPTData::SaveHeader(struct GPTHeader *header, DiskIO & disk, uint64_t sector) {
1382 if (disk.Seek(sector)) {
1391 // Save the partitions to the specified sector. Used by both the SaveGPTData()
1396 int GPTData::SavePartitionTable(DiskIO & disk, uint64_t sector) {
1400 if (disk.Seek(sector)) {
1601 cout << "Main partition table begins at sector " << mainHeader.partitionEntriesLBA
1602 << " and ends at sector " << mainHeader.partitionEntriesLBA + GetTableSizeInSectors() - 1 << "\n";
1603 cout << "First usable sector is " << mainHeader.firstUsableLBA
1604 << ", last usable sector is " << mainHeader.lastUsableLBA << "\n";
1606 cout << "Partitions will be aligned on " << sectorAlignment << "-sector boundaries\n";
1609 cout << "\nNumber Start (sector) End (sector) Size Code Name\n";
1859 cout << numEntries << " to fill the sector\n";
1909 // Change the start sector for the main partition table.
1926 // Change the start sector for the secondary partition table.
1984 cout << "Information: Moved requested sector from " << origSector << " to "
1986 << "-sector boundaries.\n";
2169 // Adjust sector number so that it falls on a sector boundary that's a
2177 // only on the FIRST sector of the partition, not the last!
2180 int GPTData::Align(uint64_t* sector) {
2184 if ((*sector % sectorAlignment) != 0) {
2185 earlier = (*sector / sectorAlignment) * sectorAlignment;
2188 // Check to see that every sector between the earlier one and the
2194 } while ((sectorOK == 1) && (testSector < *sector));
2196 *sector = earlier;
2201 // If couldn't move the sector earlier, try to move it later instead....
2206 } while ((sectorOK == 1) && (testSector > *sector));
2208 *sector = later;
2297 // existing partition, move it to the next sector after that
2317 // sector number), or UINT64_MAX if there are no partitions defined.
2331 // sector number), or 0 if there are no partitions defined.
2344 // Finds the first available sector in the largest block of unallocated
2395 // If align == true, returns the last sector that's aligned on the
2449 // Returns 1 if sector is unallocated, 0 if it's allocated to a partition.
2452 // returned in partNum if the sector is in use by basic GPT data structures.)
2453 int GPTData::IsFree(uint64_t sector, uint32_t *partNum) {
2458 if ((sector >= partitions[i].GetFirstLBA()) &&
2459 (sector <= partitions[i].GetLastLBA())) {
2465 if ((sector < mainHeader.firstUsableLBA) ||
2466 (sector > mainHeader.lastUsableLBA)) {
2512 // Compute sector alignment based on the current partitions (if any). Each
2515 // sector size), but not by the previously-located alignment value, then the
2520 // adjustment of that based on the current sector size). The result is that new
2521 // drives are aligned to 2048-sector multiples but the program won't complain