It's always a bit scary when formatting a disk in any operating system and especially more-so if you're not familiar with the commands of a Linux or Ubuntu system.
Don't worry too much, if there's a filesystem already on an existing storage medium, chances are that one of two methods can tell you whether there's an existing partition on your drive.
The easiest way is to simply run lsblk to see if there's partition information on your drive:
The other way is to attempt to create a new filesystem partition using mkfs.ext4 on the device you want to access, that is, if you want to create an ext4 filesystem. I will assume this is the case given that most Ubuntu users will use this format, though of course there's an entire book that could be written on different filesystem formats, pros and cons and best practices in uses different file formats for different purposes.
Anyway, don't worry too much about the creation process and potentially overwriting existing data when commencing with creation of a new partition where there may already be one!
There is a safe-guard message before proceeding if any existing partition already resides on the device you're attempting to partition, as follows:
Example: Here I decided to make a new ext4 file partition on a virtual drive, /dev/vdb, though unfortunately there's already a partition on the drive, as can be seen from the following message:
"Found a gpt partition table in /dev/vdb"
that then asks whether to proceed anyway.
In most cases, if you want the data on that drive, you'll either need to back out of the process by pressing "N" and <Enter>, then mount the existing partition to back it up before proceeding, or if you do indeed want to overwrite your existing partition to format it with a new partition you can simply proceed and overwrite the existing one.
Anyway, this gives you a little insight into how to tell whether there's already an existing partition on your storage device in Ubuntu.
Discussion