LinuxQuestions.org
Help answer threads with 0 replies.
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 06-22-2011, 11:45 PM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
fdisk command


hi,
I want to clear the Fdisk command in Linux. Normally I use default disk partition during installation on my Fedora.I use fdisk and choose "n" it show ask me for

PHP Code:
Command (for help): n
Command action
   e   extended
   p   primary partition 
(1-4
In windows I know that we can make up to four primary partitions i think same logic in Linux as well.

If I create custom partitions during installation
like

/dev/hda1
/dev/hda2
/dev/hda3
/dev/hda4
/dev/hda5
/dev/hda6
/dev/hda7

Now in this case If i choose "n" to create new partion ,Linux does not ask for "extended and primary " partition as I ask in if we have created default partitions by the Linux operating system.

Kindly guide me.

thanks
garden
 
Old 06-23-2011, 12:11 AM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 495

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by gardenair View Post
Now in this case If i choose "n" to create new partion ,Linux does not ask for "extended and primary " partition as I ask in if we have created default partitions by the Linux operating system.
You can have either 4 primary partitions or 3 primary partitions and an extended partition. Take a look at this wikipedia page, it's quite informative: http://en.wikipedia.org/wiki/Disk_partitioning

The fdisk prompt that you describe, is actually asking you what type of partition you want to create, primary or extended.
 
Old 06-23-2011, 12:48 AM   #3
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,672
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Try cfdisk, much friendlier than fdisk.
 
0 members found this post helpful.
Old 06-23-2011, 02:57 AM   #4
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
I think (I know that that is dangerous ) that once fdisk can't make primary partitions any longer, it will not offer you the option.

This wil be the case once you've made an extended partition following a primary partition, so if
  • you made hda2 an extended partition
  • you have used hda1, hda2 and hda3 for primary and hda4 for extended

I however stand corrected.


Note:
an extended partition is not a 'usuable' partition; hda1, hda2 and hda3 will be usable partitions in your setup as will be hda5, hda6 etc
 
Old 06-23-2011, 05:39 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks all for the reply. well "Wim Sturkenboom" as you said

PHP Code:
you made hda2 an extended partition
    you have used hda1
hda2 and hda3 for primary and hda4 for extended 
I just want to elaborate if I have understand it correct.

you made hda2 an extended partition
If I attach an other hard disk then I will use an extended partition.

you have used hda1, hda2 and hda3 for primary and hda4 for extended
To make an extended partition with a single hard disk the 1st three partition should be primary and the last hda4 will be used for extended partition.

thanks again for your kind help.
garden
 
Old 06-23-2011, 07:12 AM   #6
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
Quote:
If I attach an other hard disk then I will use an extended partition.
If you attach another HD, it will be hdb and you can start with hdb1 as a primary.

Quote:
To make an extended partition with a single hard disk the 1st three partition should be primary and the last hda4 will be used for extended partition.
What I was trying to say is that if you want 3 primary partitions, the extended partition should be hda4. You can straight away start with an extended partition if I'm not mistaken. But once you have an extended partition, you can not add primary partitions with a higher number. To my knowledge, if Windows is involved, it needs to be installed on a primary partition.
 
Old 06-24-2011, 12:23 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks for the reply. well "Linux numbers Logical partitions starting with 5: The numbers 1,2,3 and 4 are reserved for the primaries, even if you have just one primary partition"
The question is why 1st 4 are reserved for primaries.

Suppose I have a hard disk

Disk /dev/hda: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 196 395104+ 83 Linux
/dev/hda2 197 262 133056 82 Linux swap
/dev/hda3 263 458 395136 83 Linux
/dev/hda4 459 621 328608 83 Linux

Are these 4 partitions are primaries ? How can I say yes ? If it is true then what is technical login that 1st 4 partitions should be primaries and then /dev/hda5 will be our logical partition by which we can create extended partitions.


thanks,
garden

Last edited by gardenair; 06-24-2011 at 01:16 AM.
 
Old 06-24-2011, 02:09 AM   #8
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
Quote:
Originally Posted by gardenair View Post
thanks for the reply. well "Linux numbers Logical partitions starting with 5: The numbers 1,2,3 and 4 are reserved for the primaries, even if you have just one primary partition"
The question is why 1st 4 are reserved for primaries.
If you already have 4 primary partitions, then I don't believe you can create an extended partition after that. You can have 3 primary partitions plus an extended partition. The extended partition can have a number of logical partitions inside it.
Quote:
Originally Posted by gardenair View Post
Suppose I have a hard disk

Device Boot Start End Blocks Id System
/dev/hda1 * 1 196 395104+ 83 Linux
/dev/hda2 197 262 133056 82 Linux swap
/dev/hda3 263 458 395136 83 Linux
/dev/hda4 459 621 328608 83 Linux

Are these 4 partitions are primaries ? How can I say yes ?
They must all be primary partitions. If you have an extended partition then the output of fdisk would look something like this:
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    81915434    40957686    7  HPFS/NTFS/exFAT
/dev/sda2        81915904   120977407    19530752   83  Linux
/dev/sda3       120977408   122931199      976896   82  Linux swap
/dev/sda4       122933246   201054207    39060481    5  Extended
/dev/sda5       122933248   161992703    19529728   83  Linux
/dev/sda6       161994752   201054207    19529728   83  Linux
Note that /dev/sda4 is identified as an extended partition in this example from my computer.

Last edited by tommcd; 06-24-2011 at 02:10 AM.
 
Old 06-24-2011, 03:30 AM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
wonderfull "tommcd" .One think more i want to clear.If I just go back to windows where normally we have one primary partition and one extended partition which keep many local partitions.

Now in Linux which is different than windows os. Here it keep upto 4 primary partition in Intel based system.If we create customize partitions like 8 partitions then in that case our 1st 4 partitions should be primary and rest of it will be extended. (if I am correct).

I hope you understand my point why four primary partition in a single hard drive using Linux?

thanks again for your valuable guidance,

garden
 
Old 06-25-2011, 12:57 AM   #10
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
Quote:
Originally Posted by gardenair View Post
Here it keep upto 4 primary partition in Intel based system.If we create customize partitions like 8 partitions then in that case our 1st 4 partitions should be primary and rest of it will be extended. (if I am correct).
If you want to create logical partitions, then you can have up to 3 primary partitions. Then create as many logical partitions as you want. When you create logical partitions the extended partition that contains the logical partitions is automatically created.

That is what I did when I partitioned the /dev/sda hard drive on my computer that I gave as an example in my last post. The /dev/sda1-3 partitions are all primary, while the rest (/dev/sda5-6) are logical. The /dev/sda4 is the extended partition that was automatically created for the 2 logical partitions.
I have some more room on that hard drive. So I can add other logical partitions after /dev/sda6 if I need them.

Last edited by tommcd; 06-25-2011 at 01:00 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
fdisk command kaushalsingh Linux - Newbie 1 11-20-2009 04:12 AM
About fdisk command satimis Linux - Software 5 04-05-2006 12:29 PM
fdisk command, for / value / do - unsure linuxchump Programming 4 03-13-2005 05:56 AM
fdisk command thefetus Linux - Newbie 5 11-19-2003 03:15 PM
fdisk not a command? toob Linux - Newbie 11 04-26-2003 11:56 PM


All times are GMT -5. The time now is 05:22 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