How to mount a device of gpt type?

5,350

Solution 1

For the solution to this problem, there are some information in various tutorials. The following steps are prerequisite towards making the new SSD usable:

1. Partition

2. Create a File System and Format

3. Mount

Number of partitions, into which the SSD is divided, is optional. In this problem, it is inteded to divide it into a big single partition. Also, the file system type has been chosen as ext4. You can use either extensions of ext if you are going to use this partition only in Linux. The referrence to the complete (graphically or through the command line) solution with the commands for each step is made here:

Installing a New Storage Drive

Solution 2

First let's reach to the the description of the first three fields of fstab format, from man fstab:

The following is a typical example of an fstab entry:

LABEL=t-home2 /home ext4 defaults,auto_da_alloc 0 2

The first field (fs_spec). This field describes the block special device or remote filesystem to be mounted.

The second field (fs_file). This field describes the mount point (target) for the filesystem

The third field (fs_vfstype). This field describes the type of the filesystem. Linux supports many filesystem types: ext4, xfs, btrfs, f2fs, vfat, ntfs, hfsplus, tmpfs, sysfs, proc, iso9660, udf, squashfs, nfs, cifs, and many more. For more details, see mount(8).

The first parameter is device identification, it can be either UUID= or /dev/nvme0n1 (or whatever else device name is reported by blkid or lsblk utilities).

The second parameter is the mount point, i.e. where you want the mounted filesystem to appear in your local filesystem, for example /mnt/mydisk, assuming you have created such a directory and it is entirely empty.

Finally, gpt is not a type of filesystem, and that's what is expected in this field. In the context of fdisk and gdisk utilities, gpt is the partitioning scheme applied to divide the whole of the disk into partitions. This partitioning scheme corresponds to the type of partition table, residing in a (relatively) small block of data, around 1MB, starting at the zero position of the /dev/nvme0 (note, no n1 suffix) device. The actual filesystem is what resides in the n1 partition (just past the partition table), and it will typically have one of the types listed my man fstab

You can use this command sudo fsck -N /dev/nvme0n1 to tell you the filesystem to put there. More specifically this command will tell you which "flavour" of fsck command recognized this filesystem (this way telling you its type, in an roundabout way, e.g. if the filesystem was recognized by fsck.ext4 that means you can put ext4 there)

Share:
5,350

Related videos on Youtube

Arghavan Mohammadhassani
Author by

Arghavan Mohammadhassani

A M. Sc. Student in the Field of Computer Engineering.

Updated on September 18, 2022

Comments

  • Arghavan Mohammadhassani
    Arghavan Mohammadhassani over 1 year

    In Linux Mint 18.3 which boots from an HDD, I want to mount an external SSD.

    When I run the command sudo fdisk -l, I get all the drives and partitions as well as the SSD and when I run sudo blkid, I get the type and UUID of each of them. I know that gpt and mbr are the partition scheme for storage drives and ext4 or other extension of ext are the file system types in linux . However, the type for ssd is mentioned as gpt in the results from the aforementioned commands.

    I tried to mount the SSD by editing the fstab file in /etc/fstab and adding this line ( I set the mount point as /media/ssd-mountpoint ) :

    uuid=<the uuid I got from blkid command> /media/ssd-mountpoint gpt defaults 0 2

    After using mount -a, however I get the error "the gpt type is unknown".

    How can solve this to mount the ssd with gpt type? Should I convert this format?

    • Fitz
      Fitz about 5 years
      gpt is a partition type (vs dos ), and not a file system. Can you share the full out put of fdisk -l /dev/nvme0n1 ? IS this a new disk, or have you used it before on other systems. nvme01n1 is the full disk, if it has been partitioned, and formatted there should be a /dev/nvme01n1p1 as well.
    • text
      text about 5 years
      On GPT disks isn't the command to use parted and not fdisk?
    • Fitz
      Fitz about 5 years
      recent versions of fdisk do support gpt, but yes parted might be better to use. I'm not sure what version of fdisk comes with mint 18.3
    • Arghavan Mohammadhassani
      Arghavan Mohammadhassani about 5 years
      @Fitz very good point, thanks. But If I am not making a mistake, I think I need to first mount and then partition. Also, I don't want to divide it into several partitions because I need the whole space as just a single partition.
    • Arghavan Mohammadhassani
      Arghavan Mohammadhassani about 5 years
      Mint 18.3 is based on ubuntu 16.04. If I run the fdisk command or the blkid without sudo, I cannot see the drive for ssd. However, if i add sudo to either of these commands, /dev/nvme0n1 and its further features appear.
    • Arghavan Mohammadhassani
      Arghavan Mohammadhassani about 5 years
      Thanks a lot. Can you help me with the commands to do each step? Or a tutorial for this?
    • Haxiel
      Haxiel about 5 years
      @ArghavanM.hasani Here are a few for Ubuntu Linux, which should work for Mint Linux as well: InstallingANewHardDrive, How do I add an additional hard drive?, Partitioning, Formatting, and Mounting a Hard Drive in Linux Ubuntu 18.04.
    • Arghavan Mohammadhassani
      Arghavan Mohammadhassani about 5 years
      @Haxiel Thanks for the complete solutions. I just posted the first one as the solution.
  • Arghavan Mohammadhassani
    Arghavan Mohammadhassani about 5 years
    I editted my question and fixed my mistakes. I know that gpt is not the file system type but I should change it so that when I run the blkid or fdisk command again, the type is shown as a filesystem one not gpt. Does fsck command just report the suitable file system type? How can I convert the type to ext4 then?