Extended Partition Support » EP Design Notes
en

EP Design Notes

Extended Partition Support Design Notes

libdiskmgt design

partition.c

ipart.systid == EXTDOS or FDISK_EXTLBA means extended partition

If you have an epp, you can use fdisk_ext_part_exists to see if
any of the partitions are EPs.
It loops through all 4 partitions and checks systid for above values.

TODO: Create a #define for total number of partitions.

define WHATEVER FD_NUMPART + MAX_EXT_PART

TODO: #include <sys/dktp/fdisk.h>
Wherever we compare systid to 0 now compare to UNUSED

get_parts()

This code:

for (i = 0; i < FD_NUMPART; i++) {  

   if (iparts[i].systid != 0) {  
       iparts[i].relsect = lel(iparts[i].relsect);  
       iparts[i].numsect = lel(iparts[i].numsect);  
   }  

}  

Check to see if there are any ext parts. i.e. see if the part[].systid is
an extended partition type. fdisk_dos_extended shows how to do this.
if not, do old code. If there are extended partitions libfdisk_init the epp
structure.
Note, epp->mtable is an ipart.
Copy epp->mtable to the appropriate iparts member.

then look at all code after that calls get_parts to make sure iparts is not
FD_NUMPART size but WHATEVER (from above #define)

TODO:
In libdiskmgt.h add DM_PART_TYPE (Need a better name since this is too similar to DM_PTYPE) to the partition attribute list.
Can we change the current DM_PTYPE to DM_PART_ID and then use DM_PART_TYPE? That would more accurately reflect what the values are.

DM_EXTPART, DM_LOGPART, DM_PRIMPART are valid for that attribute. Create #defines for them.

get_attrs()
Check each partition to see if it's an extended partition. (systid)

set attribute for DM_PART_TYPE to the appropriate value.

grep for FD_NUMPART:
All instances should be analysed to see if they need to be WHATEVER or some extra code instead.

libtd design:
td_dd.c:
Add DM_PART_TYPE to ddm_part_attr_conv_tbl. TD_PART_ATTR_PART_TYPE

td_api.h will need to add the #define for TD_PART_ATTR_PART_TYPE

line 1640: I think we can get rid of this hack

test_td.c:
In part_show_attr add code to print TD_PART_ATTR_PART_TYPE

we should modify the test driver to also output the partition type. The potential partition
types would be primary, extended and logical. This information would be available with a new
attribute we will be providing. This attribute will be TD_PART_ATTR_PART_TYPE. The values
the attribute can have will be TD_PART_ATTR_TYPE_PRIMARY, TD_PART_ATTR_TYPE_EXT, or TD_PART_ATTR_TYPE_LOGICAL.

So the output would look something like this:

Partition discovery for all disks
--
num |        name| active| ID| lswp| 1st block|#of blocks|size [MB]|type|
-
-
  1 |    c3t0d0p1|    Yes| BF|   No|     16065| 390700800|   190771|primary|
--

Tags:
Created by admin on 2009/10/26 12:12
Last modified by admin on 2009/10/26 12:12

Collectives

Project caiman Pages


XWiki Enterprise 2.7.1.34853 - Documentation