I am trying to mount a partition on a GPT disk, but I get the following error:
$ sudo mount -t ext4 /dev/sda1 disk/
mount: special device /dev/sda1 does not exist
Looking at dmesg, I don't see any errors on /dev/sda:
$ dmesg | grep sda
[ 1.367508] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
[ 1.367514] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1.367607] sd 0:0:0:0: [sda] Write Protect is off
[ 1.367611] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.367654] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.367936] sda:
[ 1.392417] sd 0:0:0:0: [sda] Attached SCSI disk
fdisk reports the GPT partition:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
256 heads, 63 sectors/track, 363376 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 45423 366283322+ ee GPT
Partition 1 does not start on physical sector boundary.
parted fails:
$ sudo parted /dev/sda print
Error: /dev/sda: unrecognised disk label
Kernel seems to have support for EFI (How to mount a partition on a disk that has an EFI GPT partition table in Debian GNU/Linux 5.0.3 (Lenny))
$ cat /boot/config-2.6.32-5-amd64 | grep EFI
CONFIG_EFI=y
CONFIG_FB_EFI=y
CONFIG_EFI_VARS=m
CONFIG_CACHEFILES=m
# CONFIG_CACHEFILES_DEBUG is not set
# CONFIG_CACHEFILES_HISTOGRAM is not set
CONFIG_EFI_PARTITION=y
How can I mount this GPT partition?
EDIT: I've just attached the same disk that is failing to another machine and I can see the contents without a hitch. Putting it back to the original box, I am having the same issue.
Best Answer
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:
This will list all the GPT devices & partitions. You can create a partition using
sfdisk
as well.After you've created a partition using
sfdisk
you'll want to format it: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.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