LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2011, 05:29 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
How to use Fdisk ?


hi,
I have knowledge to make partitions unders windows using fdisk. In Red Hat there is also a fdisk command but how can I use it? In which situations we use linux fdisk ?
thanks
garden
 
Old 05-13-2011, 05:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
fdisk is a tool for partition management, so you use it when you need to manage partitions. You can learn how to use it by read the manpage or other online resources.
 
Old 05-13-2011, 03:38 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,822

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
see
Code:
man fdisk
or Google "fdisk"
the manual pages are also on line
 
Old 05-13-2011, 03:40 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,788
Blog Entries: 1

Rep: Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340Reputation: 1340
Generally, after installation of an OS, you will only have to use fdisk if you add additional storage/drives to break them into partitions.
 
Old 05-13-2011, 10:39 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,346
Blog Entries: 12

Rep: Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731
cfdisk is a little easier; I prefer it to fdisk when it's available.

GParted is a GUI partition editor.
 
Old 05-13-2011, 10:56 PM   #6
dimpleboy
LQ Newbie
 
Registered: May 2011
Location: quezon city, philippines
Posts: 13

Rep: Reputation: 0
you can try fdisk -options /dev/sda or whatever device present on your machine. then provide the value for the corresponding prompt. you can check available options by man fdisk.
 
Old 05-14-2011, 04:32 AM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
listing drives and partitions (in this case the second HD)
Code:
wim@desktop-01:~$ sudo fdisk -l
[sudo] password for wim: 

Disk /dev/sda: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2e192e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        3264    26218048+   7  HPFS/NTFS
/dev/sda2            3265       29422   210109825+   f  W95 Ext'd (LBA)
/dev/sda5            3265        7180    31455238+   7  HPFS/NTFS
/dev/sda6            7181       10444    26218048+   b  W95 FAT32
/dev/sda7           10445       13708    26218048+  83  Linux
/dev/sda8           13709       14229     4179968   82  Linux swap / Solaris
/dev/sda9           14229       29422   122037248   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3c8c2717

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121601   976760001   83  Linux
wim@desktop-01:~$
partitioning a disk
Code:
wim@desktop-01:~$ sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
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)

Command (m for help):
PS
I'm using ubuntu, hence the sudo in front of commands to get root privileges.

Last edited by Wim Sturkenboom; 05-14-2011 at 04:34 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
understadning /dev/dm-02 mapping and fdisk -l or fdisk -l | less mixxmaster27 Linux - Newbie 2 06-03-2010 01:17 PM
Replacing fdisk with gnu fdisk in busybox? Alkisx Slackware 5 10-23-2009 12:51 PM
fdisk Jmcatch742 Linux - Newbie 10 08-17-2009 02:11 PM
weird fdisk problem (Fdisk unable to see winxp partitions) khidot Slackware - Installation 5 04-07-2007 10:26 PM
Help Using Fdisk Dannydy Linux - Hardware 3 07-20-2004 10:26 AM


All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration