Get UUID of a mounted partition
I've been looking for it so I thought that this time it'd be a good idea to post it as a tip for future reference, both for myself and others.
Sometimes when you manually mount a new partition in operating systems and distributions that use UUIDs in /etc/fstab to mount partitions on boot you would want to get the UUID of the newly mounted partition so that you can add it in /etc/fstab for mounting at boot so you don't have to do it all the time manually.
So, it's simple. The
blkid command will list some of the devices (partitions) with their UUIDs, but it seems it only lists those already included in fstab. Therefore even more useful should be
ls -l /dev/disk/by-uuid/ which will list all currently mounted partitions with their UUIDs, including those not in /etc/fstab, which is exactly what we need.
Hopefully this will be useful to someone.