Gparted
In most cases it would work to use the graphical program gparted
. It is available in Ubuntu live (booted from USB or DVD), and it can be installed in installed systems,
sudo apt install gparted
Start gparted
Prepare by unmounting and swapping off all partitions on the drive and (you see lock symbols at mounted partitions and swapped on swap partitions).
The next step would be to select the dropdown menu
Device - Create partition table
to create a new partition table (GPT is the new partition table and MSDOS is the old partition table).
Now you can use the graphical interface or the dropdown menus to create partitions.
Wipe the first mibibyte
If gparted
does not work, you can wipe the first mibibyte to remove data, that might cause confusion. You can use mkusb
for this purpose.
help.ubuntu.com/community/mkusb
help.ubuntu.com/community/mkusb/wipe
and after that gparted
should work.
Check the S.M.A.R.T. status
If there are still problems we can suspect that the drive is physically damaged, and you should check the S.M.A.R.T. status with Disks alias gnome-disks
. See this link,
FSCK reports that filesystem still has errors - what should I do now?
Select file system
Depending on where and how you want the drive to work, you should select different file systems. If you want it to work easily 'everywhere' you can have a FAT32 file system, but then the maximum file size is 4 GB. If you want to manage bigger files, you should select another file system, for example NTFS or exFAT or UDF.
See the following link with detailed descriptions of how to select and create these alternative file systems.
How do I copy a file larger than 4GB to a USB flash drive?