Lines Matching defs:partition
16 Change partition table
19 -l Show partition table for each DISK, then exit
44 #define PARTITION_MAX 60 //partition max is modifiable
51 struct partition {
57 struct partition *part;
91 static struct partition* part_offset(char *secbuf, int i)
93 return (struct partition*)(secbuf + 0x1be + i*(sizeof(struct partition)));
102 static void set_hsc(struct partition *p, sector_t start, sector_t end)
186 static int is_partition_clear(struct partition* p)
192 for (i = 0; i < sizeof(struct partition); i++) res |= (unsigned char)ptr[i];
208 struct partition *px;
239 struct partition *p, *q;
248 memset(q, 0, sizeof(struct partition)); //clear_partition
273 struct partition *p;
298 //Reset the primary partition table
340 * partition table entries/details.
341 * If any extended partition is found then read the EBR
342 * for logical partition details
360 //read partition table - MBR
367 "partition table, nor Sun, SGI, OSF or GPT "
407 static void consistency_check(const struct partition *p, int partition)
413 if (!g_heads || !g_sectors || (partition >= 4)) return;
436 xprintf("Partition %u has different physical/logical beginings (Non-Linux?): \n", partition+1);
441 xprintf("Partition %u has different physical/logical endings: \n", partition+1);
447 xprintf("Partition %u does not end on cylinder boundary\n", partition + 1);
450 // List the partition details
453 struct partition *p;
461 xprintf("Device %s: doesn't contain a valid partition table\n", disk_device);
566 /* Delete an exiting partition,
567 * if its primary, then just clear the partition details
568 * if extended, then clear the partition details, also for logical
574 struct partition *p, *q, *ext_p, *ext_q;
581 if (!sys_id) xprintf("Partition %u is empty\n", i+1);
584 memset(p, 0, sizeof(struct partition)); //clear_partition
587 memset(p, 0, sizeof(struct partition)); //clear_partition
594 memset(p, 0, sizeof(struct partition)); //clear_partition
616 memset(partitions[i].part, 0, sizeof(struct partition));
622 memcpy((void*)ext_p, (void *)ext_q, sizeof(struct partition));
638 xprintf("Partition (%u - %u):", 1, num_parts);
649 struct partition *p = partitions[i].part;
650 if (is_partition_clear(p)) xprintf("Partition %u is empty\n", i+1);
653 xprintf("WARNING: Partition %u is an extended partition\n", i + 1);
658 //Write the partition details from Buffer to Disk.
677 xprintf("The partition table has been altered.\n");
678 xprintf("Calling ioctl() to re-read partition table\n");
682 perror_exit("WARNING: rereading partition table failed, kernel still uses old table");
686 /* try to find a partition for deletion, if only
700 (num >= 0) ? xprintf("Selected partition %d\n",num+1):
701 xprintf("No partition is defined yet!\n");
705 /* a try at autodetecting an empty partition table entry,
719 (num >= 0) ? xprintf("Selected partition %d\n",num+1):
724 //taking user input for partition start/end sectors/cyinders
811 //get the start sector/cylinder of a new partition
823 if (disp_unit_cyl) //make the begin of every partition to cylnder boundary
866 //get the end sector/cylinder of a new partition
876 if (disp_unit_cyl) //make the begin of every partition to cylnder boundary
913 // add a new partition to the partition table
919 struct partition *p = pe->part;
922 xprintf("Partition %u is already defined, delete it to re-add\n", idx+1);
940 //Populate partition table entry - 16 bytes
996 /* Add a new partiton to the partition table.
1013 else xprintf("You must delete some partition and add "
1014 "an extended partition first\n");
1018 msg = xmprintf(" %s\n p primary partition(1-4)\n",
1042 struct partition *p;
1049 xprintf("Partition %d doesn't exist yet!\n", i);
1055 xprintf("you can't change a partition to an extended or vice-versa\n");
1059 xprintf("Changed system type of partition %u to %0x (%s)\n",i, sys_id, get_type(sys_id));
1071 if (!total) xprintf("Partition %u contains sector 0\n", n);
1073 xprintf("Partition %u: head %u greater than maximum %lu\n", n, h + 1, g_heads);
1075 xprintf("Partition %u: sector %u greater than maximum %lu\n", n, s, g_sectors);
1077 xprintf("Partition %u: cylinder %lld greater than maximum %lu\n", n, real_c + 1, g_cylinders);
1079 xprintf("Partition
1087 struct partition *p;
1107 xprintf("Warning: bad start-of-data in partition %u\n", i + 1);
1113 xprintf("Warning: partition %u overlaps partition %u\n", j + 1, i + 1);
1130 xprintf("Warning: partition %u is empty\n", i + 1);
1132 xprintf("Logical partition %u not entirely in partition %u\n", i + 1, ext_idx + 1);
1149 struct partition *p = pe->part;
1157 xprintf("Partition %u doesn't have data area\n", idx+1);
1192 struct partition *p;
1217 //fix the partition table order to ascending
1223 struct partition *px, *py, temp, *pj, *pjj, tmp;
1241 memcpy(&temp, py, sizeof(struct partition));
1242 memcpy(py, px, sizeof(struct partition));
1243 memcpy(px, &temp, sizeof(struct partition));
1294 "d\tdelete a partition\n"
1295 "l\tlist known partition types\n"
1296 "n\tadd a new partition\n"
1297 "o\tcreate a new empty DOS partition table\n"
1298 "p\tprint the partition table\n"
1301 "t\tchange a partition's system id\n"
1303 "v\tverify the partition table\n"
1310 xprintf("b\tmove beginning of data in a partition\n"
1312 "d\tprint the raw data in the partition table\n"
1314 "f\tfix partition order\n"
1316 "p\tprint the partition table\n"
1320 "v\tverify the partition table\n"
1335 case 'b': //move data begining in partition
1364 case 'p': //print partition table
1502 toggle_active_flag(p - 1); //partition table index start from 0.
1517 case 'n': //add new partition