3

I have a 1TB external USB drive plugged into my Raspberry Pi 4 running Ubuntu Server LTS. I was attempting to partition, format and mount the drive. My plan is to ultimately use it to store PostgreSql databases on it.

Here are the steps I was taking:

sudo fdisk -l (to list the drives and get the name)
sudo fdisk /dev/sda (to run fdisk on the drive)
g (to create a new empty GPT partition table)
n (to add a new partition, with all defaults)
w (to write the table to disk and exit)

Next I wanted to create a filesystem on the partition to format it:

sudo mkfs.ext4 /dev/sda1

I keep getting the message:

Found a dos partition table in /dev/sda1
Proceed anyway? (y,N)

How come I am getting this message and what does it mean? I chose to add a gpt partition table when using fdisk, not dos. Maybe when I was learning about all of this earlier I might have made a mistake? If this is the case how can I completely wipe the drive to unpartitioned space and start from square one?

  • 1
    https://unix.stackexchange.com/a/394999/30851 – frostschutz Feb 05 '21 at 22:23
  • 2
    To elaborate on frostschutz's (correct) pointer: mkfs.ext4 isn't warning you that you have a dos partition in use, it's warning you that it has found one inside the space where you want to put your filesystem, you're about to obliterate it, and asking if you're sure. dos and GPT partition information is kept in different places, and typically writing a partition table doesn't disturb any of the data already elsewhere on the device. So you are seeing an artefact of some previous use of this device. – grifferz Feb 05 '21 at 22:51
  • @grifferz so you are saying don’t worry about getting rid of the message? I will try all of the wiping from the link above anyway. Also, maybe it means the OS that is mounted on the SD card is using DOS and is asking if I am sure because there is a mismatch between the OS file system and this disk. Or is it strictly in the realm of the disk I specify when calling mkfs? – Blake Rivell Feb 05 '21 at 23:48
  • I think that you are over-thinking this. All that the message means is that the span of storage you are about to create an ext4 filesystem on, has something already on it that resembles a dos partition table. If you don't care what was on the SD card (and it seems like you don't, since you already created a GPT on it) I don't see why you would care that this section of it used to have a dos partition table there. If you do care what was on the SD card before, you have more problems than this because you said you already created a GPT on it, which will have corrupted what was on it already. – grifferz Feb 05 '21 at 23:53
  • @grifferz I don't care what was on it. It is a brand new 1TB SSD. I was playing around with practicing creating paritions, formating, and mouting with all of the different linux tools available. I was thinking the DOS message was coming from my tests and I have a bit of OCD so I want to start from a completely clean slate with no traces of me doing anything. I assume the wipe commands are the best I can try. – Blake Rivell Feb 06 '21 at 00:16
  • You can do wipefs if you want, certainly. Or you can just not care and press y. The end result will be no different. – grifferz Feb 06 '21 at 00:19

0 Answers0