Page 1 of 2 12 LastLast
Results 1 to 10 of 16

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

  1. #1
    Join Date
    Aug 2008
    Beans
    51

    External hard drive shows up as "unallocated" in GParted

    I'm about to make a clean install of my dual-booting Ubuntu and Windows 7 system, so I made some backups to an external hard drive which has two partitions, one hfs+(journaled) and one hfs+. I would use the non-journaled one for ubuntu. Both were made using disk utility on a mac.

    I was able to make my backups a few days ago, but now when I plug in the hard drive, Ubuntu doesn't recognize it and GParted lists it as entirely unallocated space. However, when I plug it into the Mac, both partitions show up just fine. Windows also shows the drive as unallocated.

    This is the output for "sudo parted /dev/sdb print"
    Code:
    Model: Hitachi HDP725050GLA360 (scsi)
    Disk /dev/sdb: 500GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start  End  Size  Type  File system  Flags
    "sudo fdisk -l"
    Code:
    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0000a6cc
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        6527    52428096    b  W95 FAT32
    /dev/sda2   *        6528        9791    26218080    7  HPFS/NTFS
    /dev/sda3            9792       29761   160409025   83  Linux
    /dev/sda4           29762       30401     5140800    5  Extended
    /dev/sda5           29762       30401     5140768+  82  Linux swap / Solaris
    
    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x4842f440
    
       Device Boot      Start         End      Blocks   Id  System
    What can I do to regain acces to this drive?

  2. #2
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

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

    See what the mac partition tool thinks the partition type is. You probably used the old mac partition table. If so you will need to reformat the disk and use either msdos or gpt partition tables.

  3. #3
    Join Date
    Aug 2008
    Beans
    51

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

    Disk utility lists them both as hfs+, one journaled and one not. Would I really need to reformat the drive? I was able to read and write to it previously with Ubuntu. Also the output of "parted /dev/sdb print" says the parition table is in fact msdos.

  4. #4
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

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

    Those are the types of the partitions. What is the type of the PARTITION TABLE.

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

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

    Please download and install the latest version of GPT fdisk (gdisk) from its Sourceforge download page and post the output of typing "sudo gdisk -l /dev/sdb". The result should look something like this:

    Code:
    $ sudo gdisk -l /dev/sdc
    GPT fdisk (gdisk) version 0.6.13
    
    Partition table scan:
      MBR: MBR only
      BSD: not present
      APM: not present
      GPT: not present
    
    
    ***************************************************************
    Found invalid GPT and valid MBR; converting MBR to GPT format.
    ***************************************************************
    
    Disk /dev/sdc: 31576064 sectors, 15.1 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 98902377-B4BC-4F63-AE17-3E1B7309141F
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 31576030
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 1560509 sectors (762.0 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048        19531775   9.3 GiB     0700  Linux/Windows data
       2        19900416        24094719   2.0 GiB     0700  Linux/Windows data
       3        24639488        30930943   3.0 GiB     0700  Linux/Windows data
    I'm particularly interested in the "partition table scan" lines, since those will reveal what type of partition tables are present (of the four that the program can detect). My suspicion is that the disk either has an old Apple Partition Map (APM) partition table or that it's got a new GUID Partition Table (GPT), but that it or its protective MBR has been damaged in some way. Precisely how to recover from the problem depends on what's happened, of course.

  6. #6
    Join Date
    Aug 2008
    Beans
    51

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

    "sudo gdisk -l /dev/sdb" :
    Code:
    gdisk: /lib/libuuid.so.1: no version information available (required by gdisk)
    GPT fdisk (gdisk) version 0.6.13
    
    Partition table scan:
      MBR: MBR only
      BSD: not present
      APM: not present
      GPT: not present
    
    
    ***************************************************************
    Found invalid GPT and valid MBR; converting MBR to GPT format.
    ***************************************************************
    
    Disk /dev/sdb: 976773168 sectors, 465.8 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 087350FE-FAB9-46CF-BDEC-4B7D16C735BD
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 976773134
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 976773101 sectors (465.8 GiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name

  7. #7
    Join Date
    Aug 2008
    Beans
    51

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

    According to "parted /dev/sdb print" the partition table is msdos, but it was created using disk utility and hfs+. Does that make sense?

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

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

    According to gdisk, the disk is a standard MBR disk with no partitions defined. This is consistent with what parted is saying, but both of these tools disagree with what OS X is saying. In OS X, could you please run the following command from an OS X Terminal and post the results back?

    Code:
    sudo diskutil list
    This might give some clue about why OS X is reporting the presence of partitions where Linux can't seem to find them.

  9. #9
    Join Date
    Aug 2008
    Beans
    51

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

    "sudo diskutil list" :
    Code:
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *111.8 Gi   disk0
       1:                        EFI                         200.0 Mi   disk0s1
       2:                  Apple_HFS Macintosh HD            111.5 Gi   disk0s2
    /dev/disk2
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     Apple_partition_scheme                        *465.8 Gi   disk2
       1:        Apple_partition_map                         31.5 Ki    disk2s1
       2:             Apple_Driver43                         28.0 Ki    disk2s2
       3:             Apple_Driver43                         28.0 Ki    disk2s3
       4:           Apple_Driver_ATA                         28.0 Ki    disk2s4
       5:           Apple_Driver_ATA                         28.0 Ki    disk2s5
       6:             Apple_FWDriver                         256.0 Ki   disk2s6
       7:         Apple_Driver_IOKit                         256.0 Ki   disk2s7
       8:              Apple_Patches                         256.0 Ki   disk2s8
       9:                  Apple_HFS Disque externe          400.0 Gi   disk2s10
      10:                  Apple_HFS Tristan                 65.5 Gi    disk2s12

  10. #10
    Join Date
    Aug 2008
    Beans
    51

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

    I ran testdisk on this drive and it managed to identify both lost partitions and their start and end sectors. Only it couldn't write the partitions and gave this message : "Function write_part_mac not implemented
    Use pdisk to recreate the missing partition using values displayed by TestDisk".

    So I did some research and read that this can be done manually using parted. First by restoring the partition table with the mklabel command and then by writing the partitions with mkpart, using the start and end info from testdisk. Only I'm afraid if I do this and it goes wrong I might lose access to this drive from the Mac, which is the only way I can read it right now.

    Should I attempt this or is there a better way?

Page 1 of 2 12 LastLast

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
  •