Anyone use gpt?

Jerry LeVan jerry.levan at eku.edu
Mon Oct 8 17:48:37 PDT 2007


On Oct 7, 2007, at 3:31 PM, Donkergroen bvba wrote:

>
> If you have free space you should be able to change the free space  
> in a filesystem  in disk utility.
> ( Application/Utilities/Disk Utility.app )
>
> Dirk
>
> On 07 Oct 2007, at 19:24, Jerry LeVan wrote:
>
>>
>> On Oct 7, 2007, at 1:01 PM, Donkergroen bvba wrote:
>>
>>> I still don't understand what you want to do , but I think this  
>>> will help you :
>>> http://www.macgeekery.com/tips/cli/nondestructively_resizing_volumes
>>>
>>> I think after you do something like this : $ diskutil  
>>> resizeVolume disk1s2 75G
>>> ( on the cmd line as root )
>>> After that you should be able to use diskutility to create the  
>>> new partition from the free space.
>>> Dirk
>>> On 07 Oct 2007, at 18:47, Jerry LeVan wrote:
>>>
>>>>
>>>> On Oct 7, 2007, at 12:39 PM, Donkergroen bvba wrote:
>>>>
>>>>> what does "diskutil list" show you ?
>>>>> On 07 Oct 2007, at 18:29, Jerry LeVan wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have a largish firewire disk that I use for backing up various
>>>>>> drives in two of my mac osx computers.
>>>>>>
>>>>>> I have about 120GB of free space left on the firewire drive and
>>>>>> I would like to setup about half of the free space for general
>>>>>> (upbacked up ) storage...
>>>>>>
>>>>>> Disk utility seems to want to re-init the entire drive if I try
>>>>>> to add a partition.
>>>>>>
>>>>>> I apropos'ed partition and found the program "gpt".
>>>>>>
>>>>>> The man page asserts that one can use gpt to "add" a partition.
>>>>>>
>>>>>> The command gpt show displays:
>>>>>>
>>>>>> [mbp:~]$ gpt show disk2
>>>>>>       start       size  index  contents
>>>>>>           0          1         PMBR
>>>>>>           1          1         Pri GPT header
>>>>>>           2         32         Pri GPT table
>>>>>>          34          6
>>>>>>          40     409600      1  GPT part - C12A7328-F81F-11D2- 
>>>>>> BA4B-00A0C93EC93B
>>>>>>      409640  243669008      2  GPT part - 48465300-0000-11AA- 
>>>>>> AA11-00306543ECAC
>>>>>>   244078648     262144
>>>>>>   244340792  124326424      3  GPT part - 48465300-0000-11AA- 
>>>>>> AA11-00306543ECAC
>>>>>>   368667216     262144
>>>>>>   368929360  359339512      4  GPT part - 48465300-0000-11AA- 
>>>>>> AA11-00306543ECAC
>>>>>>   728268872  248504263
>>>>>>   976773135         32         Sec GPT table
>>>>>>   976773167          1         Sec GPT header
>>>>>>
>>>>>> Tain't clear what the two 262144 sized unlabeled areas are, I  
>>>>>> am guessing maybe
>>>>>> the journal file. (But get info says that all three of the  
>>>>>> partitions( index 2,3,4)
>>>>>> are journaled...
>>>>>>
>>>>>> Has anyone actually used this program to "add" a new partition?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jerry
>>>>>
>>>>
>>>> [mbp:~]$ diskutil list disk2
>>>> /dev/disk2
>>>>    #:                   type name               size       
>>>> identifier
>>>>    0:  GUID_partition_scheme                    *465.8 GB disk2
>>>>    1:                    EFI                    200.0 MB  disk2s1
>>>>    2:              Apple_HFS MacBigDisk         116.2 GB  disk2s2
>>>>    3:              Apple_HFS MacSmallDisk       59.3 GB   disk2s3
>>>>    4:              Apple_HFS MBP                171.3 GB  disk2s4
>>>>
>>>> It does not show anything of use for creating new partitions ;(
>>>>
>>>> Jerry
>>>>
>>>
>>
>> Well I already have a big hunk of free space at the end of the  
>> drive...
>> I just wanted to carve out a partition of the free space for non  
>> backup
>> usage (without destroying the contents of the other 3 partitions).
>>
>> I found the tech note: http://developer.apple.com/technotes/tn2006/ 
>> tn2166.html
>>
>> It explained the mysterious 128 MB gap between the partitions.
>>
>> I guess I will think about this for a while...If worst comes to  
>> pass I guess
>> I could reformat from scratch and rebuild the backups, surely  
>> nothing could
>> possibly go wrong :)
>>
>> Jerry
>


Well it turned out to be fairly easy...

[mbp:~]$ gpt show disk2
       start       size  index  contents
           0          1         PMBR
           1          1         Pri GPT header
           2         32         Pri GPT table
          34          6
          40     409600      1  GPT part - C12A7328-F81F-11D2- 
BA4B-00A0C93EC93B
      409640  243669008      2  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   244078648     262144
   244340792  124326424      3  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   368667216     262144
   368929360  359339512      4  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   728268872  248504263
   976773135         32         Sec GPT table
   976773167          1         Sec GPT header
[mbp:~]$ sudo -s
Password:
mbp:~ root# gpt add -b 728530966 -s 124000000 -t hfs disk2
mbp:~ root# gpt show disk2
       start       size  index  contents
           0          1         PMBR
           1          1         Pri GPT header
           2         32         Pri GPT table
          34          6
          40     409600      1  GPT part - C12A7328-F81F-11D2- 
BA4B-00A0C93EC93B
      409640  243669008      2  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   244078648     262144
   244340792  124326424      3  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   368667216     262144
   368929360  359339512      4  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   728268872     262094
   728530966  124000000      5  GPT part - 48465300-0000-11AA- 
AA11-00306543ECAC
   852530966  124242169
   976773135         32         Sec GPT table
   976773167          1         Sec GPT header
mbp:~ root#

I then used Disk Utility.app to erase and name the volume.

Much better than reformating the whole drive to add a partition :)

Jerry




More information about the MacOSX-admin mailing list