LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How can I create extended partition without GParted? (https://www.linuxquestions.org/questions/linux-hardware-18/how-can-i-create-extended-partition-without-gparted-619970/)

alan_ri 02-09-2008 04:13 PM

How can I create extended partition without GParted?
 
Please don't ask me why I wanna do this,thanks for any help! ;)

saikee 02-09-2008 04:22 PM

Easy.

Try fdisk, available virtually in every Linux.

You can do it with cfdisk too but it doesn't have a facility to create one. However the first logical partition created the next primary partition slot, first one of sda1 to sda4 or hda1 to hda4 that has not been used, will be converted to the "extended partition". It is far better for the understanding of how an extended partition works.

Extended partition has no usable storage of its own. Users only store data in logical partitions. The extended partition is just a "border" defining the first sector of the first logical partition and the last sector of the last logical partition.

If you use terminal partitioning tools you can understand better how partitioning works. Gaparted actually does formatting in the same process so it complicates the matter.

esteeven 02-09-2008 04:22 PM

Have you looked at cfdisk?

edit: beaten

alan_ri 02-09-2008 04:49 PM

The reason I am doing this is because I have 4 primary partitions,and I want to be able to boot some more OS-s,and the only way to do this is(I guess) by creating extended partition under primary partition.I don't have fdisk or cfdisk installed.I was looking for a way to do this from a CLI without any program,just simply by entering commands,can I do this?

syg00 02-09-2008 04:54 PM

No.
[c]fdisk is the command.

Wouldn't help anyway - the extended has to be one of the 4 base (primary) partitions. You'll have to delete (at least) one of your current partitions to get anywhere.

esteeven 02-09-2008 04:59 PM

How do you know that they are not installed? They usually are!! Have you tried ~>cfdisk {insert disk here} ??

alan_ri 02-09-2008 05:08 PM

Thanks for the explanation syg00,I never used it so I did't know if it is program or command,but I remember when installing some OS it prompted me with that if I wan't to boot it I had to make extended partition under primary one,but did't suggested that I have to delete primary partition(there was 4 of them),and I don't wanna do that if it's possible.

alan_ri 02-09-2008 05:11 PM

esteeven:command not found

lazlow 02-09-2008 05:47 PM

Alan

How are you becoming root and trying to find fdisk? If you use su you have to use su - in order to get the path. I have never seen a distro that did not include fdisk as part of the standard install.

syg00 02-09-2008 06:51 PM

Doesn't need root, just need the proper pathing - Fedora do stupid things like that. Should work as "/sbin/fdisk ...".

There are commercial (Windoze) products (Partition Magic I would guess) that can convert one of your primaries to an extended. To do it manually you really need to back the data up and delete, allocate as extended (or logical if using cfdisk) and bring the data back. Parition number will change - can cause grief depending on your setup.
Also there can be issues of broken areas of free space being inaccessable - but that is no more likely than your present arrangement.

lazlow 02-09-2008 07:42 PM

sysg00

You are right about just needing the path. I would argue that it is not stupid. Do you really want just any user to be able to run fdisk?

syg00 02-09-2008 08:20 PM

<rant>
Anybody can run "/sbin/<command-name> ..."
Security by obscurity ??? - nah, that's stoopid.

Ubuntu are equally (more) ludicrous - "fdisk -l" returns nothing; no message, nada.
"fdisk /dev/sda" gets "Unable to open /dev/sda". That at least hints at the solution - you need to use sudo.
Everybody (on standard install) probably has access to everything via sudo.

Bloody ridiculous.
</rant>

jay73 02-09-2008 08:37 PM

And how is that different from everyone having access to everything using su -? If anything, sudo is the more flexible solution. The administrator can set up access to all, some or none of the potentially dangerous commands - and do that in a matter of seconds.
Also, security through obscurity is more helpful than you seem to think. Few administrators, regardless of OS, would fancy giving away what is installed or not. Sure, obscurity alone won't cut it but it is part of a good security policy.

syg00 02-09-2008 09:37 PM

We can argue this elsewhere - not strictly relevant to this thread.

alan_ri 02-10-2008 05:51 AM

It is here,now.Ok,my device is /dev/hda,and when I type: fdisk /dev/hda,this is what I get:

[root@localhost alan]# fdisk /dev/hda

The number of cylinders for this disk is set to 9729. 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)

Unable to seek on /dev/hda

[root@localhost alan]#

Can you tell me what are the next steps to create that extended partition,or maybe I shouldn't,cause maybe I wan't be able to boot from there or will I?Also,why is there limitation with 4 primary partitions and what has to be done to have 10 OS on one HD?


All times are GMT -5. The time now is 12:11 PM.