Partitioning for Linux

Posted on 1997-06-16
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).
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

776 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