Lines Matching full:partition
36 * This program reads the partition table on the specified device and
139 /* Maximum number of digits for a valid partition size */
142 /* Minimum partition size in cylinders */
155 static char Usage1[] = " Partition options:\n"
157 " Create a partition with specific attributes:\n"
158 " id = system id number (fdisk.h) for the partition type\n"
159 " act = active partition flag (0 is off and 128 is on)\n"
160 " bhead = beginning head for start of partition\n"
161 " bsect = beginning sector for start of partition\n"
162 " bcyl = beginning cylinder for start of partition\n"
163 " ehead = ending head for end of partition\n"
164 " esect = ending sector for end of partition\n"
165 " ecyl = ending cylinder for end of partition\n"
167 " start of partition\n"
168 " numsect = partition size in sectors\n"
171 " -B Create one Solaris partition that uses the entire disk.\n"
173 " Delete a partition. See attribute definitions for -A.\n"
175 " Create an EFI partition that uses the entire disk.\n"
183 " VTOC slices exceeding the partition size will be truncated.\n"
185 " VTOC slices exceeding the partition size will be removed.\n"
276 /* Partition table flags */
280 static int io_ifdisk = 0; /* interactive partition */
281 static int io_nifdisk = 0; /* non-interactive partition (-n) */
287 static char *io_Afdisk = 0; /* add entry to partition table (-A) */
348 * Complete list of all the 255 partition types. Some are unknown types
378 "AST SmartSleep Partition", /* 24 */
422 "GoBack partition", /* 68 */
430 "Oberon partition", /* 76 */
470 "Scramdisk partition", /* 116 */
492 "Linux Kernel Partition", /* 138 */
496 "Linux LVM partition", /* 142 */
612 /* Allowed extended partition menu options */
616 * Structure holding all information about the extended partition
618 * known systems allow only one extended dos partition per disk.
709 * mounted logical drives, changes to the partition table
1172 * Read extended partition only when the fdisk table is not in main()
1235 " partition for the disk is:\n\n" in main()
1237 "partition\n\n" in main()
1239 "partition, otherwise type \"n\" to " in main()
1240 "edit the\n partition table.\n"); in main()
1244 " than 2TB. Solaris partition will" in main()
1248 /* Edit the partition table as directed */ in main()
1253 /* now set up UNIX System partition */ in main()
1269 "Error creating EFI partition\n"); in main()
1281 (void) fprintf(stderr, "Partition Table Entry Values:\n"); in main()
1383 "fdisk: Error seeking to partition table on %s.\n", in dev_mboot_read()
1390 "fdisk: Error reading partition table from %s.\n", in dev_mboot_read()
1447 /* Did a solaris partition change location or size? */ in dev_mboot_write()
1466 /* look to see if a EFI partition changed in relsect/numsect */ in dev_mboot_write()
1478 * New EFI guard partition matches old. in dev_mboot_write()
1487 * if EFI partition changed, set the flag to clear in dev_mboot_write()
1793 "fdisk: Cannot open prototype partition file %s.\n", in load()
1810 "Extended partition" in load()
1818 * If the existing extended partition's start in load()
1820 * initialize the extended partition EBR in load()
1862 * extended partition matches the new one and in load()
1893 * from the given start of partition. in load()
1910 "Invalid partition ID\n"); in load()
1923 "partition\n"); in load()
1938 * Validate the partition. It cannot start at sector in load()
1966 * and sectors in partition table fields). in load()
1983 * partition with the -F option that contains in load()
1984 * a partition that runs off the end of the in load()
2008 "fdisk: Cannot create partition table\n"); in load()
2076 "fdisk: Entry does not match any existing partition:\n" in load()
2092 /* Validate the partition. It cannot start at sector 0 */ in load()
2095 "fdisk: New partition cannot start at sector 0:\n" in load()
2102 * if the user wishes to add an EFI partition, we need in load()
2138 (void) printf("Invalid partition ID\n"); in load()
2145 "Extended partition already exists.\n"); in load()
2171 * from the given start of partition. in load()
2188 "fdisk: Partition size cannot be zero:\n" in load()
2222 "fdisk: Cannot create partition \"%s\"\n", file); in load()
2232 * for a single partition table entry (ti) based on the relsect
2297 /* validate partition size */ in insert_tbl()
2300 "fdisk: Partition table exceeds the size of the disk.\n"); in insert_tbl()
2305 /* find UNUSED partition table entry */ in insert_tbl()
2312 (void) fprintf(stderr, "fdisk: Partition table is full.\n"); in insert_tbl()
2364 * return partition index in insert_tbl()
2399 /* find UNUSED partition table entry */ in entry_from_old_table()
2418 * Verify that no partition entries overlap or exceed the size of
2441 * EFI_PMBR partition must be the only in verify_tbl()
2442 * partition in verify_tbl()
2449 "for EFI_PMBR partition:\n" in verify_tbl()
2462 "EFI_PMBR partition must " in verify_tbl()
2484 /* make sure the partition isn't larger than the disk */ in verify_tbl()
2503 "Cannot add partition to " in verify_tbl()
2510 "partition:\t" in verify_tbl()
2514 "partition:\t\t" in verify_tbl()
2547 "current partition overlaps" in verify_tbl()
2548 " following partition\n"); in verify_tbl()
2630 * Validate that a new partition does not start at sector 0. Only UNUSED
2645 "New partition cannot start at sector 0\n"); in validate_part()
2650 (void) fprintf(stderr, "Invalid partition ID\n"); in validate_part()
2717 (void) printf("\nNo extended partition"
2725 /* update disk partition table, if changed */
2762 /* update disk partition table, if changed */
2804 * Create partition entry in the table (interactive mode).
2822 "The partition table is full!\n"
2823 "You must delete a partition before creating"
2839 /* Check if an extended partition already exists */
2847 " another partition.\n");
2849 "You must delete a partition before creating"
2866 "Select the partition type to create:\n"
2882 case '1': /* Solaris partition */
2885 case '2': /* UNIX partition */
2888 case '3': /* PCIXOS partition */
2891 case '4': /* OTHEROS System partition */
2906 "Extended partition already exists\n");
2921 case 'a': /* x86 Boot partition */
2925 case 'b': /* Diagnostic boot partition */
2937 case 'e': /* Extended partition, need extended int13 */
2944 "Extended partition already exists\n");
2970 "Upper limit is 2 TB for non-EFI partition ID\n");
2972 /* create the new partition */
2976 /* see if it should be the active partition */
2981 "Should this become the active partition? If "
2993 "Partition %d is now "
2994 "the active partition.",
3006 * If partition created is an extended partition, null
3008 * extended partition
3031 "fdisk: Cannot create EFI partition table; \n"
3032 "current partition table is invalid.\n");
3036 "An EFI partition must be the only partition on "
3056 (void) printf("Error creating EFI partition!!!\n");
3073 * Query the user to specify the size of the new partition in
3085 struct ipart *partition[FD_NUMPART]; local
3091 * make a local copy of the partition table
3109 partition[i] = &localpart[i];
3112 if (partition[i]->systid == UNUSED)
3115 if (partition[j]->systid == UNUSED)
3117 if (LE_32(partition[j]->relsect) <
3118 LE_32(partition[i]->relsect)) {
3119 struct ipart *temp = partition[i];
3120 partition[i] = partition[j];
3121 partition[j] = temp;
3129 "Specify the percentage of disk to use for this partition\n"
3170 /* Verify DOS12 partition doesn't exceed max size of 32MB. */
3176 (void) printf("Maximum size for a DOS partition "
3187 * check for free space before partition i
3190 * freespace after partition 3 is unusable
3193 * freespace begins at the end of previous partition
3198 first_free = LE_32(partition[i - 1]->relsect) +
3199 LE_32(partition[i - 1]->numsect);
3205 * freespace ends before the current partition
3208 if (partition[i]->systid == UNUSED) {
3212 * Partition might start before cylinder 1.
3216 (LE_32(partition[i]->relsect > first_free))
3217 ? (LE_32(partition[i]->relsect) -
3229 if (partition[i]->systid == UNUSED) {
3242 "fdisk: Partition table is full.\n");
3265 "New partition cannot start at cylinder 0.\n");
3280 (void) printf("Enter partition size in cylinders: ");
3290 if (partition[i]->systid == UNUSED)
3292 t_relsect = LE_32(partition[i]->relsect);
3293 t_numsect = LE_32(partition[i]->numsect);
3309 "Maximum size for partition is %u cylinders"
3316 /* Verify partition doesn't exceed disk size or 2 TB */
3321 "Maximum size for partition is %d "
3326 "Maximum size for partition is %d "
3333 /* Verify DOS12 partition doesn't exceed max size of 32MB. */
3338 "Maximum size for a %s partition is %ld cylinders;"
3352 (void) printf("fdisk: Cannot create partition table\n");
3371 " 1. Create a partition\n"
3372 " 2. Specify the active partition\n"
3373 " 3. Delete a partition\n"
3374 " 4. Change between Solaris and Solaris2 Partition IDs\n"
3381 " 1. Create a partition\n"
3382 " 2. Specify the active partition\n"
3383 " 3. Delete a partition\n"
3384 " 4. Change between Solaris and Solaris2 Partition IDs\n"
3392 * Change the ACTIVE designation of a partition.
3404 "Specify the partition number to boot from"
3427 "No partition is currently marked as active.");
3429 } else { /* User has selected a partition to be active */
3435 (void) printf("Partition does not exist.");
3438 /* a DOS-DATA or EXT-DOS partition cannot be active */
3446 (void) printf("Select another partition.");
3458 "Partition %d is now active. The system will start up"
3460 (void) printf("partition after the next reboot.");
3466 * Change between SOLARIS and SOLARIS2 partition id
3476 (void) printf("Specify the partition number to change"
3504 "Partition %d is not a Solaris partition.",
3510 (void) printf("Partition %d has been changed.", i + 1);
3517 * Remove partition entry from the table (interactive mode).
3527 (void) printf("Specify the partition number to delete"
3547 (void) printf("Partition %d does not exist.", i + 1);
3557 " extended partition\n");
3579 (void) printf("Are you sure you want to delete partition %d?"
3581 (void) printf("programs in this partition inaccessible (type"
3601 (void) printf("Partition %d has been deleted.", i + 1);
3604 (void) printf(" This was the active partition.");
3665 * of the disk used for each partition.
3690 " Partition Status Type Start End Length"
3865 "Upper limit is 2 TB for non-EFI partition ID\n");
3947 /* Get an aligned copy of the partition tables */
3949 bootptr = (char *)iparts; /* Points to start of partition table */
3957 * When the DOS fdisk command deletes a partition, it is not
4057 * Check for any changes in the partition table.
4067 /* Partition table changed, write back to disk */
4077 * Display contents of partition table to standard output or
4216 * Read the VTOC table on the Solaris partition and check that no
4217 * slices exist that extend past the end of the Solaris partition.
4218 * If no Solaris partition exists, nothing is done.
4235 * the partition.
4245 "fdisk: No Solaris partition found - VTOC not"
4260 " start of partition",
4275 " complete partition",
4310 " is larger than the partition",
4336 "partition", i, disk_vtoc.v_part[i].p_start);
4357 " than the partition",
4414 * Read the VTOC from the Solaris partition of the device.
4428 (void) fprintf(stderr, "fdisk: partition may have EFI "
4441 * Write the VTOC to the Solaris partition on the device.
4455 (void) fprintf(stderr, "fdisk: partition may have EFI "
4485 * Clear EFI labels from the EFI_PMBR partition on the device
4533 * clear the backup partition table
4541 "\tClearing backup partition table at block %lld\n",
4579 * Clear the VTOC from the current or previous Solaris partition on the
4808 * to tell if they've specified the full disk partition by checking
4809 * to see if they've specified a partition that starts at sector 0.
4927 * Convert a given partition ID to an descriptive string.
4928 * Just an index into the partition types table.
4937 * Procedure to check the validity of the extended partition menu option
4967 * Procedure to read and validate the user option at the extended partition menu
4981 * Procedure to print the list of known partition types and their IDs
4997 * partition IDs being printed.
5008 (void) printf("List of known partition types : \n");
5009 (void) printf("PartID Partition Type\n");
5017 * printing the partition IDs, but one.
5038 (void) printf("Enter the partition number : ");
5064 (void) printf("Invalid partition number\n");
5077 "partition IDs ) : ");
5082 (void) printf("Invalid partition ID\n");
5094 (void) printf("Invalid partition ID\n");
5105 (void) printf("Invalid partition ID\n");
5118 /* Disallow EFI partitions within extended partition */
5121 "partition is not allowed\n");
5125 return; /* Valid partition ID is in partid */
5142 (void) printf("Partition %d deleted\n", pno);
5198 (void) printf("Partition boundary overlaps "
5278 (void) printf("Invalid partition size\n");
5290 (void) printf("Invalid partition size\n");
5304 (void) printf("Invalid partition size\n");
5312 (void) printf("Invalid partition size\n");
5324 (void) printf("Invalid partition size\n");
5347 * 1. Get the starting and ending sectors/cylinder of the extended partition.
5349 * 3. Allow the user to specify the beginning cylinder of the new partition
5352 * b) If it is beyond the extended partition limits
5357 * b) If it is beyond the extended partition limits
5360 * 7. Request partition ID for the new partition.
5390 "partition\n");
5400 (void) printf("New partition with ID %d added\n", partid);
5419 (void) printf("Partition ID of partition %d changed to %d\n", pno,
5453 * partition.
5491 (void) printf("Beginning cylinder of extended partition : %u\n",
5493 (void) printf("Ending cylinder of extended partition : %u\n",
5506 * Check if partition id 0x82 is Solaris
5593 (void) printf("Extended partition menu\n");
5639 /* create an EFI partition for the whole disk */
5645 "EFI partition slot must be between 0 and 3 inclusive.\n");
5650 "EFI partition active flag must be 0 or 1.\n");