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
Post a Comment