Why are file systems created with mkfs
not immediately available after creation?
The following command line probably best describes what I'm seeing:
/sbin/mkfs.ext4 /dev/sdc && lsblk -o uuid --noheadings /dev/sdc
First I'm creating an ext4 filesystem on /dev/sdc
and then I'm trying to immediately show the UUID of that filesystem.
This is the corresponding output of those commands:
mke2fs 1.44.1 (24-Mar-2018)
/dev/sdc contains a ext4 file system
created on Wed Oct 5 00:40:08 2022
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 268435456 4k blocks and 67108864 inodes
Filesystem UUID: d54169aa-faab-49b5-b0fd-fdf98b603df0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
434269b5-59e4-4fd0-95f0-376090e0e0a9
You'll notice that "Filesystem UUID" from the mkfs.ext4
output does not match the output of lsblk
shown at the end of the output.
However, if I rerun lsblk -o uuid --noheadings /dev/sdc
a little bit later, I get:
d54169aa-faab-49b5-b0fd-fdf98b603df0
And that does match the mkfs.ext4
output. Why the delay?