cranberry667

Q: Created partition after bootcamp windows install - 'No Disk'

Had Windows 7 installed via bootcamp for some time and decided to go back into the mac OS and create another NTFS partition for extra storage and here I am 10 minutes later finding out this destroys the bootcamp partition.

 

Found this thread https://discussions.apple.com/thread/4144252?start=630&tstart=0

 

Setup:

 

Single 500GB drive

2 Partitions - 1 Mac OS, other Windows NTFS

 

 

sudo gpt -r -vv show disk0

 

 

gpt show: disk0: mediasize=500107862016; sectorsize=512; blocks=976773168

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 976773167

      start       size  index  contents

          0          1         MBR

          1          1         Pri GPT header

          2         32         Pri GPT table

         34          6        

         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

     409640  162338320      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC

  162747960    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

  164017496  323990184        

  488007680  488765440      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

  976773120         15        

  976773135         32         Sec GPT table

  976773167          1         Sec GPT header

 

 

 

 

sudo fdisk /dev/disk0

 

 

Disk: /dev/disk0geometry: 60801/255/63 [976773168 sectors]

Signature: 0xAA55

         Starting       Ending

#: id  cyl  hd sec -  cyl  hd sec [     start -       size]

------------------------------------------------------------------------

1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>

2: AF 1023 254  63 - 1023 254  63 [    409640 -  162338320] HFS+       

3: AB 1023 254  63 - 1023 254  63 [ 162747960 -    1269536] Darwin Boot

4: 0C 1023 254  63 - 1023 254  63 [ 488007680 -  488765440] Win95 FAT32L

 

iMac, Mac OS X (10.7.5)

Posted on Jul 24, 2013 1:55 AM

Close

Q: Created partition after bootcamp windows install - 'No Disk'

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by Csound1,

    Csound1 Csound1 Jul 24, 2013 9:15 AM in response to cranberry667
    Level 9 (51,432 points)
    Desktops
    Jul 24, 2013 9:15 AM in response to cranberry667

    Shame that you did not make that clear before we wasted our time.

     

    Good luck.

  • by cranberry667,

    cranberry667 cranberry667 Jul 24, 2013 9:20 AM in response to Csound1
    Level 1 (0 points)
    Jul 24, 2013 9:20 AM in response to Csound1

    I gave a link to the last page of the main discussion showing Christopher's instructions. You wasted your time and my time.

     

    Thanks.

  • by Csound1,

    Csound1 Csound1 Jul 24, 2013 10:13 AM in response to cranberry667
    Level 9 (51,432 points)
    Desktops
    Jul 24, 2013 10:13 AM in response to cranberry667

    You expect people to follow your links around to find out rather than just posting the information yourself.?

     

    Goodbye.

  • by cranberry667,

    cranberry667 cranberry667 Jul 24, 2013 10:58 AM in response to Csound1
    Level 1 (0 points)
    Jul 24, 2013 10:58 AM in response to Csound1

    I expected no but Christoper Murphy to follow a link. I posted all the information that was needed.

     

    FYI if you followed the link or read my reply to BobtheFisherman you wouldn't have had to waste your time commenting.

     

    This forum is welcoming. Goodbye.

  • by Christopher Murphy,Helpful

    Christopher Murphy Christopher Murphy Jul 24, 2013 7:37 PM in response to cranberry667
    Level 3 (555 points)
    Jul 24, 2013 7:37 PM in response to cranberry667

    The main problem is the MBR 4th partition type code is 0C, it should be 07, and it's not marked active (boot flag is not set). A secondary problem is that you have a 154GB pile of free space between partitions 3 and 4, and it may be tricky getting that absorbed by one or the other file system.

     

    First, you should make a backup of important things on the OS X volume for starters, so that you at least have that should one of make a mistake with my subsequent recommendations.

     

    Next, download and install gdisk. This is a command line only utility so you'll be using it in Terminal once installed. It's interactive, and doesn't write anything to disk until you explicitly tell it to, so it's quite safe.

     

    Each line is a command, followed by return, you can use ? to see a menu and find that the first command "r" is to get to the recovery menu. Once you're there, you can use ? again to see that menu of options and find h is to make a new hybrid MBR. And the program is quite well documented so you can see this is quite transparent and straight forward. If the line is <enter> that means enter no information just hit the return key to accept the program's default value.

     

    sudo gdisk /dev/disk0

    r

    h

    2 3 4

    y

    <enter>

    n

    <enter>

    n

    <enter>

    y

    o

    p


    Now copy-paste the output from the o and p commands into the forum for proof reading if you want. If you don't care for it to be proofed you can issue the w command to write out the changes to disk. And reboot. Now see if Windows is bootable again.

     

    Basically all of that is to create a new hybrid MBR, adding the GPT and EFI System partition into MBR partition 1; and then 1:1 correlation GPT to MBR for partitions 2 3 4, with only 4 marked as bootable, accepting the default partition type codes (gdisk gets the defaults from the GPT partition type code which are all correct). So this should fix the first problem.

     

    Once that's fixed we'll discuss what to do with this 154GB of free space as there are some tricky options there.

  • by cranberry667,

    cranberry667 cranberry667 Jul 25, 2013 12:34 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jul 25, 2013 12:34 AM in response to Christopher Murphy

    Hey thanks for getting back to me.

     

    O output:

     

     

    Recovery/transformation command (? for help): o

     

     

    Disk size is 976773168 sectors (465.8 GiB)

    MBR disk identifier: 0x00000527

    MBR partitions:

     

     

    Number  Boot  Start Sector   End Sector   Status      Code

       1                     1       409639   primary     0xEE

       2                409640    162747959   primary     0xAF

       3             162747960    164017495   primary     0xAB

       4      *      488007680    976773119   primary     0x07

     

    P output:

     

     

    Recovery/transformation command (? for help): p


    Disk /dev/disk0: 976773168 sectors, 465.8 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): 00005D55-61FF-0000-124D-00007E780000

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 976773134

    Partitions will be aligned on 8-sector boundaries

    Total free space is 323990205 sectors (154.5 GiB)

     

     

    Number  Start (sector)    End (sector)  Size       Code  Name

       1              40          409639   200.0 MiB   EF00  EFI system partition

       2          409640       162747959   77.4 GiB    AF00  Customer

       3       162747960       164017495   619.9 MiB   AB00  Recovery HD

       4       488007680       976773119   233.1 GiB   0700  BOOTCAMP

     

     

    I shrunk the OS X partition by 154GB and formatted it to NTFS so Windows could see it as another drive for use as temporary storage. I deleted it after I couldn't boot in hope that it would fix the no boot issue.

     

    Before I write the changes would it be easier to sort the 154GB free space problem if I just extended the OS X partition back to its original size in disk utility? Would that just make things worse? I don't mind doing that unless you think I can extend my Windows partition with that extra space.

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jul 25, 2013 9:12 AM in response to cranberry667
    Level 3 (555 points)
    Jul 25, 2013 9:12 AM in response to cranberry667

    That looks right so just write that out with the w command (followed by y) and then reboot and test it out. This needs to be fixed regardless so you can backup anything important on the Windows volume before moving on to dealing with the free space.

  • by cranberry667,

    cranberry667 cranberry667 Jul 25, 2013 9:38 AM in response to Christopher Murphy
    Level 1 (0 points)
    Jul 25, 2013 9:38 AM in response to Christopher Murphy

    It worked great thanks!

     

    Any way I can extend the Windows partition using the free space whilst keeping everything intact?

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jul 25, 2013 10:29 AM in response to cranberry667
    Level 3 (555 points)
    Jul 25, 2013 10:29 AM in response to cranberry667

    The most commonly recommended product in these forums for doing this is Paragon Camptune. It understands the unique, non-standard partition scheme that Apple is using. It will correctly resize JHFS+ and NTFS volumes, and then updates the GPT and MBR partition maps. That's the easiest and fastest way to do it.

     

    If you want to use free tools, the basic recipe is:

     

    1. Use gdisk to create a new protective MBR. This removes the hybrid MBR you previously made, and makes the disk strictly GPT. I suggest this to avoid any confusion which partition table is to be updated in subsequent steps, and the hybrid MBR will be recreated later based on the updated GPT.

     

    2. Gparted is a linux program that can do the move/resize of an NTFS volume. It needs to be moved forward first, since resizing happens at the end of NTFS (and JHFS+) volumes. This will take a while and it's important that the process isn't interrupted. There are two ways to get access to Gparted, the easiest is download Gparted Live and burn it to a CD/DVD and boot the Mac with the c key, then go find Gparted and run it. There are lots of guides on the internet how to do the move/resize.

     

    If you need to boot off a USB flash drive, then you also (ideally) need a wired internet connection as well. Download Fedora 19 (Desktop, 64-bit) and use the OS X dd command to write it to a USB stick, boot from the USB stick, then in the Terminal program type:

     

    su

    yum install gparted

     

    It isn't installed to the hard drive, it's only in memory, so if you were to reboot from this USB stick, Gparted will be gone.

     

    3. Reboot to OS X, rerun gdisk, and execute the earlier commands I gave to recreate the hybrid MBR.

     

    4. Reboot to Windows. The NTFS volume will be flagged by Gparted (actually ntfs-3g tools) as needing to be repaired by chkdsk the next time Windows boots, so seeing that repair will be normal.

  • by cranberry667,

    cranberry667 cranberry667 Jul 26, 2013 1:41 PM in response to Christopher Murphy
    Level 1 (0 points)
    Jul 26, 2013 1:41 PM in response to Christopher Murphy

    Good old gparted! yer I've used it in the past but Paragon Camptune looked too good...so I bought it yesterday after the process finished and I tried to boot into Windows it gave me instructions to input

     

    bootsect /nt60 SYS /force

    or

    botosect /nt60 ALL /force

     

    in the command line whilst using a Windows 7 recovery disk/usb.

     

    Everything booted like it did before I used Camptune but the free space didn't reallocate as was told to by moving the slider.

     

    Booted back into OS X to check if the free space can be added back to the OS X partition like it could prior to using gdisk but when I press apply it reverts back.

     

    Was there something I needed to do with the free space before using Camptune?

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jul 26, 2013 2:05 PM in response to cranberry667
    Level 3 (555 points)
    Jul 26, 2013 2:05 PM in response to cranberry667

    I haven't used it so I'd give them a call and see what they have to say. I'd like to think that it would consider either JHFS+ or free space as a possible source to add to an existing NTFS volume, but I could be wrong. Maybe it only expects to shrink JHFS+ and then expand NTFS or vice versa, rather than growing NTFS from free space.

     

    What do you get for:

     

    diskutil resizevolume /dev/disk0 limit

  • by cranberry667,

    cranberry667 cranberry667 Jul 26, 2013 2:45 PM in response to Christopher Murphy
    Level 1 (0 points)
    Jul 26, 2013 2:45 PM in response to Christopher Murphy

    diskutil resizevolume /dev/disk0 limit

     

    gives me

     

    Volume format does not support resizing

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jul 26, 2013 2:46 PM in response to cranberry667
    Level 3 (555 points)
    Jul 26, 2013 2:46 PM in response to cranberry667

    oh yeah right. specify the right partition also, something like disk0s2 usually. you can use diskutil list to find it.

  • by cranberry667,

    cranberry667 cranberry667 Jul 26, 2013 2:56 PM in response to Christopher Murphy
    Level 1 (0 points)
    Jul 26, 2013 2:56 PM in response to Christopher Murphy

    $ diskutil list

    /dev/disk0

       #:                       TYPE NAME                    SIZE       IDENTIFIER

       0:      GUID_partition_scheme                        *500.1 GB   disk0

       1:                        EFI                         209.7 MB   disk0s1

       2:                  Apple_HFS Macintosh HD            84.6 GB    disk0s2

       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

       4:       Microsoft Basic Data BOOTCAMP                248.7 GB   disk0s4

     

    $ diskutil resizevolume /dev/disk0s2 limit


    limit does not appear to be a valid disk size

     

    $ diskutil resizevolume /dev/disk0s4 limit


    Volume format does not support resizing

  • by Christopher Murphy,

    Christopher Murphy Christopher Murphy Jul 26, 2013 3:03 PM in response to cranberry667
    Level 3 (555 points)
    Jul 26, 2013 3:03 PM in response to cranberry667

    try it with limits, with an s.

Previous Page 2 of 3 last Next