That error message has nothing to do with GPT (or MBR) type codes; it's referring to the filesystem contained within the partition. I suspect you haven't created that filesystem. Many partitioning tools, including gdisk
, do not create filesystems; they just create the partitions in which filesystems can be created. To create a filesystem, you'd need to use a command like this:
mkfs -t ext4 /dev/sda4
You must type that command as root
or via the sudo
utility, just like gdisk
.
Some tools, such as GParted, do both jobs simultaneously, which is convenient but muddies the waters a bit for those learning the system, because it's easy to misunderstand the distinction between partitions and filesystems. Partitions are simple data structures that consist of the starting sector number and the ending sector number (or, equivalently, the length), as well as associated meta-data such as a type code. Filesystems are much more complex data structures that are typically contained within a partition. Filesystems facilitate the creation and manipulation of files -- often thousands of them.
Incidentally, the Linux kernel ignores partition type codes. So do many Linux utilities. Linux partitioning tools support them because they're part of partition table data structures and because some other OSes use type codes as a filter, so it's important that the Linux codes be right in a dual-boot environment. Linux installation programs also often use type codes in a similar way.