Problem mounting GPT disk partition

1,158

Solution 1

You cannot use fdisk to work with GPT disks, it will only work with MBR disks. Any disk that > 2TB must be GPT.

You likely cannot mount this HDD because even though the kernel has detected it (in the dmesg output) the HDD hasn't been partitioned or formatted with a filesystem so that it can be mounted.

Try the following to do this:

$ sudo sfdisk -l

This will list all the GPT devices & partitions. You can create a partition using sfdisk as well.

$ sudo sfdisk /dev/sda

After you've created a partition using sfdisk you'll want to format it:

$ mkfs.ext4 /dev/sda1

With the above done you should then be able to mount the HDD as you were originally attempting.

Determining a HDD's filesystem

If you're unsure how a HDD and/or partition may have been formatted you can use the command dumpe2fs to accomplish this.

$ sudo dumpe2fs /dev/sda1 | less

Parsing the output from this command is covered in this U&L Q&A titled: Reliable way to detect ext2 or ext3 or ext4?

References

Solution 2

Forget about fdisk, use parted -l or gdisk -l (from package gptfdisk) instead ...

Solution 3

Having had exactly the same issue as you, by solution was to use a different SATA controller. The problem occurred when the drive in question was connected via a USB SATA controller. In order to access the drive I unplugged the DVD drive from the motherboard onboard SATA controller (I have no spare sockets) and plugged the drive in (no reboot required - SATA is hot pluggable).

Share:
1,158

Related videos on Youtube

Manikandan Balachandran
Author by

Manikandan Balachandran

Updated on September 18, 2022

Comments

  • Manikandan Balachandran
    Manikandan Balachandran over 1 year

    What is the difference between tcp inbound channel adaptor and tcp inbound channel gateway (Spring Integration)?

    • RichardTheKiwi
      RichardTheKiwi over 11 years
      Consider adding general tags to the question for better view. You are allowed 5 tags, after all
    • Admin
      Admin over 8 years
      I've got exactly the same problem as you - did you ever solve it?
    • Admin
      Admin about 5 years
      I thought I had this problem, but turned out I was trying to mount /dev/sda rather than /dev/sda1. Worked without a hitch (even with a large GPT disc) once I switched that.
  • Hamza
    Hamza about 10 years
    Thanks, the troubling thing is: This is not a new disk, I have been using it for almost a year and I'm absolutely certain that there is (or was) an ext4 volume in there.
  • slm
    slm about 10 years
    @Hamza - the lack of a /dev/sda1 in dmesg means the kernel is not auto detecting any useful filesystem on it. Do you have other EXT4 devices mounted? That would confirm that the drivers are available/working so that EXT4 devices can be mounted.
  • Hamza
    Hamza about 10 years
    Yes, there are four other disks with a number of ext4 partitions mounted on the same machine.
  • slm
    slm about 10 years
    @Hamza - output of sfdisk -l?
  • Hamza
    Hamza about 10 years
    Disk /dev/sda: 364801 cylinders, 255 heads, 63 sectors/track Warning: The partition table looks like it was made for C/H/S=*/256/63 (instead of 364801/255/63). For this listing I'll assume that geometry. Units = cylinders of 8257536 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 0+ 45422- 45423- 366283322+ ee GPT /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty
  • Hamza
    Hamza about 10 years
    Sorry about formatting.
  • Hamza
    Hamza about 10 years
    I've just attached the same disk that is failing to another machine and I can see the contents without a hitch. This keeps getting stranger :)
  • slm
    slm about 10 years
    @Hamza - try using mount --verbose ... for additional info on why it's unsuccessful. Also /dev/sda and /dev/sda1 are showing up as device labels on the misbehaving box? Please confirm this, assuming they are given your fdisk output but just want to check it off the list.
  • Hamza
    Hamza about 10 years
    They do show up as device labels, the output of mount --verbose is still: mount: special device /dev/sda1 does not exist
  • slm
    slm about 10 years
    @Hamza - can you try getting the output of strace mount -t ext4 /dev/sda1 disk/? Please attach this to your Q or use pastebin.com and include the URL here.
  • Jakob Bennemann
    Jakob Bennemann over 9 years
    Welcome to *nix.SE! One-line opinion-based answers like this are often not too helpful. Please consider explaning why these other options might be better; using links and documentation as references will further benefit the quality of your suggestion.