Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: External hard drive shows up as "unallocated" in GParted

  1. #11
    Join Date
    Aug 2008
    Beans
    51

    Re: External hard drive shows up as "unallocated" in GParted

    Also, parted lists the partition table of the drive as "msdos" but Disk Utility says it's Apple. If I use mklabel, just I make it mac or msdos?

  2. #12
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: External hard drive shows up as "unallocated" in GParted

    OS X is identifying the disk as an APM disk ("Apple_partition_scheme"), although the gdisk tests for APM data are failing to find an APM signature. My suspicion is that the disk is a perfectly valid APM disk but that some utility went and wrote an MBR on it because it didn't recognize the APM data, and this is confusing GParted and may even have overwritten the signature that gdisk normally uses to identify APM disks.

    As the developer of gdisk, I'd appreciate getting a copy of the first few sectors of the disk so that I can study this and see if I should be updating my gdisk partition table identification code. Could you please run the following command and send me the resulting apm.out file at rodsmith@rodsbooks.com? (This command sends me the first ten sectors of the disk, which should contain no sensitive data.)

    Code:
    sudo dd if=/dev/sdb of=apm.out bs=512 count=10
    If you run it from OS X rather than Linux, change "/dev/sdb" to "/dev/disk1". Thanks.

    As to how to proceed, I'm not sure precisely how to repair the damage, but I have several suggestions to try, in increasing order of desperation:


    1. Use Apple's Disk Utility to make some minor change to the disk, such as altering the name of a volume. With any luck, it will automatically fix the damage.
    2. Make a more extreme change to the volume using Apple's Disk Utility. For instance, you could delete a partition or create a new one (if there's any free space).
    3. Attempt to replace the bogus MBR data with valid APM data. Unfortunately, I know very little about the details of APM data, so my only suggestion is to create a valid APM volume (on a USB flash drive, say) using OS X's Disk Utility and then copy it over using dd, as in "dd if=/dev/disk2 of=/dev/disk1 bs=512 count=1". Be sure to include the bs= and count= options! You might need to increase the count value to 2. I have no idea if this will work, though; it could be that the APM sector 0 data must vary with the disk size or some other feature that varies with the disks.
    4. Copy the data off the affected disk, repartition using MBR or GPT rather than APM, and then copy the data back. You should probably do all this in OS X, although you could use Linux.
    5. Use TestDisk to attempt to recover the partitions as MBR partitions. You'll have to find some way to force it to treat the disk as an MBR disk, since from what you report, it seems to be detecting some APM data and is trying to treat it as an APM disk. I'm not an expert on APM, so I can't offer any specific suggestions for how to do this.



    As a general comment, it's best to use MBR or GPT these days; Apple has largely abandoned APM, although it's still supported in the OS and in Disk Utility. MBR (referred to as "ms-dos" in most libparted-based tools) is the old-style partitioning scheme that's used on most PCs, but MBR is living like the dinosaurs 65 million years ago: There's a giant meteor, in the form of the 2 TiB limit, that will soon cause MBR's extinction. GPT is the answer to this problem, and Apple has already embraced it on its Intel-based Macs. Linux is happy with any of these partition tables, although I'm not sure if it's possible to boot Linux from APM on a PC.

  3. #13
    Join Date
    Aug 2008
    Beans
    51

    Re: External hard drive shows up as "unallocated" in GParted

    Thanks for your response.

    I've emailed you the output of that command. In Disk Utility, I had previously tried to disable journaling and to "repair" one of the paritions. Both attemps failed. I don't know if that indicates anything. I will try to create a new partition, and see if that helps.

    So, does this mean writing a new partition table and restoring the partitions through parted would not be a good solution?


    I intend to reformat that drive anyway, seeing how screwed up it is, I just need to be able to read it in Ubuntu so I can make a backup of it first.

  4. #14
    Join Date
    Aug 2008
    Beans
    51

    Re: External hard drive shows up as "unallocated" in GParted

    I actually tried to repair the disk using Disk Utility again, but this time I noticed the problem it detected was with the volume's bitmap.

  5. #15
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: External hard drive shows up as "unallocated" in GParted

    Creating a new partition table and restoring manually will also work, provided you can figure out the exact start and end points of the partitions. The OS X diskutil output you posted doesn't provide information to that level of detail, but perhaps there's a way you can get that. (TestDisk will do so, but it presents data in CHS values, at least for MBR disks; I don't know if it'll present LBA data for your disk. CHS values are weird and easy to mis-translate into LBA values.)

  6. #16
    Join Date
    Aug 2008
    Beans
    51

    Re: External hard drive shows up as "unallocated" in GParted

    Well, I created a new partition table, restored the partitions and I've managed to salvage all of my files.

    Thanks to everyone who responded

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •