Linux Labs

Storage / Stage 4 of 11

Partition, filesystem, mount

Not running Starting usually ~20 s
Leave the lesson

Step 3 of 7 · on a machine · 5 min

The filesystem and its label

Here is how to create ext4 on the partition and which names will find it later.

mkfs.ext4 creates the filesystem: it writes the ext4 structures — the superblock, the inode table, the journal — to the partition. Whatever was on the partition before becomes unreachable, so mkfs is run only on a new or unwanted partition.

The -L option gives the filesystem a label, a short name for people: data, logs, backup. The label shows up in lsblk -f and blkid. Besides the label, the filesystem gets a UUID when it is created. Running mkfs again on the same partition gives a new UUID.

For a partition, blkid prints the fields of two owners on one line:

Fields Whose
LABEL, UUID, TYPE the filesystem's: mkfs wrote them
PARTLABEL, PARTUUID the partition's in the GPT table: mkpart data wrote PARTLABEL="data"
Exercise · do it

Create a filesystem and mount the partition

Create an ext4 filesystem labelled data on the partition /dev/loop0p1, look up its UUID and mount the partition at /srv/data.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Create a labelled ext4 on the partition not done yet
  • Mount the partition at /srv/data not done yet

Step goals

0 of 2
  • Create a labelled ext4 on the partition — not done yet
  • Mount the partition at /srv/data — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Create a labelled ext4 on the partition — not done yet
  • Mount the partition at /srv/data — not done yet
Loading…