Sample Header Ad - 728x90

Does gdisk partition and format it with xfs?

0 votes
1 answer
1712 views
Using CentOS 8.5 I tried this on a new disk with no data or partition tables.
[root@workstation ~]# gdisk /dev/nvme0n7
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-4194270, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-4194270, default = 4194270) or {+-}size{KMGTP}: +500M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/nvme0n7.
The operation has completed successfully.
[root@workstation ~]# 
[root@workstation ~]# lsblk -fp
NAME                    FSTYPE      LABEL UUID                                   MOUNTPOINT
/dev/sr0                                                                         
/dev/nvme0n1                                                                     
├─/dev/nvme0n1p1        xfs               c932c155-e3a9-4852-aad1-d545778b46c6   /boot
└─/dev/nvme0n1p2        LVM2_member       KwN1Pf-Jf3R-l7HW-Qed3-DLSl-olMr-rVdD3n 
  ├─/dev/mapper/cl-root xfs               e6d63656-cd58-40a8-aadf-b0416e36c8d4   /
  ├─/dev/mapper/cl-swap swap              3b26e208-9846-4c20-8b90-60bb0ce68869   [SWAP]
  └─/dev/mapper/cl-home xfs               7cb2b8a0-fe6b-4c6c-9d8f-124780be79c9   /home
/dev/nvme0n2                                                                     
/dev/nvme0n3                                                                     
/dev/nvme0n4                                                                     
/dev/nvme0n5                                                                     
/dev/nvme0n6                                                                     
/dev/nvme0n7                                                                     
└─/dev/nvme0n7p1        xfs               25552944-4b61-44d6-a1bd-ca0ae3cfc89f   
/dev/nvme0n8                                                                     
/dev/nvme0n9                                                                     
[root@workstation ~]#
As you can see, the partition already has xfs filesystem created on it. I thought I have to use mkfs.xfs after using fdisk or gdisk.
Asked by Cruise5 (546 rep)
Jan 30, 2022, 04:42 AM
Last activity: Jan 31, 2022, 04:15 PM