Format a disk on Ubuntu command line

Make sure you have cfdisk installed:
sudo apt-get update
sudo apt-get install cfdisk

Please note: this will erase your disk!

Also note: your old data will be still readable after this. The data is not totally destroyed! If you want to make sure the data is destroyed, you have to shred the disk.

Connect your drive if it is not connected. See the dmesg command to see which device it was attached to:
dmesg

This will show you for example messages about "sdd"

Then use cfdisk to partition your disk:
sudo cfdisk /dev/sdd

Use the simple cfdisk interface to:
  • Delete the old partition
  • Make a new partition with type 83 "Linux"
  • Write the partition table
  • Quit

After that, you need to create a file system on the disk.
sudo mkfs.ext4 /dev/sdd1

This would create partition 1 on the disk /dev/sdd.

Comments

Popular posts from this blog

How to install and play Curse of Monkey Island on Android

How to get rid of coil whine just by tweaking BIOS

How to fix the weird audio bug in Kingdom Come: Deliverance

How to find the ScummVM game folder on Android

How to fix the Anno 1404 out of memory error

Fix for Focusrite Scarlett blue screens on Windows 10