creating an partition / formatting hd


Forum: Programming and Scripting
Topic: creating an partition / formatting hd
started by: A jerk

Posted by A jerk on Oct. 12 2005,04:19
Can anyone tell me what is the *format* command in the terminal if i want to format a drive?

and also. how can i create partitions in my harddrive from my terminal?

any help is appreciated.

thanks.

Posted by cbagger01 on Oct. 12 2005,22:17
You need to be superuser or "root" user in order to format or manage partitions:

sudo su


To edit partitions for a drive:

cfdisk /dev/hda

(where hda = primary master IDE drive, hdb=primary slave, hdc=secondary master, etc)

To format partition 1 for this drive with linux EXT2 filesystem:

mkfs -t ext2 /dev/hda1


Or to format a Linux swap partition for #2:

mkswap /dev/hda2

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.