Lines Matching refs:label
55 #include "label.h"
314 err_print("Reading the primary EFI GPT label ");
315 err_print("failed. Using backup label.\n");
317 err_print("the primary label.\n");
331 * If the label of the disk is marked dirty,
332 * see if they'd like to label the disk now.
337 err_print("Write label failed\n");
365 struct dk_label label;
431 if ((tptr = auto_sense(cur_file, 1, &label)) == NULL) {
584 err_print("Write label failed\n");
665 * If the label of the disk is marked dirty,
666 * see if they'd like to label the disk now.
671 err_print("Write label failed\n");
1114 * If we are formatting over any of the labels, mark the label
1149 * If the defect list or label is dirty, write them out again.
1192 * If the defect list or label is dirty, write them out again.
1465 * This routine implements the 'label' command. It writes the
1482 * The current disk must be formatted to label it.
1496 * on the current disk. If so, refuse to label the disk, but
1503 err_print("Cannot label disk while it has "
1511 * on the current disk. If so, refuse to label the disk, but
1516 err_print("Cannot label disk while its "
1525 * are on the disk. If so, refuse to label the disk, but only
1530 err_print("Cannot label disk when "
1546 err_print("No default available, cannot label.\n");
1552 * to change the current solaris label into an EFI one
1561 struct dk_label label;
1566 /* Ask user what label to use */
1590 * EFI label to SMI label
1598 fmt_print("Warning: This disk has an EFI label. "
1599 "Changing to SMI label will erase all\n"
1607 "label.\n");
1617 "partition before you can convert the label.\n");
1622 (void) memset((char *)&label, 0, sizeof (struct dk_label));
1627 dptr = auto_direct_get_geom_label(cur_file, &label);
1629 dptr = auto_sense(cur_file, 1, &label);
1635 pcyl = label.dkl_pcyl;
1636 ncyl = label.dkl_ncyl;
1637 acyl = label.dkl_acyl;
1638 nhead = label.dkl_nhead;
1639 nsect = label.dkl_nsect;
1663 * SMI label to EFI label
1668 fmt_print("Warning: This disk has an SMI label. "
1669 "Changing to EFI label will erase all\ncurrent "
1679 (void) memset((char *)&label, 0, sizeof (struct dk_label));
1680 label.dkl_pcyl = pcyl;
1681 label.dkl_ncyl = ncyl;
1682 label.dkl_acyl = acyl;
1684 label.dkl_bcyl = bcyl;
1686 label.dkl_nhead = nhead;
1687 label.dkl_nsect = nsect;
1690 label.dkl_map[i] = cur_parts->pinfo_map[i];
1693 label.dkl_magic = DKL_MAGIC;
1694 label.dkl_vtoc = cur_parts->vtoc;
1695 if (label_to_vtoc(&vtoc, &label) == -1) {
1741 if (check("Ready to label disk, continue")) {
1853 * if the primary label was lost and the user wishes to recover the
1855 * the current defect list is written out if a backup label is found.
1860 struct dk_label label;
1888 * If we found a primary label on this disk, make sure
1894 check("Disk has a primary label, still continue"))
1896 fmt_print("Restoring primary label.\n");
1904 (check("Disk has a primary label, still continue"))) {
1920 * Loop through each copy of the backup label.
1933 (void *) memcpy((char *)&label, buf, sizeof (struct dk_label));
1936 * Verify that it is a reasonable label.
1938 if (!checklabel(&label))
1940 if (trim_id(label.dkl_asciilabel))
1948 * Find out which disk type the backup label claims.
1952 if (dtype_match(&label, dtype))
1961 Unknown disk type in backup label\n");
1966 fmt_print("Backup label claims different type:\n");
1968 label.dkl_asciilabel, label.dkl_ncyl,
1969 label.dkl_acyl, label.dkl_nhead,
1970 label.dkl_nsect);
1983 if (parts_match(&label, parts))
2005 parts->pinfo_map[i] = label.dkl_map[i];
2009 label.dkl_vtoc.v_part[i].p_start / spc();
2011 label.dkl_vtoc.v_part[i].p_size;
2015 parts->vtoc = label.dkl_vtoc;
2026 fmt_print("Restoring primary label.\n");
2032 fmt_print("Restoring primary label and defect list.\n");
2064 err_print("Warning: Could not read label.\n");
2068 err_print("Reading the primary EFI GPT label ");
2069 err_print("failed. Using backup label.\n");
2071 err_print("the primary label.\n");
2106 struct dk_label p_label, b_label, *label;
2144 * Attempt to read the primary label.
2148 err_print("Warning: Could not read primary label.\n");
2152 * Verify that it is a reasonable label.
2162 Warning: Primary label appears to be corrupt.\n");
2167 * Make sure it matches current label
2172 Warning: Primary label on disk appears to be different from\ncurrent label.\n");
2189 * Loop through each copy of the backup label.
2205 * Verify that it is a reasonable label.
2211 * Save complete label only if no primary label exists
2220 * Compare against primary label
2275 Warning: Check the current partitioning and 'label' the disk or use the\n\
2279 * Print label information.
2282 fmt_print("\nPrimary label contents:\n");
2283 label = &p_label;
2285 fmt_print("\nBackup label contents:\n");
2286 label = &b_label;
2300 tmp_pinfo.pinfo_map[i] = label->dkl_map[i];
2304 label->dkl_vtoc.v_part[i].p_start / spc();
2306 label->dkl_vtoc.v_part[i].p_size;
2311 tmp_pinfo.vtoc = label->dkl_vtoc;
2314 fmt_print("Volume name = <%8s>\n", label->dkl_vtoc.v_volume);
2316 fmt_print("pcyl = %4d\n", label->dkl_pcyl);
2317 fmt_print("ncyl = %4d\n", label->dkl_ncyl);
2318 fmt_print("acyl = %4d\n", label->dkl_acyl);
2321 fmt_print("bcyl = %4d\n", label->dkl_bcyl);
2324 fmt_print("nhead = %4d\n", label->dkl_nhead);
2325 fmt_print("nsect = %4d\n", label->dkl_nsect);
2391 * The current disk must be formatted to label it.
2404 * The current disk must be formatted to label it.
2414 * on the current disk. If so, refuse to label the disk, but
2422 "Cannot label disk while it has mounted partitions.\n\n");
2429 * on the current disk. If so, refuse to label the disk, but
2437 "Cannot label disk while its partitions are currently \
2445 * or live upgrade are on the disk. If so, refuse to label the
2451 err_print("Cannot label disk while its partitions "
2498 if (check("Ready to label disk, continue")) {