• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ContentHint Issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ContentHint Issue


  • Subject: Re: ContentHint Issue
  • From: Cliff Russell <email@hidden>
  • Date: Wed, 23 Feb 2005 00:38:30 -0800

Irman,

If the disk has already been initialized (with Disk Utility or whatever), the 't' (change a partition's type) command should do the trick for you. (Just don't use the 'i' command, it will erase all the previous partitions).

*** example ***

[CLIFFR-PB:~] cliffr% pdisk
Top level command (? for help): e /dev/rdisk1
/dev/rdisk1
Command (? for help): p
/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_HFS Apple_HFS_Untitled_2 341336 @ 64 (166.7M)
3: Apple_HFS Apple_HFS_Untitled_3 341336 @ 341400 (166.7M)
4: Apple_HFS Apple_HFS_Untitled_4 341248 @ 682736 (166.6M)
5: Apple_Free 0+@ 1023984
Command (? for help): t
Partition number: 2
New partition type: MACOSX_MyContent
Command (? for help): t
Partition number: 3
New partition type: MACOSX_MyContent
Command (? for help): t 4 MACOSX_MyContent
Command (? for help): p
/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: MACOSX_MyContent Apple_HFS_Untitled_2 341336 @ 64 (166.7M)
3: MACOSX_MyContent Apple_HFS_Untitled_3 341336 @ 341400 (166.7M)
4: MACOSX_MyContent Apple_HFS_Untitled_4 341248 @ 682736 (166.6M)
5: Apple_Free 0+@ 1023984


Device block size=512, Number of Blocks=1024000
DeviceType=0x0, DeviceId=0x0

Command (? for help):



-- Cliff

On 22-Feb-05, at 10:26 PM, Imran wrote:

Hi Cliff,

Thanks for your immediate reply. Actually my problem is that I want to
change ContentHint of those partitions which are already created on disk
through DiskUtil.
So that I shall be able to load my filter scheme driver for those partitions
whose ContentHint matches to that of my driver.
So is there any way to change/modify the ContentHint of already created
partition instead of creating new partition.


Thanks
Imran

-----Original Message-----
From: Cliff Russell [mailto:email@hidden]
Sent: Wednesday, February 23, 2005 12:42 AM
To: Imran
Cc: email@hidden
Subject: Re: ContentHint Issue

Irman,

In your case your are initializing the partition, this writes an empty
partition map to the disk (wiping out all previous partitions) and then
changing the type of the free partition ('Apple_Free') to you custom
type ('MACOSX_MyContent'). Your missing the set where you create your
own partitions.

You can either use 'c' to create partitions with the standard type
('Apple_HFS') and then change the type with 't', or do it all in one
step using 'C'. See example below

Use the 'p' print command after each step to see what is actually
happening to the partition map.

Also take a look at "Secrets of the partition map" section TN1189: The
Monster Disk Driver Technote and/or the various header files
(IOApplePartitionScheme.h for IOKit or AppleDiskPartitions.h) for more
information.

** example **

[CLIFFR-PB:/] cliffr% pdisk
Top level command (? for help): e
Name of device: /dev/rdisk1
/dev/rdisk1
Command (? for help): i
map already exists
do you want to reinit? [n/y]: y
size of 'device' is 1024000 blocks (512 byte blocks):
new size of 'device' is 1024000 blocks (512 byte blocks)
Command (? for help): p
/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Free Extra 1023936 @ 64 (500.0M)


Device block size=512, Number of Blocks=1024000
DeviceType=0x0, DeviceId=0x0

Command (? for help): C
First block: 64
Length in blocks: 511968
Name of partition: Snap1
Type of partition: MACOSX_MyContent
Command (? for help): p
/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: MACOSX_MyContent Snap1 511968 @ 64 (250.0M)
3: Apple_Free Extra 511968 @ 512032 (250.0M)


Device block size=512, Number of Blocks=1024000
DeviceType=0x0, DeviceId=0x0

Command (? for help): C
First block: 512032
Length in blocks: 511960
Name of partition: Snap2
Type of partition: MACOSX_MyContent
Command (? for help): p
/dev/rdisk1 map block size=512
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: MACOSX_MyContent Snap1 511968 @ 64 (250.0M)
3: MACOSX_MyContent Snap2 511960 @ 512032 (250.0M)
4: Apple_Free Extra 8 @ 1023992


Device block size=512, Number of Blocks=1024000
DeviceType=0x0, DeviceId=0x0

Command (? for help):

--  Cliff

On 22-Feb-05, at 1:38 AM, Imran wrote:

Hi,

 

I have 2 partitions named ‘Snap1’ and ‘Snap2’ on the a disk
‘/dev/rdisk1’ and want to change ContentHint of one partition to
‘MACOSX_MyContent’ instead of ‘Apple_HFS’, so that my driver gets
loaded only for that particular partition whose ContentHint matches.
How can I change the content hint of single partition out of 2
partitions on a disk.

 

I have tried this using pdisk but it  changes the partition type of
whole disk to ‘MACOSX_MyContent’ and all the partitions disappear for
/dev/rdisk1. Steps taken to do the same are

# pdisk

Top:level command (? for help): e // to edit the partition

 Top:level command (? for help): i // to initialize the disk
/dev/rdisk1

Top:level command (? for help): t // to change partition type

Top:level command (? for help): w // to write the partition map

 

 

Below is the output of pdisk after changing partition type:

 

Top:level command (? for help): L

/dev/rdisk2  map block size=512

   #:                 type name                  length   base      (
size )

   1:  Apple_partition_map Apple                     63 @ 1       

    2:            Apple_HFS Extra              143374680 @ 64        (
68.4G)

 

Device block size=512, Number of Blocks=143374744

DeviceType=0x0, DeviceId=0x0

 

/dev/rdisk1  map block size=512

   #:                 type name                  length   base      (
size )

   1:  Apple_partition_map Apple                     63 @ 1       

    2:     MACOSX_MyContent Extra              143374680 @ 64        (
68.4G)

 

Device block size=512, Number of Blocks=143374744

DeviceType=0x0, DeviceId=0x0

 

/dev/rdisk3  map block size=512

   #:                 type name                  length   base      (
size )

   1:  Apple_partition_map Apple                     63 @ 1       

    2:           Apple_Free                            0+@ 64      

    3:            Apple_HFS Apple_HFS_Untitled_4 143112520 @ 262208   
( 68.2G)

   4:           Apple_Free                            0+@ 143374728

 

Device block size=512, Number of Blocks=143374744

DeviceType=0x0, DeviceId=0x0

 

/dev/rdisk0  map block size=512

   #:                 type name                  length   base      (
size )

   1:  Apple_partition_map Apple                     63 @ 1       

    2:           Apple_Free                            0+@ 64      

    3:            Apple_HFS Apple_HFS_Untitled_2  64961408 @ 262208   
( 31.0G)

   4:           Apple_Free                            0+@ 65223616

    5:            Apple_HFS Apple_HFS_Untitled_3  64961408 @ 65485760 
( 31.0G)

   6:           Apple_Free                            0+@ 130447168

   7:            Apple_HFS Apple_HFS_Untitled_4  13252672 @ 130709312
(  6.3G)

   8:           Apple_Free                            0+@ 143961984

   9:            Apple_HFS Apple_HFS_Untitled_5  12077344 @ 144224128
(  5.8G)

  10:           Apple_Free                            0+@ 156301472

 

Device block size=512, Number of Blocks=156301488

DeviceType=0x0, DeviceId=0x0

 

 

Thanks and Regards,

Imran

     

  

 

 

 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden



--

Cliff

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >RE: ContentHint Issue (From: "Imran" <email@hidden>)

  • Prev by Date: Re: Multiple IOMedia objects creation in Filter Scheme Driver
  • Next by Date: Re: ContentHint Issue
  • Previous by thread: RE: ContentHint Issue
  • Next by thread: Re: ContentHint Issue
  • Index(es):
    • Date
    • Thread