Partitioning for Linux

Posted on 1997-06-16
Medium Priority
Last Modified: 2013-12-15
I am having trouble partitioning my hard drive for Linux.
I have a Western Digital 2.1 gig EIDE drive in a AMD 5x85 133 PC with an IDE CD ROM and 3.5 " 1.44 floppy 24 Meg memory.

Note, when I installed the 2.1 gig hard drive, to replace a
failed 540 Meg drive, my plan was to divide the drive between Win95 and Linux. Since I had read that Linux might have problems booting if loaded in a partition that started above 1024, I set up Win95 drive C at the beginning of the drive and the Extended DOS partition (drive D) at the end, leaving the middle available for Linux.  I can successfully create a Linux swap partition and a Linux native partition. My question is, how can I set up the 902 meg section in the middle with a Linux swap partition, and two native partitions, one for root and one for everything else?

DOS FDISK information
Part. type  Mbytes -------  Usage  ID  size
 1 A Pri DOS 504    FAT 13   25%   C  528,482,304
 2   Non DOS 902             45%      945,815,552
 3   Ext DOS 606             30%   D  635,437,056

Linux Fdisk information
          beg  start   end    blocks    ID system
/dev/hda1 1     1      256    516,064+   6   DOS 16-bit>=32
/dev/hda3 715   715    1022   620,928    5   Extended
/dev/hda5 715   715    1022   620,896    6   DOS

Linux verify reports 1850812 unallocated sectors
I assume the 1,850,812 sectors lie in the area between 257
and 714.
at this point if I try to create a new logical partition Linux Fdisk reports  "no free sectors" when I specify a 'l'
as the partition type.

I then sucessfully allocate a primary 96 Meg swap partition and a 75 Meg primary Linux native partition.
If it would be helpful, I can supply a partition map from
Linux Fdisk at this point.

I then try to alloc another primary partition and the system responds "No free sectors", if I try to alloc a logical partition I also get "No free sectors"
if I use the Verify command I get 1,495,996 unallocated sectors.

Question by:rking

Author Comment

ID: 1628236
Edited text of question
LVL 13

Expert Comment

ID: 1628237
i have a western digital 3.2gb and my
linux partition is the third gig out at
the very end, doubtless well past the
1024th cylinder, though i havent checked.  
you might try just putting it at the end
of the disk anyway.  where did you hear to
put it before 1024?

Expert Comment

ID: 1628238
the 1024 Cylinders limitation only applies to old bioses which don't know LBA access. If your machine is less than three years old, you don't have to care about it (just look at the more in the setup, but if Win95 can acces the drive, linux can do so).
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.


Author Comment

ID: 1628239
The question is HOW DO I GET 3 Linux partitions in the 902 meg
section of my drive.  The part about 1024 Megs was to explain
why I put the Linux disk area in the middle.
LVL 13

Expert Comment

ID: 1628240
oh, well in that case, i thought i read in
the linux install docs that if you are
putting linux in with another OS you
should make the linux partitions with that
other OS's fdisk (dos's in your case) and
then use linux's fdisk to merely set the
types (linux native, linux swap, etc).  i
used os/2's fdisk to make the linux
partitions and then turned them to type 83
and 82 (i think those are the numbers)
with the linux fdisk.  worked fine for me.
i couldn't get more than three primary
partitions on the same drive though, so
the two linux ones are both extended as
far as os/2 cares, but since they are
formatted with the linux file system the
are invisible anyway.
hope this helps.

Author Comment

ID: 1628241
To be sure I understand your answer: I should use win95 and create a primary and extended partition. In the extended partition I create dos partitions for win95 and Linux. I then use
Linux fdisk to change the partition types to Linux.

Accepted Solution

pc012197 earned 100 total points
ID: 1628242
The master boot record (MBR) of a disk can only hold information on 4 partitions. One of these can be an extended partition, which may contain several 'logical partitions'.
You now have a primary DOS partition and an Extended partition containing a logical DOS partition.
If you add a linux root partition and a linux swap partition, you have defined 4 partitions in the MBR, leaving no space for another one. And you can't create another logical partition within the extended one, because all space in the extended partition is used up by the logical DOS partition.
To solve your problem you will have to delete and re-create the extended partition:
1 Primary DOS partition (25% of space)
2 Extended partition (rest)
Within the extended partition, create logical volumes using 45% and 30% of space respectively. The latter one is your logical DOS partition.
Boot linux and use fdisk to delete the 45% non-dos partition, and create your linux partitions as logical partitions within the extended one.
You may run into trouble here, because I don't know if you can boot linux from a logical partition. Perhaps you have to leave a little space (7%-8%) between the primary DOS partition and the extended partition. That space would be filled by your linux root partition later.


Author Comment

ID: 1628243
The andwer did not tell me how to create 4 linux partitions so
I can have a root partition, a usr partition, a user partition, ect, and that was my question.  I can leave the dos partitioning
as it is and create a 96 Meg Linux swap file and an 806 Meg Linux
boot root everythig partition. I have in fact done that and proceded with the instalation.  pc provided good information, and by extrapolation I could create a small native partition for boot root and then create as many logical partitions as I wanted.  I didn't want to go through backing up my D drive and recreating the Dos extended partition.

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question