PDA

View Full Version : Fdisk Results...



AliOop
13th December 2004, 06:06 PM
Sometime ago I commented about my foray into Slackware. I won't get into that distro as its not relevent to this thread. The only reason I mention Slackware is because I had to learn one of the partitioning programs to prepare my HD for installation. My choice was either cfdisk or fdisk. I used fdisk because of some good instruction on how to use it. Well, now I'm tinkering around with Ubuntu on a test box.

Looking over some printout on a veriety of things I've kept for future use, I came across fdisk. I decided to test it with my Ubuntu/testbox. This test box at one time came with WinXP. I have never dual booted any of my PCs. So when I did a 'sudo fdisk /dev/hda' I was surprised to see this result:

Command (m for help): p

Disk /dev/hda: 20.4 GB, 20416757760 bytes
16 heads, 63 sectors/track, 39560 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 38567 19437736+ 83 Linux
/dev/hda2 38568 39560 500472 f W95 Ext'd (LBA)
/dev/hda5 38568 39560 500440+ 82 Linux swap

Command (m for help):


As you can see my HD has three partitions. Out of a 20G HD, about 19 of it is devoted to root. Half a gig is set aside for the swap partition. But, and this is what threw me for a loop, half a gig is labled W95 Ext'd (LBA). Since I did a full install when I loaded Ubuntu and I let the installer take over I expected the whole drive to be all Linux. My question is should I be concerned over this. Is this normal? If not can I delete this partition and how would I go about revovering it? Thanks. for any input.

jtang613
13th December 2004, 06:44 PM
What you have here is a Primary partition for the root directory /
and an Extended partition containing the swap partition.

This often occurs with 'automatic partitioning' and is really nothing to be concerned over. The reason behind it is that current computers only support a total of 4 primary partitions. Therefore, in order to get around this limitation, extended partitions are created. This allows more that 4 partitions to exist because the extended partition exists as a primary partition, but contains other partitions inside it.

You can safely remove the extended partition and recreate the swap partition as a primary partition by booting into rescue mode from the FC install disk. You will need to update your /etc/fstab file after doing this.

Tools to use: swapoff mkswap swapon fdisk

jarifed
13th December 2004, 07:23 PM
why is it showing in the extented partition
W95 Ext'd (LBA) and not
Extended

As it has been formatted under Ubuntu I would expect
/dev/hda2 38568 39560 500472 5 Extended
/dev/hda5 38568 39560 500440+ 82 Linux swap

and not
/dev/hda2 38568 39560 500472 f W95 Ext'd (LBA)
/dev/hda5 38568 39560 500440+ 82 Linux swap

jtang613
13th December 2004, 08:16 PM
why is it showing in the extented partition
W95 Ext'd (LBA) and not
Extended

This is because W95 Ext'd is the most common form - and is generally recognized by every OS / partition tool. The other is less common and might not be universally recognized.

Jason

jarifed
13th December 2004, 08:58 PM
Why would it want to be recognized by another OS?? The whole box is linux.
Even if it was a dual boot wouldn't it be a possibility that the other OS would recognise it. I have been today creating a physical volumes/volume group and logical volume and creating mkfs.ext3 on fedora core 3 (old w95 vfat32) not changing to 83 When booting in windows the file system was still recognised and when selecting it, it ask the question to format it.
I have changed it to 83 and it does not show up in windows anymore and no more nasty questions.

jtang613
13th December 2004, 09:24 PM
Why would it want to be recognized by another OS?? The whole box is linux.
A partition cannot "want" anything grasshopper. It is inanimate. However, there are many users who have more than one OS installed and require extended partitions for purposes other than Linux. The Extended Partition Container is invisible to the OS for most purposes. Type 0x0f (W95 Ext'd (LBA)) just happens to be the standard for this purpose. There are also types 0x05 (Extended) and 0x85 (Linux Extended). Which type you choose is up to you.


Even if it was a dual boot wouldn't it be a possibility that the other OS would recognise it.
Yes. There is a good possibility that most OS's would recognise it as an Extended Partition Container. However, this does not necessarily mean that the Linux partitions inside this Extended Partition Container will be seen by other OS's. Refer to the diagram that I posted.


I have been today creating a physical volumes/volume group and logical volume and creating mkfs.ext3 on fedora core 3 (old w95 vfat32) not changing to 83 When booting in windows the file system was still recognised and when selecting it, it ask the question to format it.
I have changed it to 83 and it does not show up in windows anymore and no more nasty questions.
It is necessary to change the partition type code when you install Linux to an existing partition. No one has disputed this. Usually this is done automagically by the installer. However fdisk can reassign type codes quite easily too.

Jason

jarifed
13th December 2004, 09:38 PM
thnxs
points taken

grasshopper