LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to use Fdisk ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-use-fdisk-880485/)

gardenair 05-13-2011 04:29 AM

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

acid_kewpie 05-13-2011 04:38 AM

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.

John VV 05-13-2011 02:38 PM

see
Code:

man fdisk
or Google "fdisk"
the manual pages are also on line

szboardstretcher 05-13-2011 02:40 PM

Generally, after installation of an OS, you will only have to use fdisk if you add additional storage/drives to break them into partitions.

frankbell 05-13-2011 09:39 PM

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

GParted is a GUI partition editor.

dimpleboy 05-13-2011 09:56 PM

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.

Wim Sturkenboom 05-14-2011 03:32 AM

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.


All times are GMT -5. The time now is 02:53 AM.