# Add partition to disk

**URL:** https://forums.suse.com/t/add-partition-to-disk/21866
**Category:** SLES Configure-Administer
**Created:** [November 17, 2011, 9:46pm UTC](https://forums.suse.com/t/add-partition-to-disk/21866 "2011-11-17T21:46:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![System1](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@System1](https://forums.suse.com/u/System1)
#### Post date: [November 17, 2011, 9:46pm UTC](https://forums.suse.com/t/add-partition-to-disk/21866/1 "2011-11-17T21:46:01Z")

</div>

Attempting to add a partition to a disk. I am not sles expert but I  
have been successful before but not this time. Below is the output from  
the terminal.

Shouldn’t I be able to enter fdisk /path/to/disk and then enter n and  
add a partition? What am I forgetting.

SLES-XEN:/ # fdisk -l /dev/cciss/c0d1

Disk /dev/cciss/c0d1: 899.9 GB, 899898718208 bytes  
255 heads, 32 sectors/track, 215393 cylinders  
Units = cylinders of 8160 \* 512 = 4177920 bytes  
Disk identifier: 0x0006a452

Device Boot Start End Blocks Id System  
/dev/cciss/c0d1p1 1 35903 146484224 5  
Extended  
/dev/cciss/c0d1p2 35905 61034 102526830 83 Linux  
Partition 2 does not end on cylinder boundary.  
/dev/cciss/c0d1p3 61034 86627 104422500 83 Linux  
Partition 3 does not end on cylinder boundary.  
/dev/cciss/c0d1p4 86627 117419 125628300 83 Linux  
Partition 4 does not end on cylinder boundary.  
/dev/cciss/c0d1p5 1 23935 97654768 83 Linux  
/dev/cciss/c0d1p6 23936 35903 48829424 86 NTFS  
volume set  
SLES-XEN:/ # fdisk /dev/cciss/c0d1

The number of cylinders for this disk is set to 215393.  
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  
No free sectors available

Command (m for help):

## – jmcg

jmcg’s Profile: [http://forums.novell.com/member.php?userid=3475](http://forums.novell.com/member.php?userid=3475)  
View this thread: [http://forums.novell.com/showthread.php?t=448383](http://forums.novell.com/showthread.php?t=448383)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [November 18, 2011, 3:46pm UTC](https://forums.suse.com/t/add-partition-to-disk/21866/2 "2011-11-18T15:46:02Z")

</div>

jmcg,

from the output of “fdisk -l” you can see that you have four primary  
partitions defined, partition 1 being the extended partiton from cyl 1  
to 35903. All space of that extended partition is used by p5 & p6, all  
four partition slots are used so no primary partitions can be created.  
So the complaint from fdisk when adding another partition looks  
plausible.

Regards,  
Jens

## – from the times when today’s “old school” was “new school” :eek:

jmozdzen’s Profile: [http://forums.novell.com/member.php?userid=32246](http://forums.novell.com/member.php?userid=32246)  
View this thread: [http://forums.novell.com/showthread.php?t=448383](http://forums.novell.com/showthread.php?t=448383)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [November 18, 2011, 6:26pm UTC](https://forums.suse.com/t/add-partition-to-disk/21866/3 "2011-11-18T18:26:02Z")

</div>

Thanks and so my learning about linux continues. What is the advantage  
vs disadvantage of using primary vs extended partitions? It seems that  
one should have extended partitions on large disks. I can see how to  
fix my problem but want to know why I would designate a partition as  
primary or extended.

## – jmcg

jmcg’s Profile: [http://forums.novell.com/member.php?userid=3475](http://forums.novell.com/member.php?userid=3475)  
View this thread: [http://forums.novell.com/showthread.php?t=448383](http://forums.novell.com/showthread.php?t=448383)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [November 18, 2011, 8:36pm UTC](https://forums.suse.com/t/add-partition-to-disk/21866/4 "2011-11-18T20:36:02Z")

</div>

jmcg,

primary partitions have a disadvantage: You only have four of them.  
(Comes from my earlier days… 64k will always be sufficient… why more  
that 4 partitions on a 10MB disk?) With bigger disks (40MB? 😃 )  
therefore a specific type of primary partition was defined - the  
“extended partition”, which is nothing more than a construct to create  
more partitions (itselves sometimes called extended partitions,  
sometimes “logical drives”). But still the space defined for the  
“extended partition” (the one in the primary partition table) is valid  
for the sum of all sub-partitions.

Primary partitions are old-school… I guess nowadays you get away with  
defining one huge “extended partition” and creating lots of  
sub-partitions in there. Technically speaking extended partitions take  
time to scan, since an auto-created sub-partition table is at the  
beginning of each sub-partition, with a single entry plus a pointer to  
the next sub-partition… but that’s no real show stopper: How often do  
you need to scan those tables?

If you know that you will have four or less partitions on the disk,  
stick with simple primary partitions. If unsure, let at least p4 be an  
extended partition with the remainder of the disk.

Just my few cents 😉

Regards,  
Jens

## – from the times when today’s “old school” was “new school” :eek:

jmozdzen’s Profile: [http://forums.novell.com/member.php?userid=32246](http://forums.novell.com/member.php?userid=32246)  
View this thread: [http://forums.novell.com/showthread.php?t=448383](http://forums.novell.com/showthread.php?t=448383)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/5/5012ba89e3ffb5220dac47d5ea0ba032e2fe1cb6.png) [@system](https://forums.suse.com/u/system)
#### Post date: [November 22, 2011, 2:06am UTC](https://forums.suse.com/t/add-partition-to-disk/21866/5 "2011-11-22T02:06:02Z")

</div>

Thank you for the reply.

I have created a problem for myself. I have deleted out the entry in  
my partition table. The server is still running on the old partition  
table that is correct, but if the system reboots I will lose the  
partition in the table. I need to set my partition back the way it was.  
I have a copy of the table as I want it, but am concerned that if I set  
the cylinders to the orginal and write it to the table I would lose  
data. Below I have pasted in the correct table (the first or top one)  
and the current one that is written to memory.

Can I create a new partition from the free space, using the same  
cylinders I was using before and write it to the table without losing  
data?

The data I need is in the first table listed as /dev/cciss/c0d1p2  
35905 61034 102526830 83 Linux

Disk /dev/cciss/c0d1: 899.9 GB, 899898718208 bytes  
255 heads, 32 sectors/track, 215393 cylinders  
Units = cylinders of 8160 \* 512 = 4177920 bytes  
Disk identifier: 0x0006a452

Device Boot Start End Blocks Id System  
/dev/cciss/c0d1p1 1 35903 146484224 5  
Extended  
/dev/cciss/c0d1p2 35905 61034 102526830 83 Linux  
/dev/cciss/c0d1p3 117420 215393 399733920 83 Linux  
/dev/cciss/c0d1p4 86627 117419 125628300 83 Linux  
/dev/cciss/c0d1p5 1 23935 97654768 83 Linux  
/dev/cciss/c0d1p6 23936 35903 48829424 86 NTFS  
volume set

Partition table entries are not in disk order

BAD TABLe

Disk /dev/cciss/c0d1: 899.9 GB, 899898718208 bytes  
255 heads, 32 sectors/track, 215393 cylinders  
Units = cylinders of 8160 \* 512 = 4177920 bytes  
Disk identifier: 0x0006a452

Device Boot Start End Blocks Id System  
/dev/cciss/c0d1p1 1 35905 146488686+ 5  
Extended  
/dev/cciss/c0d1p3 117420 215393 399733920 83 Linux  
/dev/cciss/c0d1p4 86627 117419 125628300 83 Linux  
/dev/cciss/c0d1p5 1 23935 97654768 83 Linux  
/dev/cciss/c0d1p6 23936 35903 48829424 86 NTFS  
volume set  
/dev/cciss/c0d1p7 35904 35905 4446+ 83 Linux

Partition table entries are not in disk order

## – jmcg

jmcg’s Profile: [http://forums.novell.com/member.php?userid=3475](http://forums.novell.com/member.php?userid=3475)  
View this thread: [http://forums.novell.com/showthread.php?t=448383](http://forums.novell.com/showthread.php?t=448383)
