If you have worked with Linux disks, you have seen device names like /dev/sda1. They work fine until you add or remove a disk — then the names can shift, breaking your mount points and scripts. UUIDs solve this because they are permanent and tied to the filesystem itself.
Instead of writing /dev/sda1 in fstab, use the UUID:
UUID=65b14742-9610-4289-8ea4-af8edcc5d8da /media/data ext4 defaults 0 2
There are a few ways to find the UUID of a partition:
sudo vol_id -u /dev/sda2
sudo blkid
ls -l /dev/disk/by-uuid/
On older systems vol_id was the standard tool, while blkid is the modern equivalent available on virtually all current distributions. You can also see the PARTUUID with blkid, which identifies the partition table entry rather than the filesystem — this is useful for booting with UEFI.
If UUIDs feel unwieldy, you can label a filesystem and use the label instead:
sudo e2label /dev/sda1 mydata
LABEL=mydata /media/data ext4 defaults 0 2
Labels are easier to read but not guaranteed to be unique. UUIDs are the safer choice for production systems.
Hope it works!