SlideShare a Scribd company logo
1 of 11
Download to read offline
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                     hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/




                            Home
                            About
                            Free	
  eBook
                            Archives
                            Best	
  of	
  the	
  Blog
                            Contact


                7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  Par;;on
                by	
  Balakrishnan	
  Mariyappan	
  on	
  September	
  14,	
  2010

                               1                        Like    4               Tweet         10




                                                                                                       On	
  Linux	
  distribuFons,	
  fdisk	
  is	
  the	
  best	
  tool	
  to	
  manage	
  disk	
  parFFons.	
  fdisk	
  is	
  a
                text	
  based	
  uFlity.

                Using	
  fdisk	
  you	
  can	
  create	
  a	
  new	
  parFFon,	
  delete	
  an	
  exisFng	
  parFFon,	
  or	
  change	
  exisFng	
  parFFon.

                Using	
  fidsk	
  you	
  are	
  allowed	
  to	
  create	
  a	
  maximum	
  of	
  four	
  primary	
  parFFon,	
  and	
  any	
  number	
  of	
  logical	
  parFFons,	
  based	
  on	
  the	
  size	
  of	
  the
                disk.




1	
  of	
  11                                                                                                                                                                                                      18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                     hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                Keep	
  in	
  mind	
  that	
  any	
  single	
  parFFon	
  requires	
  a	
  minimum	
  size	
  of	
  40MB.


                In	
  this	
  arFcle,	
  let	
  us	
  review	
  how	
  to	
  use	
  fdisk	
  command	
  using	
  pracFcal	
  examples.

                Warning:	
  Don’t	
  delete,	
  modify,	
  or	
  add	
  parFFon,	
  if	
  you	
  don’t	
  know	
  what	
  you	
  are	
  doing.	
  You	
  will	
  lose	
  your	
  data!

                1.	
  View	
  All	
  Exis;ng	
  Disk	
  Par;;ons	
  Using	
  fdisk	
  -­‐l

                Before	
  you	
  create	
  a	
  new	
  parFFon,	
  or	
  modify	
  an	
  exisFng	
  parFFon,	
  you	
  might	
  want	
  to	
  view	
  all	
  available	
  parFFon	
  in	
  the	
  system.

                Use	
  fdisk	
  -­‐l	
  to	
  view	
  all	
  available	
  parFFons	
  as	
  shown	
  below.

                # fdisk -l

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                                    Start                            End                 Blocks                 Id        System
                /dev/sda1                                             1                           1959               15735636                  c        W95 FAT32 (LBA)
                /dev/sda2                                          1960                           5283               26700030                  f        W95 Ext'd (LBA)
                /dev/sda3                                          5284                           6528               10000462+                 7        HPFS/NTFS
                /dev/sda4                                          6529                           9729               25712032+                 c        W95 FAT32 (LBA)
                /dev/sda5   *                                      1960                           2661                5638752                 83        Linux
                /dev/sda6                                          2662                           2904                1951866                 83        Linux
                /dev/sda7                                          2905                           3147                1951866                 83        Linux
                /dev/sda8                                          3148                           3264                 939771                 82        Linux swap / Solaris
                /dev/sda9                                          3265                           5283               16217586                  b        W95 FAT32

                The	
  above	
  will	
  list	
  parFFons	
  from	
  all	
  the	
  connected	
  hard	
  disks.	
  When	
  you	
  have	
  more	
  than	
  one	
  disk	
  on	
  the	
  system,	
  the	
  parFFons	
  list	
  are
                ordered	
  by	
  the	
  device’s	
  /dev	
  name.	
  For	
  example,	
  /dev/sda,	
  /dev/sdb,	
  /dev/sdc	
  and	
  so	
  on.

                2.	
  View	
  Par;;ons	
  of	
  a	
  Specific	
  Hard	
  Disk	
  using	
  fdisk	
  -­‐l	
  /dev/sd{a}

                To	
  view	
  all	
  parFFons	
  of	
  the	
  /dev/sda	
  hard	
  disk,	
  do	
  the	
  following.

                # fdisk -l /dev/sda

                View	
  all	
  fdisk	
  Commands	
  Using	
  fdisk	
  Command	
  m

                Use	
  fdisk	
  command	
  m,	
  to	
  view	
  all	
  available	
  fdisk	
  commands	
  as	
  shown	
  below.

                # fdisk               /dev/sda

                The number of cylinders for this disk is set to 9729.
                There is nothing wrong with that, but this is larger than 1024,
                and could in certain setups cause problems with:
                1) software that runs at boot time (e.g., old versions of LILO)
                2) booting and partitioning software from other OSs
                   (e.g., DOS FDISK, OS/2 FDISK)

                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



2	
  of	
  11                                                                                                                                                                                                    18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                            hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                      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)

                3.	
  Delete	
  a	
  Hard	
  Disk	
  Par;;on	
  Using	
  fdisk	
  Command	
  d

                Let	
  us	
  assume	
  that	
  you	
  like	
  to	
  combine	
  several	
  parFFons	
  (for	
  example,	
  /dev/sda6,	
  /dev/sda7	
  and	
  /dev/sda8)	
  into	
  a	
  single	
  disk	
  parFFon.
                To	
  do	
  this,	
  you	
  should	
  first	
  delete	
  all	
  those	
  individual	
  parFFons,	
  as	
  shown	
  below.

                # fdisk /dev/sda

                The number of cylinders for this disk is set to 9729.
                There is nothing wrong with that, but this is larger than 1024,
                and could in certain setups cause problems with:
                1) software that runs at boot time (e.g., old versions of LILO)
                2) booting and partitioning software from other OSs
                   (e.g., DOS FDISK, OS/2 FDISK)

                Command (m for help): p

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                               Start                          End                Blocks                 Id        System
                /dev/sda1                                        1                         1959              15735636                  c        W95 FAT32 (LBA)
                /dev/sda2                                     1960                         5283              26700030                  f        W95 Ext'd (LBA)
                /dev/sda3                                     5284                         6528              10000462+                 7        HPFS/NTFS
                /dev/sda4                                     6529                         9729              25712032+                 c        W95 FAT32 (LBA)
                /dev/sda5   *                                 1960                         2661               5638752                 83        Linux
                /dev/sda6                                     2662                         2904               1951866                 83        Linux
                /dev/sda7                                     2905                         3147               1951866                 83        Linux
                /dev/sda8                                     3148                         3264                939771                 82        Linux swap / Solaris
                /dev/sda9                                     3265                         5283              16217586                  b        W95 FAT32

                Command (m for help): d
                Partition number (1-9): 8

                Command (m for help): d
                Partition number (1-8): 7

                Command (m for help): d
                Partition number (1-7): 6

                Command (m for help): w
                The partition table has been altered!

                Calling ioctl() to re-read partition table.

                WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
                The kernel still uses the old table. The new table will be used at



3	
  of	
  11                                                                                                                                                                                         18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                        hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                the next reboot or after you run partprobe(8) or kpartx(8)
                Syncing disks.

                4.	
  Create	
  a	
  New	
  Disk	
  Par;;on	
  with	
  Specific	
  Size	
  Using	
  fdisk	
  Command	
  n

                Once	
  you’ve	
  deleted	
  all	
  the	
  exisFng	
  parFFons,	
  you	
  can	
  create	
  a	
  new	
  parFFon	
  using	
  all	
  available	
  space	
  as	
  shown	
  below.

                # fdisk                /dev/sda

                The number of cylinders for this disk is set to 9729.
                There is nothing wrong with that, but this is larger than 1024,
                and could in certain setups cause problems with:
                1) software that runs at boot time (e.g., old versions of LILO)
                2) booting and partitioning software from other OSs
                   (e.g., DOS FDISK, OS/2 FDISK)

                Command (m for help): n
                First cylinder (2662-5283, default 2662):
                Using default value 2662
                Last cylinder, +cylinders or +size{K,M,G} (2662-3264, default 3264):
                Using default value 3264

                In	
  the	
  above	
  example,	
  fdisk	
  n	
  command	
  is	
  used	
  to	
  create	
  new	
  parFFon	
  with	
  the	
  specific	
  size.	
  While	
  creaFng	
  a	
  new	
  parFFon,	
  it	
  expects
                following	
  two	
  inputs.

                             StarFng	
  cylinder	
  number	
  of	
  the	
  parFFon	
  to	
  be	
  create	
  (First	
  cylinder).
                             Size	
  of	
  the	
  parFFon	
  (or)	
  the	
  last	
  cylinder	
  number	
  (Last	
  cylinder,	
  +cylinders	
  or	
  +size	
  ).

                Please	
  keep	
  in	
  mind	
  that	
  you	
  should	
  issue	
  the	
  fdisk	
  write	
  command	
  (w)	
  ader	
  any	
  modificaFons.

                Command (m for help): w
                The partition table has been altered!

                Calling ioctl() to re-read partition table.

                WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
                The kernel still uses the old table. The new table will be used at
                the next reboot or after you run partprobe(8) or kpartx(8)
                Syncing disks.

                Ader	
  the	
  parFFon	
  is	
  created,	
  format	
  it	
  using	
  the	
  mkfs	
  command	
  as	
  shown	
  below.

                # mkfs.ext3 /dev/sda7

                5.	
  View	
  the	
  Size	
  of	
  an	
  exis;ng	
  Par;;on	
  Using	
  fdisk	
  -­‐s

                As	
  shown	
  below,	
  fdisk	
  -­‐s	
  displays	
  the	
  size	
  of	
  the	
  parFFon	
  in	
  blocks.

                # fdisk -s /dev/sda7
                4843566

                The	
  above	
  output	
  corresponds	
  to	
  about	
  4900MB.

                6.	
  Toggle	
  the	
  Boot	
  Flag	
  of	
  a	
  Par;;on	
  Using	
  fdisk	
  Command	
  a

                Fdisk	
  command	
  displays	
  the	
  boot	
  flag	
  of	
  each	
  parFFon.	
  When	
  you	
  want	
  to	
  disable	
  or	
  enable	
  the	
  boot	
  flag	
  on	
  the	
  corresponding
                parFFon,	
  do	
  the	
  following.

                If	
  you	
  don’t	
  know	
  why	
  are	
  you	
  are	
  doing	
  this,	
  you’ll	
  mess-­‐up	
  your	
  system.




4	
  of	
  11                                                                                                                                                                                                18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                   hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                # fdisk /dev/sda

                The number of cylinders for this disk is set to 9729.
                There is nothing wrong with that, but this is larger than 1024,
                and could in certain setups cause problems with:
                1) software that runs at boot time (e.g., old versions of LILO)
                2) booting and partitioning software from other OSs
                   (e.g., DOS FDISK, OS/2 FDISK)

                Command (m for help): p

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                                  Start                           End                 Blocks                   Id        System
                /dev/sda1                                           1                          1959               15735636                    c        W95 FAT32 (LBA)
                /dev/sda2                                        1960                          5283               26700030                    f        W95 Ext'd (LBA)
                /dev/sda3                                        5284                          6528               10000462+                   7        HPFS/NTFS
                /dev/sda4                                        6529                          9729               25712032+                   c        W95 FAT32 (LBA)
                /dev/sda5   *                                    1960                          2661                5638752                   83        Linux
                /dev/sda6                                        3265                          5283               16217586                    b        W95 FAT32
                /dev/sda7                                        2662                          3264                4843566                   83        Linux

                Partition table entries are not in disk order

                Command (m for help): a
                Partition number (1-7): 5

                Command (m for help): p

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                                  Start                           End                 Blocks                   Id        System
                /dev/sda1                                           1                          1959               15735636                    c        W95 FAT32 (LBA)
                /dev/sda2                                        1960                          5283               26700030                    f        W95 Ext'd (LBA)
                /dev/sda3                                        5284                          6528               10000462+                   7        HPFS/NTFS
                /dev/sda4                                        6529                          9729               25712032+                   c        W95 FAT32 (LBA)
                /dev/sda5                                        1960                          2661                5638752                   83        Linux
                /dev/sda6                                        3265                          5283               16217586                    b        W95 FAT32
                /dev/sda7                                        2662                          3264                4843566                   83        Linux

                Partition table entries are not in disk order

                Command (m for help):

                As	
  seen	
  above,	
  the	
  boot	
  flag	
  is	
  disabled	
  on	
  the	
  parFFon	
  /dev/sda5.

                7.	
  Fix	
  Par;;on	
  Table	
  Order	
  Using	
  fdisk	
  Expert	
  Command	
  f

                When	
  you	
  delete	
  a	
  logical	
  parFFon,	
  and	
  recreate	
  it	
  again,	
  you	
  might	
  see	
  the	
  “parFFon	
  out	
  of	
  order”	
  issue.	
  i.e	
  “ParFFon	
  table	
  entries	
  are
                not	
  in	
  disk	
  order”	
  error	
  message.

                For	
  example,	
  when	
  you	
  delete	
  three	
  logical	
  parFFons	
  (sda6,	
  sda7	
  and	
  sda8),	
  and	
  create	
  a	
  new	
  parFFon,	
  you	
  might	
  expect	
  the	
  new
                parFFon	
  name	
  to	
  be	
  sda6.	
  But,	
  the	
  system	
  might’ve	
  created	
  the	
  new	
  parFFon	
  as	
  sda7.	
  This	
  is	
  because,	
  ader	
  the	
  parFFons	
  are	
  deleted,
                sda9	
  parFFon	
  has	
  been	
  moved	
  as	
  sda6	
  and	
  the	
  free	
  space	
  is	
  moved	
  to	
  the	
  end.



5	
  of	
  11                                                                                                                                                                                                   18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                  hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                To	
  fix	
  this	
  parFFon	
  order	
  issue,	
  and	
  assign	
  sda6	
  to	
  the	
  newly	
  created	
  parFFon,	
  execute	
  the	
  expert	
  command	
  f	
  as	
  shown	
  below.

                  $ fdisk              /dev/sda

                The number of cylinders for this disk is set to 9729.
                There is nothing wrong with that, but this is larger than 1024,
                and could in certain setups cause problems with:
                1) software that runs at boot time (e.g., old versions of LILO)
                2) booting and partitioning software from other OSs
                   (e.g., DOS FDISK, OS/2 FDISK)

                Command (m for help): p

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                                 Start                            End                 Blocks                  Id        System
                /dev/sda1                                          1                           1959               15735636                   c        W95 FAT32 (LBA)
                /dev/sda2                                       1960                           5283               26700030                   f        W95 Ext'd (LBA)
                /dev/sda3                                       5284                           6528               10000462+                  7        HPFS/NTFS
                /dev/sda4                                       6529                           9729               25712032+                  c        W95 FAT32 (LBA)
                /dev/sda5   *                                   1960                           2661                5638752                  83        Linux
                /dev/sda6                                       3265                           5283               16217586                   b        W95 FAT32
                /dev/sda7                                       2662                           3264                4843566                  83        Linux

                Partition table entries are not in disk order

                Command (m for help): x

                Expert command (m for help): f
                Done.

                Expert command (m for help): w
                The partition table has been altered!

                Calling ioctl() to re-read partition table.

                WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
                The kernel still uses the old table. The new table will be used at
                the next reboot or after you run partprobe(8) or kpartx(8)
                Syncing disks.

                Once	
  the	
  parFFon	
  table	
  order	
  is	
  fixed,	
  you’ll	
  not	
  get	
  the	
  “ParFFon	
  table	
  entries	
  are	
  not	
  in	
  disk	
  order”	
  error	
  message	
  anymore.

                # fdisk -l

                Disk /dev/sda: 80.0 GB, 80026361856 bytes
                255 heads, 63 sectors/track, 9729 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes
                Disk identifier: 0xf6edf6ed

                   Device Boot                                 Start                            End                 Blocks                  Id        System
                /dev/sda1                                          1                           1959               15735636                   c        W95 FAT32 (LBA)
                /dev/sda2                                       1960                           5283               26700030                   f        W95 Ext'd (LBA)
                /dev/sda3                                       5284                           6528               10000462+                  7        HPFS/NTFS
                /dev/sda4                                       6529                           9729               25712032+                  c        W95 FAT32 (LBA)
                /dev/sda5   *                                   1960                           2661                5638752                  83        Linux
                /dev/sda6                                       2662                           3264                4843566                  83        Linux
                /dev/sda7                                       3265                           5283               16217586                   b        W95 FAT32



6	
  of	
  11                                                                                                                                                                                                  18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                       hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/




                               1                    Tweet          10                   Like         4             	
  Share              	
  Comment


                If	
  you	
  enjoyed	
  this	
  ar;cle,	
  you	
  might	
  also	
  like..


                       1. 50	
  Linux	
  Sysadmin	
  Tutorials
                                                                                                                                              Awk	
  IntroducFon	
  –	
  7	
  Awk	
  Print	
  Examples
                       2. 50	
  Most	
  Frequently	
  Used	
  Linux	
  Commands	
  (With	
  Examples)
                                                                                                                                              Advanced	
  Sed	
  SubsFtuFon	
  Examples
                       3. Top	
  25	
  Best	
  Linux	
  Performance	
  Monitoring	
  and	
  Debugging
                                                                                                                                              8	
  EssenFal	
  Vim	
  Editor	
  NavigaFon	
  Fundamentals
                          Tools
                                                                                                                                              25	
  Most	
  Frequently	
  Used	
  Linux	
  IPTables	
  Rules
                       4. Mommy,	
  I	
  found	
  it!	
  –	
  15	
  PracFcal	
  Linux	
  Find	
  Command
                                                                                                                                              Examples
                          Examples
                                                                                                                                              Turbocharge	
  PuTTY	
  with	
  12	
  Powerful	
  Add-­‐Ons
                       5. Linux	
  101	
  Hacks	
  2nd	
  EdiFon	
  eBook	
  




                {	
  12	
  comments…	
  read	
  them	
  below	
  or	
  add	
  one	
  }

                1	
  anurag	
  rana	
  September	
  14,	
  2010	
  at	
  2:50	
  am

                            thanxs	
  ……

                2	
  anurag	
  rana	
  September	
  14,	
  2010	
  at	
  2:52	
  am

                            sir	
  ,	
  you	
  provides	
  very	
  good	
  tuts….i	
  use	
  to	
  save	
  every	
  single	
  page	
  of	
  your	
  arFcles…	
  thanxs	
  again..

                3	
  Madharasan	
  September	
  14,	
  2010	
  at	
  4:57	
  am

                            The	
  “Warning	
  Message”	
  in	
  this	
  arFcle	
  reminds	
  me	
  of	
  the	
  mistake	
  I	
  did	
  while	
  teaching	
  linux	
  to	
  a	
  group	
  of	
  students.

                            I	
  was	
  about	
  to	
  enter	
  the	
  command	
  #	
  mkfs.ext3	
  /dev/sda4
                            But	
  unfortunately	
  just	
  when	
  I	
  have	
  finished	
  typing	
  #	
  mkfs.ext3	
  /dev/sda	
  ,	
  I	
  accidentely	
  pressed	
  the	
  enter	
  key….

                            There	
  ends	
  the	
  story	
  of	
  my	
  LINUX	
  OS	
  of	
  that	
  machine	
  and	
  my	
  session	
  on	
  Disk	
  management.

                            Now	
  a	
  days,	
  I	
  first	
  enter	
  the	
  device	
  details	
  and	
  opFons,	
  only	
  then	
  the	
  command	
  

                            Conclusion:
                            No	
  Playing	
  with	
  linux,	
  at	
  Fmes	
  it	
  is	
  merciless

                4	
  Chris	
  F.A.	
  Johnson	
  September	
  14,	
  2010	
  at	
  1:43	
  pm

                            s/loose/lose/



7	
  of	
  11                                                                                                                                                                                               18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                         hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/


                5	
  DarkForce	
  September	
  14,	
  2010	
  at	
  5:21	
  pm

                            Thanks	
  for	
  Fp	
  number	
  7.

                6	
  Ramesh	
  Natarajan	
  September	
  14,	
  2010	
  at	
  8:51	
  pm

                            @Chris,

                            Thanks	
  for	
  poinFng	
  out	
  the	
  typo.	
  It’s	
  fixed.

                7	
  jameslee	
  September	
  15,	
  2010	
  at	
  9:35	
  am

                            thank	
  u	
  sir,its	
  very	
  useful

                8	
  raralee	
  September	
  15,	
  2010	
  at	
  11:07	
  am

                            good	
  Fps.
                            how	
  to	
  add	
  new	
  space	
  on	
  the	
  exisFng	
  parFFon	
  using	
  fdisk	
  without	
  losing	
  data?

                9	
  Sebas	
  September	
  16,	
  2010	
  at	
  12:46	
  pm

                            Add	
  new	
  space	
  w/o	
  loosing	
  data	
  with	
  fdisk….?	
  i	
  think	
  that’s	
  not	
  posible.

                10	
  madharasan	
  September	
  17,	
  2010	
  at	
  1:48	
  am

                            @raralee

                            resizing	
  a	
  parFFon	
  without	
  losing	
  data	
  is	
  not	
  possible.
                            But	
  if	
  you	
  have	
  a	
  plan	
  already	
  that	
  you	
  would	
  be	
  changing	
  parFFon	
  sizes,	
  then	
  please	
  use	
  LVM	
  (	
  Logical	
  Volume	
  Manager	
  )

                11	
  alieblice	
  June	
  27,	
  2011	
  at	
  3:50	
  pm

                            I	
  have	
  problem	
  with	
  fdisk	
  command
                            when	
  i	
  tell	
  it	
  to	
  make	
  80	
  megabyte	
  drive	
  with	
  this	
  input	
  ((	
  +80M))	
  it	
  make	
  85	
  megabyte	
  drive	
  and	
  the	
  drive	
  is	
  made	
  by	
  vmware
                            player	
  on	
  ubutnu	
  10.04

                            any	
  idea	
  why	
  this	
  happen	
  ?

                12	
  Guus	
  August	
  29,	
  2011	
  at	
  10:56	
  am

                            Thanks	
  a	
  lot!
                            Ader	
  restoring	
  a	
  Windows	
  installaFon	
  to	
  a	
  new	
  harddisk,	
  i	
  found	
  that	
  i	
  had	
  made	
  a	
  mistake	
  with	
  the	
  parFFon-­‐order,	
  causing	
  a
                            non-­‐boot.	
  Ader	
  reordering	
  the	
  parFFons,	
  it	
  boots	
  again	
  (although	
  i	
  won’t	
  use	
  it,	
  not	
  my	
  machine	
              	
  .

                Leave	
  a	
  Comment

                                                                                  Name


                                                                                  E-­‐mail


                                                                                  Website




8	
  of	
  11                                                                                                                                                                                                           18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                                   hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/




                      	
  NoFfy	
  me	
  of	
  followup	
  comments	
  via	
  e-­‐mail

                   Submit

                Previous	
  post:	
  6	
  Perl	
  File	
  Handle	
  Examples	
  to	
  Open,	
  Read,	
  and	
  Write	
  File

                Next	
  post:	
  VMWare	
  ESXi	
  4:	
  How	
  to	
  Add	
  Virtual	
  Hard	
  Disk	
  (from	
  Datastore)	
  to	
  a	
  VM	
  Using	
  vSphere	
  Client

                            Sign	
  up	
  for	
  our	
  free	
  email	
  newslePer	
   you@address.com                                           	
  	
  	
  	
  	
      Sign Up


                                                       	
  	
  	
  	
  	
     	
  RSS	
     	
  TwiPer	
     	
  Facebook



                                                                                                                            	
     Search

                            EBOOKS




9	
  of	
  11                                                                                                                                                                                         18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                       hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/




                       POPULAR	
  POSTS

                                 12	
  Amazing	
  and	
  EssenFal	
  Linux	
  Books	
  To	
  Enrich	
  Your	
  Brain	
  and	
  Library
                                 50	
  UNIX	
  /	
  Linux	
  Sysadmin	
  Tutorials
                                 50	
  Most	
  Frequently	
  Used	
  UNIX	
  /	
  Linux	
  Commands	
  (With	
  Examples)
                                 How	
  To	
  Be	
  ProducFve	
  and	
  Get	
  Things	
  Done	
  Using	
  GTD
                                 30	
  Things	
  To	
  Do	
  When	
  you	
  are	
  Bored	
  and	
  have	
  a	
  Computer
                                 Linux	
  Directory	
  Structure	
  (File	
  System	
  Structure)	
  Explained	
  with	
  Examples
                                 Linux	
  Crontab:	
  15	
  Awesome	
  Cron	
  Job	
  Examples
                                 Get	
  a	
  Grip	
  on	
  the	
  Grep!	
  –	
  15	
  PracFcal	
  Grep	
  Command	
  Examples
                                 Unix	
  LS	
  Command:	
  15	
  PracFcal	
  Examples
                                 15	
  Examples	
  To	
  Master	
  Linux	
  Command	
  Line	
  History
                                 Top	
  10	
  Open	
  Source	
  Bug	
  Tracking	
  System
                                 Vi	
  and	
  Vim	
  Macro	
  Tutorial:	
  How	
  To	
  Record	
  and	
  Play
                                 Mommy,	
  I	
  found	
  it!	
  -­‐-­‐	
  15	
  PracFcal	
  Linux	
  Find	
  Command	
  Examples
                                 15	
  Awesome	
  Gmail	
  Tips	
  and	
  Tricks
                                 15	
  Awesome	
  Google	
  Search	
  Tips	
  and	
  Tricks
                                 RAID	
  0,	
  RAID	
  1,	
  RAID	
  5,	
  RAID	
  10	
  Explained	
  with	
  Diagrams
                                 Can	
  You	
  Top	
  This?	
  15	
  PracFcal	
  Linux	
  Top	
  Command	
  Examples
                                 Top	
  5	
  Best	
  System	
  Monitoring	
  Tools
                                 Top	
  5	
  Best	
  Linux	
  OS	
  DistribuFons
                                 How	
  To	
  Monitor	
  Remote	
  Linux	
  Host	
  using	
  Nagios	
  3.0
                                 Awk	
  IntroducFon	
  Tutorial	
  –	
  7	
  Awk	
  Print	
  Examples
                                 How	
  to	
  Backup	
  Linux?	
  15	
  rsync	
  Command	
  Examples
                                 The	
  UlFmate	
  Wget	
  Download	
  Guide	
  With	
  15	
  Awesome	
  Examples
                                 Top	
  5	
  Best	
  Linux	
  Text	
  Editors
                                 Packet	
  Analyzer:	
  15	
  TCPDUMP	
  Command	
  Examples
                                 The	
  UlFmate	
  Bash	
  Array	
  Tutorial	
  with	
  15	
  Examples
                                 3	
  Steps	
  to	
  Perform	
  SSH	
  Login	
  Without	
  Password	
  Using	
  ssh-­‐keygen	
  &	
  ssh-­‐copy-­‐id
                                 Unix	
  Sed	
  Tutorial:	
  Advanced	
  Sed	
  SubsFtuFon	
  Examples
                                 UNIX	
  /	
  Linux:	
  10	
  Netstat	
  Command	
  Examples
                                 The	
  UlFmate	
  Guide	
  for	
  CreaFng	
  Strong	
  Passwords
                                 6	
  Steps	
  to	
  Secure	
  Your	
  Home	
  Wireless	
  Network
                                 Turbocharge	
  PuTTY	
  with	
  12	
  Powerful	
  Add-­‐Ons

                       About	
  The	
  Geek	
  Stuff




10	
  of	
  11                                                                                                                                                            18	
  Apr	
  12	
  7:29	
  pm
7	
  Linux	
  fdisk	
  Command	
  Examples	
  to	
  Manage	
  Hard	
  Disk	
  ParFFon                                                                    hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/




                                                    	
  My	
  name	
  is	
  Ramesh	
  Natarajan.	
  I	
  will	
  be	
  posFng	
  instrucFon	
  guides,	
  how-­‐to,	
  troubleshooFng	
  Fps	
  and	
  tricks	
  on
                            Linux,	
  database,	
  hardware,	
  security	
  and	
  web.	
  My	
  focus	
  is	
  to	
  write	
  arFcles	
  that	
  will	
  either	
  teach	
  you	
  or	
  help	
  you	
  resolve	
  a
                            problem.	
  Read	
  more	
  about	
  Ramesh	
  Natarajan	
  and	
  the	
  blog.

                            Support	
  Us


                            Support	
  this	
  blog	
  by	
  purchasing	
  one	
  of	
  my	
  ebooks.

                            Bash	
  101	
  Hacks	
  eBook

                            Sed	
  and	
  Awk	
  101	
  Hacks	
  eBook

                            Vim	
  101	
  Hacks	
  eBook

                            Nagios	
  Core	
  3	
  eBook

                            Contact	
  Us


                            Email	
  Me	
  :	
  Use	
  this	
  Contact	
  Form	
  to	
  get	
  in	
  touch	
  me	
  with	
  your	
  comments,	
  quesFons	
  or	
  suggesFons	
  about	
  this	
  site.	
  You	
  can	
  also
                            simply	
  drop	
  me	
  a	
  line	
  to	
  say	
  hello!.

                            Follow	
  us	
  on	
  TwiPer

                            Become	
  a	
  fan	
  on	
  Facebook	
  	
  

                 Copyright	
  ©	
  2008–2012	
  Ramesh	
  Natarajan.	
  All	
  rights	
  reserved	
  |	
  Terms	
  of	
  Service	
  |	
  AdverFse




11	
  of	
  11                                                                                                                                                                                                  18	
  Apr	
  12	
  7:29	
  pm

More Related Content

What's hot (20)

Case Study Raid Utility Guideline
Case Study Raid Utility GuidelineCase Study Raid Utility Guideline
Case Study Raid Utility Guideline
 
Linuxdiskmanagementcommands
LinuxdiskmanagementcommandsLinuxdiskmanagementcommands
Linuxdiskmanagementcommands
 
Tao usb boot wmw
Tao usb boot wmwTao usb boot wmw
Tao usb boot wmw
 
pptdisk
pptdiskpptdisk
pptdisk
 
Lect12
Lect12Lect12
Lect12
 
Intro to linux
Intro to linuxIntro to linux
Intro to linux
 
Programming and problem solving 3
Programming and problem solving 3Programming and problem solving 3
Programming and problem solving 3
 
Odroid Magazine March 2014
Odroid Magazine March 2014Odroid Magazine March 2014
Odroid Magazine March 2014
 
Newlug presentation- OpenSolaris
Newlug presentation- OpenSolarisNewlug presentation- OpenSolaris
Newlug presentation- OpenSolaris
 
Linux
Linux Linux
Linux
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot manager
 
File System FAT And NTFS
File System FAT And NTFSFile System FAT And NTFS
File System FAT And NTFS
 
Dos
DosDos
Dos
 
101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Fat 32 file system
Fat 32 file systemFat 32 file system
Fat 32 file system
 
Linux
Linux Linux
Linux
 
Booy Up
Booy UpBooy Up
Booy Up
 
Unixfs
UnixfsUnixfs
Unixfs
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 

Viewers also liked

Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsKevin OBrien
 
SQL Server vNext on Linux
SQL Server vNext on LinuxSQL Server vNext on Linux
SQL Server vNext on LinuxTravis Wright
 
6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)chinkshady
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionJuan A. Suárez Romero
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVMPriyank Kapadia
 
Linux Performance Tools
Linux Performance ToolsLinux Performance Tools
Linux Performance ToolsBrendan Gregg
 
Operating Systems: Linux in Detail
Operating Systems: Linux in DetailOperating Systems: Linux in Detail
Operating Systems: Linux in DetailDamian T. Gordon
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014iimjobs and hirist
 

Viewers also liked (18)

Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
SQL Server vNext on Linux
SQL Server vNext on LinuxSQL Server vNext on Linux
SQL Server vNext on Linux
 
Lvm
LvmLvm
Lvm
 
6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)6 examples to backup linux using dd command (including disk to disk)
6 examples to backup linux using dd command (including disk to disk)
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An Introduction
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVM
 
Linux Performance Tools
Linux Performance ToolsLinux Performance Tools
Linux Performance Tools
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
SQL Server on Linux
SQL Server on LinuxSQL Server on Linux
SQL Server on Linux
 
Operating Systems: Linux in Detail
Operating Systems: Linux in DetailOperating Systems: Linux in Detail
Operating Systems: Linux in Detail
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014Top 100 Linux Interview Questions and Answers 2014
Top 100 Linux Interview Questions and Answers 2014
 

Similar to 7 linux fdisk command examples to manage hard disk partition

101 2.1 design hard disk layout
101 2.1 design hard disk layout101 2.1 design hard disk layout
101 2.1 design hard disk layoutAcácio Oliveira
 
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Joachim Jacob
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.pptRakesh Kadu
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyNugroho Gito
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02FNian
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystemsAcácio Oliveira
 
Linux lv ms step by step
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by stepsudakarman
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Mirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMMirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMKazimal Abed Mohammed
 
How to install gentoo distributed
How to install gentoo distributedHow to install gentoo distributed
How to install gentoo distributedSongWang54
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Bud Siddhisena
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboardsDenis Ristic
 
How to mount ntfs in linux
How to mount ntfs in linuxHow to mount ntfs in linux
How to mount ntfs in linuxsiraza5
 

Similar to 7 linux fdisk command examples to manage hard disk partition (20)

101 2.1 design hard disk layout
101 2.1 design hard disk layout101 2.1 design hard disk layout
101 2.1 design hard disk layout
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Real time systems
Real time systemsReal time systems
Real time systems
 
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
 
Linux lv ms step by step
Linux lv ms step by stepLinux lv ms step by step
Linux lv ms step by step
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Mirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVMMirroring the root_disk under solaris SVM
Mirroring the root_disk under solaris SVM
 
How to install gentoo distributed
How to install gentoo distributedHow to install gentoo distributed
How to install gentoo distributed
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system administration
 
How to mount ntfs in linux
How to mount ntfs in linuxHow to mount ntfs in linux
How to mount ntfs in linux
 
unix-rosetta
unix-rosettaunix-rosetta
unix-rosetta
 

More from chinkshady

25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules exampleschinkshady
 
15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unixchinkshady
 
10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoringchinkshady
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unixchinkshady
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linuxchinkshady
 
7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linuxchinkshady
 
4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanentlychinkshady
 
36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset trackingchinkshady
 

More from chinkshady (8)

25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
 
15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix15 practical grep command examples in linux : unix
15 practical grep command examples in linux : unix
 
10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring10 useful sar (sysstat) examples for unix : linux performance monitoring
10 useful sar (sysstat) examples for unix : linux performance monitoring
 
10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix10 awesome examples for viewing huge log files in unix
10 awesome examples for viewing huge log files in unix
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
 
7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux7 strace examples to debug the execution of a program in linux
7 strace examples to debug the execution of a program in linux
 
4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently4 effective methods to disable se linux temporarily or permanently
4 effective methods to disable se linux temporarily or permanently
 
36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking36 items to capture for practical hardware asset tracking
36 items to capture for practical hardware asset tracking
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

7 linux fdisk command examples to manage hard disk partition

  • 1. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ Home About Free  eBook Archives Best  of  the  Blog Contact 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  Par;;on by  Balakrishnan  Mariyappan  on  September  14,  2010 1 Like 4 Tweet 10 On  Linux  distribuFons,  fdisk  is  the  best  tool  to  manage  disk  parFFons.  fdisk  is  a text  based  uFlity. Using  fdisk  you  can  create  a  new  parFFon,  delete  an  exisFng  parFFon,  or  change  exisFng  parFFon. Using  fidsk  you  are  allowed  to  create  a  maximum  of  four  primary  parFFon,  and  any  number  of  logical  parFFons,  based  on  the  size  of  the disk. 1  of  11 18  Apr  12  7:29  pm
  • 2. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ Keep  in  mind  that  any  single  parFFon  requires  a  minimum  size  of  40MB. In  this  arFcle,  let  us  review  how  to  use  fdisk  command  using  pracFcal  examples. Warning:  Don’t  delete,  modify,  or  add  parFFon,  if  you  don’t  know  what  you  are  doing.  You  will  lose  your  data! 1.  View  All  Exis;ng  Disk  Par;;ons  Using  fdisk  -­‐l Before  you  create  a  new  parFFon,  or  modify  an  exisFng  parFFon,  you  might  want  to  view  all  available  parFFon  in  the  system. Use  fdisk  -­‐l  to  view  all  available  parFFons  as  shown  below. # fdisk -l Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 * 1960 2661 5638752 83 Linux /dev/sda6 2662 2904 1951866 83 Linux /dev/sda7 2905 3147 1951866 83 Linux /dev/sda8 3148 3264 939771 82 Linux swap / Solaris /dev/sda9 3265 5283 16217586 b W95 FAT32 The  above  will  list  parFFons  from  all  the  connected  hard  disks.  When  you  have  more  than  one  disk  on  the  system,  the  parFFons  list  are ordered  by  the  device’s  /dev  name.  For  example,  /dev/sda,  /dev/sdb,  /dev/sdc  and  so  on. 2.  View  Par;;ons  of  a  Specific  Hard  Disk  using  fdisk  -­‐l  /dev/sd{a} To  view  all  parFFons  of  the  /dev/sda  hard  disk,  do  the  following. # fdisk -l /dev/sda View  all  fdisk  Commands  Using  fdisk  Command  m Use  fdisk  command  m,  to  view  all  available  fdisk  commands  as  shown  below. # fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) 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 2  of  11 18  Apr  12  7:29  pm
  • 3. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ 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) 3.  Delete  a  Hard  Disk  Par;;on  Using  fdisk  Command  d Let  us  assume  that  you  like  to  combine  several  parFFons  (for  example,  /dev/sda6,  /dev/sda7  and  /dev/sda8)  into  a  single  disk  parFFon. To  do  this,  you  should  first  delete  all  those  individual  parFFons,  as  shown  below. # fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 * 1960 2661 5638752 83 Linux /dev/sda6 2662 2904 1951866 83 Linux /dev/sda7 2905 3147 1951866 83 Linux /dev/sda8 3148 3264 939771 82 Linux swap / Solaris /dev/sda9 3265 5283 16217586 b W95 FAT32 Command (m for help): d Partition number (1-9): 8 Command (m for help): d Partition number (1-8): 7 Command (m for help): d Partition number (1-7): 6 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at 3  of  11 18  Apr  12  7:29  pm
  • 4. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. 4.  Create  a  New  Disk  Par;;on  with  Specific  Size  Using  fdisk  Command  n Once  you’ve  deleted  all  the  exisFng  parFFons,  you  can  create  a  new  parFFon  using  all  available  space  as  shown  below. # fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): n First cylinder (2662-5283, default 2662): Using default value 2662 Last cylinder, +cylinders or +size{K,M,G} (2662-3264, default 3264): Using default value 3264 In  the  above  example,  fdisk  n  command  is  used  to  create  new  parFFon  with  the  specific  size.  While  creaFng  a  new  parFFon,  it  expects following  two  inputs. StarFng  cylinder  number  of  the  parFFon  to  be  create  (First  cylinder). Size  of  the  parFFon  (or)  the  last  cylinder  number  (Last  cylinder,  +cylinders  or  +size  ). Please  keep  in  mind  that  you  should  issue  the  fdisk  write  command  (w)  ader  any  modificaFons. Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. Ader  the  parFFon  is  created,  format  it  using  the  mkfs  command  as  shown  below. # mkfs.ext3 /dev/sda7 5.  View  the  Size  of  an  exis;ng  Par;;on  Using  fdisk  -­‐s As  shown  below,  fdisk  -­‐s  displays  the  size  of  the  parFFon  in  blocks. # fdisk -s /dev/sda7 4843566 The  above  output  corresponds  to  about  4900MB. 6.  Toggle  the  Boot  Flag  of  a  Par;;on  Using  fdisk  Command  a Fdisk  command  displays  the  boot  flag  of  each  parFFon.  When  you  want  to  disable  or  enable  the  boot  flag  on  the  corresponding parFFon,  do  the  following. If  you  don’t  know  why  are  you  are  doing  this,  you’ll  mess-­‐up  your  system. 4  of  11 18  Apr  12  7:29  pm
  • 5. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ # fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 * 1960 2661 5638752 83 Linux /dev/sda6 3265 5283 16217586 b W95 FAT32 /dev/sda7 2662 3264 4843566 83 Linux Partition table entries are not in disk order Command (m for help): a Partition number (1-7): 5 Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 1960 2661 5638752 83 Linux /dev/sda6 3265 5283 16217586 b W95 FAT32 /dev/sda7 2662 3264 4843566 83 Linux Partition table entries are not in disk order Command (m for help): As  seen  above,  the  boot  flag  is  disabled  on  the  parFFon  /dev/sda5. 7.  Fix  Par;;on  Table  Order  Using  fdisk  Expert  Command  f When  you  delete  a  logical  parFFon,  and  recreate  it  again,  you  might  see  the  “parFFon  out  of  order”  issue.  i.e  “ParFFon  table  entries  are not  in  disk  order”  error  message. For  example,  when  you  delete  three  logical  parFFons  (sda6,  sda7  and  sda8),  and  create  a  new  parFFon,  you  might  expect  the  new parFFon  name  to  be  sda6.  But,  the  system  might’ve  created  the  new  parFFon  as  sda7.  This  is  because,  ader  the  parFFons  are  deleted, sda9  parFFon  has  been  moved  as  sda6  and  the  free  space  is  moved  to  the  end. 5  of  11 18  Apr  12  7:29  pm
  • 6. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ To  fix  this  parFFon  order  issue,  and  assign  sda6  to  the  newly  created  parFFon,  execute  the  expert  command  f  as  shown  below. $ fdisk /dev/sda The number of cylinders for this disk is set to 9729. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 * 1960 2661 5638752 83 Linux /dev/sda6 3265 5283 16217586 b W95 FAT32 /dev/sda7 2662 3264 4843566 83 Linux Partition table entries are not in disk order Command (m for help): x Expert command (m for help): f Done. Expert command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. Once  the  parFFon  table  order  is  fixed,  you’ll  not  get  the  “ParFFon  table  entries  are  not  in  disk  order”  error  message  anymore. # fdisk -l Disk /dev/sda: 80.0 GB, 80026361856 bytes 255 heads, 63 sectors/track, 9729 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xf6edf6ed Device Boot Start End Blocks Id System /dev/sda1 1 1959 15735636 c W95 FAT32 (LBA) /dev/sda2 1960 5283 26700030 f W95 Ext'd (LBA) /dev/sda3 5284 6528 10000462+ 7 HPFS/NTFS /dev/sda4 6529 9729 25712032+ c W95 FAT32 (LBA) /dev/sda5 * 1960 2661 5638752 83 Linux /dev/sda6 2662 3264 4843566 83 Linux /dev/sda7 3265 5283 16217586 b W95 FAT32 6  of  11 18  Apr  12  7:29  pm
  • 7. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ 1 Tweet 10 Like 4  Share  Comment If  you  enjoyed  this  ar;cle,  you  might  also  like.. 1. 50  Linux  Sysadmin  Tutorials Awk  IntroducFon  –  7  Awk  Print  Examples 2. 50  Most  Frequently  Used  Linux  Commands  (With  Examples) Advanced  Sed  SubsFtuFon  Examples 3. Top  25  Best  Linux  Performance  Monitoring  and  Debugging 8  EssenFal  Vim  Editor  NavigaFon  Fundamentals Tools 25  Most  Frequently  Used  Linux  IPTables  Rules 4. Mommy,  I  found  it!  –  15  PracFcal  Linux  Find  Command Examples Examples Turbocharge  PuTTY  with  12  Powerful  Add-­‐Ons 5. Linux  101  Hacks  2nd  EdiFon  eBook   {  12  comments…  read  them  below  or  add  one  } 1  anurag  rana  September  14,  2010  at  2:50  am thanxs  …… 2  anurag  rana  September  14,  2010  at  2:52  am sir  ,  you  provides  very  good  tuts….i  use  to  save  every  single  page  of  your  arFcles…  thanxs  again.. 3  Madharasan  September  14,  2010  at  4:57  am The  “Warning  Message”  in  this  arFcle  reminds  me  of  the  mistake  I  did  while  teaching  linux  to  a  group  of  students. I  was  about  to  enter  the  command  #  mkfs.ext3  /dev/sda4 But  unfortunately  just  when  I  have  finished  typing  #  mkfs.ext3  /dev/sda  ,  I  accidentely  pressed  the  enter  key…. There  ends  the  story  of  my  LINUX  OS  of  that  machine  and  my  session  on  Disk  management. Now  a  days,  I  first  enter  the  device  details  and  opFons,  only  then  the  command   Conclusion: No  Playing  with  linux,  at  Fmes  it  is  merciless 4  Chris  F.A.  Johnson  September  14,  2010  at  1:43  pm s/loose/lose/ 7  of  11 18  Apr  12  7:29  pm
  • 8. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ 5  DarkForce  September  14,  2010  at  5:21  pm Thanks  for  Fp  number  7. 6  Ramesh  Natarajan  September  14,  2010  at  8:51  pm @Chris, Thanks  for  poinFng  out  the  typo.  It’s  fixed. 7  jameslee  September  15,  2010  at  9:35  am thank  u  sir,its  very  useful 8  raralee  September  15,  2010  at  11:07  am good  Fps. how  to  add  new  space  on  the  exisFng  parFFon  using  fdisk  without  losing  data? 9  Sebas  September  16,  2010  at  12:46  pm Add  new  space  w/o  loosing  data  with  fdisk….?  i  think  that’s  not  posible. 10  madharasan  September  17,  2010  at  1:48  am @raralee resizing  a  parFFon  without  losing  data  is  not  possible. But  if  you  have  a  plan  already  that  you  would  be  changing  parFFon  sizes,  then  please  use  LVM  (  Logical  Volume  Manager  ) 11  alieblice  June  27,  2011  at  3:50  pm I  have  problem  with  fdisk  command when  i  tell  it  to  make  80  megabyte  drive  with  this  input  ((  +80M))  it  make  85  megabyte  drive  and  the  drive  is  made  by  vmware player  on  ubutnu  10.04 any  idea  why  this  happen  ? 12  Guus  August  29,  2011  at  10:56  am Thanks  a  lot! Ader  restoring  a  Windows  installaFon  to  a  new  harddisk,  i  found  that  i  had  made  a  mistake  with  the  parFFon-­‐order,  causing  a non-­‐boot.  Ader  reordering  the  parFFons,  it  boots  again  (although  i  won’t  use  it,  not  my  machine    . Leave  a  Comment Name E-­‐mail Website 8  of  11 18  Apr  12  7:29  pm
  • 9. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/  NoFfy  me  of  followup  comments  via  e-­‐mail Submit Previous  post:  6  Perl  File  Handle  Examples  to  Open,  Read,  and  Write  File Next  post:  VMWare  ESXi  4:  How  to  Add  Virtual  Hard  Disk  (from  Datastore)  to  a  VM  Using  vSphere  Client Sign  up  for  our  free  email  newslePer   you@address.com           Sign Up            RSS    TwiPer    Facebook   Search EBOOKS 9  of  11 18  Apr  12  7:29  pm
  • 10. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/ POPULAR  POSTS 12  Amazing  and  EssenFal  Linux  Books  To  Enrich  Your  Brain  and  Library 50  UNIX  /  Linux  Sysadmin  Tutorials 50  Most  Frequently  Used  UNIX  /  Linux  Commands  (With  Examples) How  To  Be  ProducFve  and  Get  Things  Done  Using  GTD 30  Things  To  Do  When  you  are  Bored  and  have  a  Computer Linux  Directory  Structure  (File  System  Structure)  Explained  with  Examples Linux  Crontab:  15  Awesome  Cron  Job  Examples Get  a  Grip  on  the  Grep!  –  15  PracFcal  Grep  Command  Examples Unix  LS  Command:  15  PracFcal  Examples 15  Examples  To  Master  Linux  Command  Line  History Top  10  Open  Source  Bug  Tracking  System Vi  and  Vim  Macro  Tutorial:  How  To  Record  and  Play Mommy,  I  found  it!  -­‐-­‐  15  PracFcal  Linux  Find  Command  Examples 15  Awesome  Gmail  Tips  and  Tricks 15  Awesome  Google  Search  Tips  and  Tricks RAID  0,  RAID  1,  RAID  5,  RAID  10  Explained  with  Diagrams Can  You  Top  This?  15  PracFcal  Linux  Top  Command  Examples Top  5  Best  System  Monitoring  Tools Top  5  Best  Linux  OS  DistribuFons How  To  Monitor  Remote  Linux  Host  using  Nagios  3.0 Awk  IntroducFon  Tutorial  –  7  Awk  Print  Examples How  to  Backup  Linux?  15  rsync  Command  Examples The  UlFmate  Wget  Download  Guide  With  15  Awesome  Examples Top  5  Best  Linux  Text  Editors Packet  Analyzer:  15  TCPDUMP  Command  Examples The  UlFmate  Bash  Array  Tutorial  with  15  Examples 3  Steps  to  Perform  SSH  Login  Without  Password  Using  ssh-­‐keygen  &  ssh-­‐copy-­‐id Unix  Sed  Tutorial:  Advanced  Sed  SubsFtuFon  Examples UNIX  /  Linux:  10  Netstat  Command  Examples The  UlFmate  Guide  for  CreaFng  Strong  Passwords 6  Steps  to  Secure  Your  Home  Wireless  Network Turbocharge  PuTTY  with  12  Powerful  Add-­‐Ons About  The  Geek  Stuff 10  of  11 18  Apr  12  7:29  pm
  • 11. 7  Linux  fdisk  Command  Examples  to  Manage  Hard  Disk  ParFFon hPp://www.thegeekstuff.com/2010/09/linux-­‐fdisk/  My  name  is  Ramesh  Natarajan.  I  will  be  posFng  instrucFon  guides,  how-­‐to,  troubleshooFng  Fps  and  tricks  on Linux,  database,  hardware,  security  and  web.  My  focus  is  to  write  arFcles  that  will  either  teach  you  or  help  you  resolve  a problem.  Read  more  about  Ramesh  Natarajan  and  the  blog. Support  Us Support  this  blog  by  purchasing  one  of  my  ebooks. Bash  101  Hacks  eBook Sed  and  Awk  101  Hacks  eBook Vim  101  Hacks  eBook Nagios  Core  3  eBook Contact  Us Email  Me  :  Use  this  Contact  Form  to  get  in  touch  me  with  your  comments,  quesFons  or  suggesFons  about  this  site.  You  can  also simply  drop  me  a  line  to  say  hello!. Follow  us  on  TwiPer Become  a  fan  on  Facebook     Copyright  ©  2008–2012  Ramesh  Natarajan.  All  rights  reserved  |  Terms  of  Service  |  AdverFse 11  of  11 18  Apr  12  7:29  pm