Fdisk Command Tips

Fdisk is a partition table manipulator for Linux. Fdisk displays information about disk partitions, creates and deletes disk partitions, and changes the active partition. It is possible to assign a different operating system to each of the four possible primary partitions, though only one partition is active at any given time. You can also divide a physical partition into several logical partitions.

Usage
The basic fdisk commands you need are:
# a Toggle a bootable flag on current partition.

# b Edit disklabel of a BSD partition.

#c Toggle DOS compatibility flag.

#d Delete current partition.

# l List all partition types.

# m Main menu.

# n Create a new partition; prompt for more information.

# o Create an empty DOS partition table.

# p Print a list of all partitions and information about each.

# q Quit; do not save.

# t Replace the type of the current partition.

# u Modify the display/entry units, which must be cylinders or sectors.

# v Verify: check for errors, and display a summary of the number of unallocated sectors.

# w Save changes and exit.

# x Switch to expert commands.

Example
To list all partitions currently on the system:
$ fdisk -l

I start fdisk from the shell prompt:
$ fdisk /dev/sdb

Command (m for help): p
(p to print all partition)

Command (m for help): d
(d to delete partitions)
Partition number (1-4): 1

Command (m for help): n
(n to add partition)
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1

Command (m for help): w
(w to write the table on the disk)

jonboy60

I’m a Malaysian, my name is Jon Loh (jonboy60) living in Kuala Lumpur and working in Petaling Jaya, Malaysia. Jonboy60.com is a blog magazine about Linux and other open source softwares. All about to a daily jobs or real life experiences I had since the year 2002 administrating Linux and Windows server in a hosting company. Basically i will be offering Linux tips, howto, tricks, latest news and tutorial. Contact Me for Career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting and expertise requests. Email to me on jonboy60{@}gmail.com. The site I’m running is VenCouture.com – Malaysia Online Fashion Shopping Boutique, VenCouture. We sell fashion clothes, sexy lingeries, baby clothing and etc.

More PostsWebsite

Follow Me:
TwitterFacebook

2 thoughts on “Fdisk Command Tips

  1. Pingback: Quick RAID0 and Drive Encryption on CentOS command line How To. | Linux Admins

  2. Pingback: Cara Menambah dan mengecilkan ukuran Partisi Harddisk

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*


8 − 1 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge