How can I find out if there's already a partition on my storage device in Ubuntu?

 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.


Name

false
ltr
static_page
Tech Lab: How can I find out if there's already a partition on my storage device in Ubuntu?
How can I find out if there's already a partition on my storage device in Ubuntu?
Tech Lab
https://techlab.connektiv8.com/p/how-can-i-find-out-if-theres-already.html
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/p/how-can-i-find-out-if-theres-already.html
true
5093225316588518036
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network