Format Drive Ubuntu Command Line

1) To check which drive your would like to work on type
sudo fdisk -l

this give you a list of drives and their partitions
2) Initiate the disk you want to work with using
sudo fdisk /dev/sdb

fdisk will display a menu like so and press m for help
Command (m for help): m [enter]
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)


3) press "n" for a new partiotion and chose primary

4) Now that the partition is entered, choose option "w" to write the partition table to the disk. Type "w" and enter.

5) To format with ext3 use
sudo mkfs -t ext3 /dev/sdb1


6) or to format with FAT32 use
sudo mkfs -t fat32 /dev/sdb1


=)

Comments

Popular Posts