LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Fdisk Value out of range (https://www.linuxquestions.org/questions/linux-newbie-8/fdisk-value-out-of-range-935332/)

mail2vivek1 03-19-2012 01:35 PM

Fdisk Value out of range
 
Dear All,

I am using Windows 7 and linux both on my laptop.

But when i am trying to create new partition(extended partition) in my Linux using fdisk..it giving me value out of range error.. Please suggest.. I googled it but nothing fixed it.


Below are the already created partitions on my laptop

*****************************************
[root@dhcppc1 ~]# fdisk -l

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 7649 61440561 7 HPFS/NTFS
/dev/sda2 7650 38912 251120047+ f W95 Ext'd (LBA)
/dev/sda5 15299 22947 61440561 7 HPFS/NTFS
/dev/sda6 22948 30596 61440561 7 HPFS/NTFS
/dev/sda7 30597 38912 66798238+ 7 HPFS/NTFS
/dev/sda8 7650 7681 256977 83 Linux
/dev/sda9 7682 9976 18434556 8e Linux LVM
/dev/sda10 9977 11888 15358108+ 83 Linux
/dev/sda11 11889 13163 10241406 83 Linux
/dev/sda12 13164 14438 10241406 83 Linux
/dev/sda13 14439 14699 2096451 82 Linux swap / Solaris
/dev/sda14 14700 14954 2048256 83 Linux
/dev/sda15 14955 15081 1020096 83 Linux

Partition table entries are not in disk order

***************************************
DOS Compatibility flag is not set

Command (m for help): fdisk /dev/sda
f: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Partition number (1-4): 18
Value out of range.
Partition number (1-4):

***************************************

MensaWater 03-19-2012 01:58 PM

Quote:

Partition number (1-4): 18
Uh...

18 is NOT in the range 1-4

In disk partitioning you are allowed 4 primary partitions of which the 4th can be the extended the partition. All partitions after 4 are subsets of 4. There is a limit to the number of such subset partitions. Your partition table is very strange.

Given that you have an LVM partition why bother with other Linux partitions? You can use LVM tools to create as many logical volumes (LVs) as the Volume Group (VG) has space for.

Satyaveer Arya 03-19-2012 06:01 PM

You have to choose anyone from 1 to 4 numbered partitions.

michaelk 03-19-2012 06:49 PM

Any primary partition can be the extended partition.

It appears the problem is fdisk will only allow the creation of 15 partitions. What version of Redhat are you running? What kernel version are you running. This was an old limitation of the SCSI subsystem that AFAIK was fixed in the 2.6.28 kernel.

You could create a primary partition but with the remaining unallocated space the size will only be around 8 MB. Without knowing if the linux partitions contain i.e. data or multiple OSs it is difficult to provide you with options

syg00 03-19-2012 06:49 PM

The libata libraries emulate SCSI - 15 partitions is the nominal limit, unlike the older IDE interface.
I guess fdisk is just giving you the option to create the primary partitions that were skipped when the extended was created. Of course that would require space outside of the extended ...

mail2vivek1 03-20-2012 01:05 AM

First of all, Thank you for looking into this issue..

Offcourse 18 is not in range of 1 to 4. But when i enter 1, it says delete the partition before you create it. when i enter 2-4, it take just default value and do nothing. As i was already having sda15, so was trying to create partion 16,17,18..

Yes I have LVM, i can use it also..but what i was trying to do was, i was trying to delete this LVM partition and then was trying to create new partion.. I am just doing experiments to learn more..

mail2vivek1 03-20-2012 01:40 AM

@ michaelk

Below are the details

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

kernel :- 2.6.18-164.el5PAE.

Please help me to create extended partitions.

michaelk 03-20-2012 06:30 AM

You can not create any more without deleting an existing partition.

ab1jx 05-05-2020 07:19 PM

There are by design 4 slots for primary partitions because that was considered to be enough. Then extended partitions were invented. They're a linked list, you put one in one of the primary partition slots and you can create logical partitions inside it. Which is why a first logical partition is always partition #5, 1-4 are for primaries. You can still use an empty one of the primary slots even later if you have sectors free or free them. Some things can only be in a primary slot.

Being a linked list the first logical partition has a link to the next one, and that links to the next one, etc. until the end of the sequence doesn't have a link. In programming linked lists are usually done with pointers, here they're probably just special files like subdirectories are just files. I'm not sure there's a limit on the number of logical partitions as long as you have the disk space.

Why are you trying to make partition #18? The next logical partition should be #16. fdisk needs to open its record for #15 and add one to the end. Then there'll be a place to add #17 on the end of #16. And if you add #17 finally there'll be a place for #18. You also still have primary slots 3 and 4 open.

michaelk 05-05-2020 07:58 PM

ab1jx,
Do you realize you were replying to a 8 year old thread? The disk was almost completely allocated except for a small space between sda15 and sda5. Currently, as is you could not create an additional primary partition without moving that free space outside of the extended partition. The OP was intent on creating additional logical partitions but at that time the thread was created with the existing kernel that was impossible.

ehartman 05-05-2020 11:45 PM

Quote:

Originally Posted by ab1jx (Post 6119789)
There are by design 4 slots for primary partitions because that was considered to be enough.

And there isn't room for more in the 512-byte MBR
Those 4 entries already take up 64 bytes of those an we still need room for the bootloader code etc

Quote:

They're a linked list, you put one in one of the primary partition slots and you can create logical partitions inside it.
One at a time, the 2nd entry is for the next extended partition entry. So indeed the "extended" partition contains actually a chain of extended partition tables, they do not even use the 4 possible entries in each of them.


All times are GMT -5. The time now is 12:08 AM.