Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



FDISK
( Partition table manipulator for Linux )


Here is another command from the list "File System Commands"  With fdisk we can get info on partitions and make new ones or delete them.
I took the info from a post made by Owyn.


Info about partitions:

CODE
# fdisk -l /dev/hda


Deleting partitions:

CODE
$ su
# fdisk /dev/hda

1). List the partitions and make sure you are on hda
Press "p"

2). Delete all the existing partitions on hda starting with partition 4 and working back to partition 1
Press "d"
Enter partition number when requested.

3). List the partitions again to make sure the problem is fixed.
Press "p"

4). Write table to disk and exit
Press "w"

And then run "fdisk -l /dev/hda" again to see the results.
Here is a full list of the commands you can use in fdisk:

QUOTE (Menu @ Screen)
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)


Erase the complete harddrive:

CODE
$ su
# dd if=/dev/zero of=/dev/hda bs=1024 count=10


CAUTION: MAKE SURE YOU ARE WORKING ON THE CORRECT HD !!!!

More on fdisk: http://www.justlinux.com/nhf/Installation/Using_fdisk.html


Bruno


-- Mar 17 2004 ( Revised Dec 12 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email