Operating System - Linux
1753943 Members
8863 Online
108811 Solutions
New Discussion юеВ

Re: how to use 5th partition?

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how to use 5th partition?

I have already used up 4 patitions, 1 of them for window NT, two for linux, and last one for bootitNG (a parition tool).
Now I have one more partition unused, and wanted to add it into one of linux partition, how do I do that?
If I hvae to use any extra tools to achieve that, where I can get that tool? please also specify it.

Thanks,
none
13 REPLIES 13
Mark Grant
Honored Contributor

Re: how to use 5th partition?

This one bothers me somewhat as you can only have four primary partitions on an ide disk. If you really have five partitions, perhaps one is extended then one thing you can do with it is add to a volume group under linux or just create a linux file system.

If you create a volume group and vgextend it to include your fifth partition, you can create fileystems that extend across the two partitions and you can increase and decrease the size of them as your needs change.

However, if you just create a file system on your fifth partition it will be just one filesystem that you can use for storage but it isn't as flexible.

Check out linux LVM
Never preceed any demonstration with anything more predictive than "watch this"
Hanry Zhou
Super Advisor

Re: how to use 5th partition?

You have to create the partition first before you can use LVM to add the partition into a volume group. It won't let me create a new partition, since the number of primary paritions have already reached, as you inidicated.

Anybody idea else?
none
Mark Grant
Honored Contributor

Re: how to use 5th partition?

Ahhh,

The only way you can get more than 4 partitions is to make one of your existing partitions contain several extended partitions which will destroy any existing data in it.

However, you say that bootitNG uses an entire partition. This seems a bit extreme to me. Are you sure?

From Linux, if you run fdisk /dev/hda (assuming that is the device for your disk and then enter "p", it will show you if you have any unpartitioned sace you can use.

WARNING do not change any partion information you have unless you are confident that it is right or you will destroy things. particularly don't change partitions you have an OS installed in.
Never preceed any demonstration with anything more predictive than "watch this"
Hanry Zhou
Super Advisor

Re: how to use 5th partition?

Mark,

Thanks for your response.

Bootit did use the entire partition as seen in fdisk.

Now, the questions is, can I use /dev/hda4 being used for linux swap as a extended partition, then from which to create logical partition? Since I don't want to destroy any data on other 3 paritions: linux, win NT, and bootit.

Thanks again,
none
Jerome Henry
Honored Contributor

Re: how to use 5th partition?

Hi,

As Mark says, you can only have four primaruy partitions on an IDE disk. If your partitions are hda1, hda2, hda3 and hda4, all primary, then you can't change witgout distroying data on your last partition. Check it with fdisk /dev/hda, then p to see the details.

hth

J
You can lean only on what resists you...
Hanry Zhou
Super Advisor

Re: how to use 5th partition?

J,

I know everything you said here, but since I have already used all these 4 partitions, and how I can create extended partition, then from there to create logical paritions. I know I have to destroy one of existing 4 partitions in order to setup the extended one, so can I destroy the "linux swap" first, then create the extended one on it?

none
Patrick Van Humbeeck
Valued Contributor
Solution

Re: how to use 5th partition?

Hello,

You can remove your swap partition and then recreate it inside your new extended partition.
Be sure to turn it off first with swapoff /dev/hda4 (assuming it's hda4).
Providing your system has enough ram this should not be an issue but I would do this in single user mode, (or maybe even better, by booting from an install CD (in witch case you dont need to deactivate it)).

If you do it from the running system you can temporarily add a swap file on the linux partition like this :

# dd if=/dev/zero of=/swap bs=1024 count=16384
# mkswap /swap 16384
# sync
# swapon /swap

once you got rid of it (swapoff) you can just scratch the partition and recreate from fdisk, be sure to recreate an extended partition for swapping inside the new extended one, along with any more partitions you want to create.

you can then reactivate it with

# mkswap /dev/hda5 (assuming hda5, extended partitions start with 5)
# sync
# swapon /dev/hda5

and then deactivate the temporary swap file you might have created.

be sure to modify /etc/fstab ! you need to change whatever your previous swap partition was into the new one.


hope this helps :)
Hanry Zhou
Super Advisor

Re: how to use 5th partition?

Patrick,

Your posting definitely helps me a lot.

Now only one question (I hope) left is what steps involved to setup extended partition, and create logical partition inside of extended? I assume I can use fdisk to achieve that, but can you list these steps for me?

Thanks,
none
Eric Ladner
Trusted Contributor

Re: how to use 5th partition?

Once you get into fdisk, it's pretty obvious. The dos fdisk.com makes a distinction between creating a primary and creating an extended partition (they are different menu items).

The linux fdisk asks you when go through creating a partitoin what type you want it to be (primary/extended).

You can probably also use tools like partition magic to convert your last primary partition into an extended partition so you don't have to mess with the data that much, otherwise you have to destroy the fourth partition to create the extended partition.