Linux Partitioning: Difference between revisions

From Dave-Wiki
No edit summary
Line 15: Line 15:
===Create a new partition table===
===Create a new partition table===


If needed.
''If needed.''


  (parted) mklabel gpt
  (parted) mklabel gpt

Revision as of 22:57, 20 January 2025

Partition and Format a New Disk

List partition layout on all block devices

parted -l

Open parted on the block device you want to modify

parted /dev/sdb

View partition table for block device specified above

(parted) print

Create a new partition table

If needed.

(parted) mklabel gpt

Make new XFS partition filling up entire block device

(parted) mkpart hdd xfs 0% 100%

Make a new filesystem on the new partition

mkfs.xfs /dev/sdb1

Find UUID of a partition

lsblk -f

Mount a partition at boot

Edit your /etc/fstab to add a line like the following:

UUID=5b433ecf-875a-4282-a876-47073fc3a207 /mnt/hdd xfs defaults 0 0