I am trying to mount a disk using ansible automatically using the following command:
fdisk -l | grep "64G" | grep -Eo "/dev/sd."
This outputs /dev/sda1
and I am adding that to the /etc/fstab/
. But I want to add the UUID instead.
Is there a method to fetch the UUID by passing the size of the disk?
(I have only 1 disk attached with 64G of size so it returns only one output, want to know how to fetch the UUID instead of /dev/sda
)