Got an ATA hard drive hooked to an external USB package and need to reformat the disk to ext3 system.
First, I run fdisk to see what content it has
fdisk -l /dev/sda1
Then, I re-partition it using
fdisk /dev/sda1
select option d to delete the old partion,
and then option n to add a new partition, where I choose the primary partition instead of the extended one. There will be complaint about it’s too large, but since this disk is not going to be used as a boot disk, so I don’t care
Next, I create the ext3 file system on the partition
/sbin/mkfs -t ext3 /dev/sda1
After it’s done, I can mount it to my Linux system
mount /dev/sda1 /disk3
Optionally, I can change the percentage of reserved blocks using tune2fs, e.g., from the default 5% to 3%
tune2fs -m3 /dev/sda