Only 4 partitions available after resizing drive with XP on it
Nigel Henry
cave.dnb at tiscali.fr
Sun Jul 15 17:13:22 UTC 2007
On Saturday 14 July 2007 18:45, Mikkel L. Ellertson wrote:
> Nigel Henry wrote:
> > As it's quite this afternoon, I thought I'd ask this question, as it's a
> > bit puzzling to me.
> >
> > A while back as I'd run out of available harddrive space for new FC
> > versions, I resized the original harddrive from this machine that had XP
> > preinstalled on it, using the gparted live cd, and it went like
> > clockwork. XP with 12GB, and the rest was now free space.
> >
> > Next I install Kubuntu on the drive, giving it a /, and a /home
> > partition, let it have half of the freespace, as I also wanted somewhere
> > for another instance of FC5. For some reason custom partitioning named
> > the partitions as hda5, and hda6 for / , and /home respectively, and
> > Kubuntu didn't ask, and I couldn't find a way to make a swap partition.
> > No problem as there is 1GB of RAM on the machine. So far so good. Grub's
> > in the MBR, and both Kubuntu, and that other OS bootup ok.
> >
> > Now it gets confusing.
> >
> > I go to install FC5, again with custom partitioning as I always do, and
> > create a / partition of 9GB. No problem. Next create a /home partition of
> > 4GB, and again no problem. Now I try to create a swap partition, and get
> > a complaint about not enough partitioning space, or something like that,
> > even though there is just on 1GB of harddrive space available.
> >
> > Now I remove the 4GB home partition, and try to create the swap partition
> > again. This time no problem, and I have an 800MB swap partition. Now I
> > try to recreate the /home partition (4GB, and enough space), but again a
> > no-go, and a complaint about not enough partitioning space/no partitions
> > available.
> >
> > Ok. I'm not too bothered about the swap, so I remove the swap partition,
> > and use all the available free space to recreate the /home partition, put
> > Grub in the / partition for FC5, and some time later after editing
> > Kubuntu's /boot/grub/grub.conf, adding a chainloader to FC5's root
> > partition, all 3 OS's boot ok.
> >
> > The confusing bit is the available partitions. XP has got hda1, Kubuntu
> > has got hda5, and hda6, and FC5 has got hda3, and hda4. Quite why Kubuntu
> > was given hda5, and 6 when it was installed 1st, and FC5 was given hda3,
> > and hda4 I don't know, but either way it would appear (leaving out XP
> > from the equation) that there are only 4 available partitions left on
> > this drive for Linux.
> >
> > I've probably done something wrong somewhere, but can anyone shed any
> > light on this confusing problem.
> >
> >
> > Nigel.
>
> You need to understand the way the partition table works. With a DOS
> partition table, you only have 4 primary partitions. One of more of
> these can be extended partitions. This is partition 1 through 4. If
> you have extended partitions, you can have 1 or more logical
> partitions in the extended partition. The logical partitions
> numbering starts at 5.
>
> Kubuntu created an extended partition, and then created logical
> drives inside the partition. This is why is is using hda5 and hda6.
> Fedora create two primary partitions. We are now out of primary
> partition "slots".
>
> hda1 - primary - XP
> hda2 - extended
> hda3 - primary - Fedora
> hda4 - primary - Fedora
>
> hda5 - logical - Kubuntu
> hda6 - logical - Kubuntu
>
> What you probably want is something like:
>
> hda1 - primary - XP
> hda2 - extended
>
> hda5 - logical - Kubuntu
> hda6 - logical - Kubuntu
> hda7 - logical - Fedora
> hda8 - logical - Fedora
> hda7 - logical - swap
>
> I am not sure, but you may be able to use gparted to delete the hda3
> and hda4 partitions, and extend the hda2 extended partition. You can
> then ether create the extended partitions for Fedora, or let the
> installer do it for you.
>
> Mikkel
Thanks for all the replies. In the past I've used Windows fdisk which is on an
ME boot floppy to partition new drives prior to installing any distro's on
the drives. So I would create the 1st partition as a primary, next create an
extended partition (which uses up all available space to the end of the
drive). I've then created as many logical drives as I need in the extended
partition, but It probably would be better to just leave the newly
partitioned drive with just a primary, and the extended partition, then save,
and quit fdisk.
Now I'd install the first distro. / on hda1 (primary). hda2 is extended, /home
would take hda3 (logical drive), swap hda4 (logical drive). Job done, and
subsequent distros installed on the drive would all be logical drives, using
whatever space was still available in the extended partition.
As I said it was the first time I'd resized an NTFS drive using the Gparted
live cd, and was just left with a bunch of freespace to work with.
What you show above is verified by fdisk -l output below for that disk.
Disk /dev/hda: 41.1 GB, 41174138880 bytes
255 heads, 63 sectors/track, 5005 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1530 12289693+ 7 HPFS/NTFS
/dev/hda2 1531 3232 13671315 5 Extended
/dev/hda3 3233 4316 8707230 83 Linux
/dev/hda4 4317 5004 5526360 83 Linux
/dev/hda5 1531 2624 8787523+ 83 Linux
/dev/hda6 2625 3232 4883728+ 83 Linux
When I started to custom partition for Kubuntu, I probably should have
specified the / partition to be a primary (hda2), and the /home partition
also a primary (hda3), then the remaining primary would have been used as the
extended (hda4), and would have had no problems adding up to 12 logical
drives, starting with (hda5).
I think it comes down to me being too used to the way that the Windows fdisk
gives you 1 primary, then an extended partition with up to 23 logical drives,
whereas the Linux fdisk gives you 4 primaries, and if you've got your act
together, and use the first 3 primaries first, the 4th one can be used as an
extended one, with up to 12 logical drives.
Just for the sake of it, I've put Webmins output below. IDE device A is the
one we've been discussing above, and at the bottom asks if I want to add a
logical partition. Of course I can't, because apart from the drive being
full, The logical partition hda6 ends at 3232, and is followed by the primary
at hda3, which starts at 3233, and there's nowhere to create another logical
partition. I suppose if I'd been more clued up, I could have created a start
point for FC5's / partition (hda3) further on in the drive, perhaps starting
at 4000, which would have left enough space to create another logical
partition between 3233 and 3999, and could have put a bit of swap there.
Out of interest, further down on Webmins output is the setup for IDE device B.
This is the fixed drive in the machine. Originally partitioned using XP, and
as NTFS. I've since used Webmin to change the partitions to FAT32, so that I
can save and retrieve data for whichever distro is up and running at the
time. What's interesting is that XP shows the partitions sequentially, but
Webmin misses out hdb3, and 4, which would be primaries on a Linux fdisk
partitioned drive. Hdb2 is there, and Webmin is recognising it as a primary,
but being used as an extended partition.
It's interesting that at the bottom of the list of partitions for IDE device B
that Webmin not only asks if you want to add a logical partition, but also if
you want to add a primary partition (which would be hda3, and possibly hda4).
In reality if you had the harddrive space available, you could simply add
more logical partitions with no problems, and leaving the missing hdb3, and
hdb4 primaries out of the equation. If though you decided to add a primary
(hdb3), this would have a start point immediately following the end point for
the extended partition (hdb2), and it would no longer be possible to add
logical partitions as hdb6's end point is 5005, and hdb's start point would
be 5006, that is unless you gave hdb3 a start point much later on, say for
example a start point of 7000 for hdb3, then you would have from 5007 to 6999
to add logical partitions.
Location IDE device A
Cylinders 5005
Size 38.34 GB
Model ExcelStor Technology J240
Edit IDE parameters. | Show SMART status.
No. Type Extent Start End Use Free
1 NTFS 1 1530
2 Extended 1531 3232
3 Linux 3233 4316 / 38 %
4 Linux 4317 5004 /home 85 %
5 Linux 1531 2624
6 Linux 2625 3232
Add logical partition.
Location IDE device B
Cylinders 5005
Size 38.34 GB
Model HDS722540VLAT20
Edit IDE parameters. | Show SMART status.
No. Type Extent Start End Use Free
1 Win95 FAT32 1 1275 /mnt/hdb1 23 %
2 Extended 1276 5005
5 Win95 FAT32 1276 2678 /mnt/hdb5 22 %
6 Win95 FAT32 4592 5005 /mnt/hdb6 15 %
7 Win95 FAT32 2679 4591 /mnt/hdb7 15 %
Add primary partition. | Add logical partition.
Forgive what may appear to be ramblings, but I have learned a lot about
Linux's fdisk from all your replies. As usual, any comments welcome.
Nigel.
Weather in Northern France, if I've got the C to F right is 77°F, bit of
thunder and rain first thing this morning, and currently a bit humid, and
cloudy. UTC+2.
More information about the fedora-list
mailing list