"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis,
Starshine Technical Services, http://www.starshine.org/


(?) Partitioning Mini-HOWTO

From ariel lh on Fri, 12 Feb 1999

(?) Sorry for bothering you again but it seems that the "boot failed" message was just a bad diskette. I accesed the setup main menu and it asked me to configure the keyboard and i did, then i goes to: "partition your HD", when i go to the partitioning menu i detects my HDD when i press enter i get the message: "fatal error: bad logical partition". What should i do?, in the installation howto it says the partitioning option is for when my disk is not partitioned and it also says that if i already created a linux native and one linux swap disk partition i can skip the partitioning process.

In case i don't have to run the partitioning menu, how do i configure my existing partitions into linux native an linux swap partitions?

(!) So, you're trying to install some distribution of Linux. You don't mention which distribution so I'll guess it might be Red Hat. You don't mention what source you're trying to install from so I'd guess CD-ROM. You don't specify which platform so I'll guess it's some sort of PC.
Note: there are many distributions of Linux and many of them can be installed from any of many sources (from CD, floppy, MS-DOS hard drive partition, over FTP, NFS, or SMB/Samba -- from a copy stored on some Windows, OS/2 or other type of server). When posting questions to mailing lists and newsgroups you'll want to include a bit more detail. Remember that your readers don't know anything about your situation.
Now, to your problem. The setup/installation program you're using is offering to launch a program to partition one of your hard drives --- to reserve one or more regions of the disk space for use by Linux and mark them as such.
The exact dialogs and menus offered by this installation program depend completely on which distribution you're using.
Normally they will launch a program called 'fdisk'. There are many programs called 'fdisk' --- including the FDISK.COM (or FDISK.EXE) from MS-DOS, and those from OS/2, NT, other versions of Unix, and just about any other operating system available for the platform). Under Linux there are several versions of 'fdisk' to choose from. Most distributions include the old "shell mode" 'fdisk' and some also give you options to run a "friendlier" full-screen (curses based) program called 'cfdisk'.
Recent versions of Red Hat will offer to make many of the partitioning decisions for you --- using a program they call "Disk Druid." You supply it with the sizes and types of filesystems and swap spaces you want and it makes a corresponding set of partitions. It's a nice idea --- but I never use it personally (I've been working with micro-computers of one sort or another for almost 20 years).
Given that I don't know anything about your system I really don't know what is giving this error message. I presume that there is some gibberish in your partition table (specifically it sounds like some bogus enty in one of the extents --- the "logical" partitions inside of one of the extended partition tables.
Let's give a tiny bit of background here:
The first first addressable sector on a PC hard drive is called the MBR. This is 512 bytes long and consists of two parts --- a boot loader (a small program) and the primary partition table.
The primary partition table is 66 bytes long. This provides room for four partition table entries of 16 bytes each, and a two byte "signature" (magic number) that indicates that this MBR/partition table has been initialized.
When any version of 'fdisk' first reads the MBR for a given drive it is supposed to look for the "signature" (0xAA55 hex, or is it 0x55AA, I never remember that). If the last couple of bytes in the MBR don't match the signature then fdisk is supposed to assume that the drive has completely unitialized --- so that it won't attempt to interpret whatever random noise it finds therein (left there by the manufacturer's testing and/or production processes) as any sort of existing partition table.
Notice that there are only FOUR entries available on this table. So, if we are to have more than four filesystems/partitions on a drive we need some way to represent them. Thus there is a convention/standard that allows us to use ONE of those entries to point to an "extended" partition table. This essentially daisy chains from the boot sector to another sector. In the extended partition tables (there can be more than one --- since you can have about a dozen total) we have a whole sector, but only the last 66 bytes are used (the rest is normally "zero'd" out).
Getting back to your error message. If you don't have anything else installed on that hard drive you can ignore the error message and use fdisk to create your new partitions. If it won't "let you in" there could be other problems. I'd just boot on a rescue floppy (there should be one included on whatever CD you have, some where --- or you can get Tom's RTBT from http://www.toms.net/rb), and "zero out" the MBR with a command like:
dd if=/dev/hda of=/dev/zero count=1 bs=512
... assuming that you're using your first IDE hard drive.
Note: DON'T DO THIS IF YOU HAVE ANYTHING ELSE ON THIS DRIVE!
(You'll render any MS-DOS, Windows or other data on the drive inaccessible!).
If that still doesn't work, or if you have existing data on the drive that you want to keep --- then we'll have to work harder.
First: if 'fdisk' won't let you access the drive, even after you've "zero'd out" the MBR then you probably have some sort of unsupported drive/controller. It may be that you have a very large HD and a version of the kernel and 'fdisk' that doesn't support the huge newer drives.
There are some amazing convolutions that we've gone through in the design of PC peripherals over the years. These 10Gb hard disks that you can pick up for a couple hundred dollars are unimaginably expansive compared to the first 10Mb hard drive that I ever owned (about 12 years ago).
In the early days MSDOS had a 32Mb limit on it's hard drive filesystems. The BIOS under which MSDOS ran had a rather odd set of limits relating to the largest hard drive that was possible --- it addressed drives in CHS (cylinder, head, sector) format. Early ST-506 (MFM and RLL) hard drives typically had 17 to 23 sectors per track, maybe 5 or so heads and a few hundred cylinders.
The BIOS packed the cylinder/track and sector addresses into two bytes --- leaving 10 bits for the "cylinder" and only 6 bits for the sector. So you you could have up to 64 sectors (zero through 63) and 1024 cylinders. They did provide a full byte for the head. (This seems silly since a hard drive with 256 heads --- 128 platters would be about as tall as your desk, but I presume that it was "convenient" for the programmer due to how these parameters would be used with the controller.
Back then the CPU was involved in relatively low level details of head positioning --- so we used to tune the "interleave" on hard drives based on the relative speed of our components, so that logically "adjacent" sectors were actually physically separated, allowing the processing of one sector to account for the constant rotation velocity of the disk platter under the head --- meaning that the "next" sector was usually under the head after the last one was processed.
I'm going into these gory details for a point. Modern equipment is far more sophisticated. A modern hard drive has its own processor and cache. The micro controller processes going on in a typical cheap IDE or any SCSI drive that you'd use today take about the same computing power as the first PC that I ever used. They also typically have more memory than early PCs where capable of addressing.
Despite all these differences the fundamental interfaces and BIOS code (particularly the limitation on CHS addressing) still apply today. To get around this we've going through IDE, EIDE, and the newer Ultra-DMA (or ATA, ATA-2, and ATA-3) interface specifications. At each stage these drives use "tricks" to allow us to access more data. Usually these "tricks" provide some level of "backward compatability" --- but they often require some software upgrades nonetheless.
Instead of CHS addressing we now normally use LBA (linear block addressing). This basically takes the C, H, and S values, multiples them together and calculates a new disk block address based on the total. That's a "linear block address." However a bit of arithmetic should reveal that 256 (max. heads) * 64 (max sectors per track) * 1024 (max cylinders) * 512 (bytes per track) and then devided by about a billion bytes per Gigabyte gives a limit of 8Gb. So we see that LBA doesn't get us past about 8.4Gb (you'll get inconsistent numbers based on whether a given manufacture counts megabytes as 1000 kilobytes or 1024K, and whether they count a gigabyte as 1000Mb or 1024Mb).
The point is that older versions of Linux (and DOS, Windows, NT, and everything else) won't be able to access the full extent of some drives. It's also possible for your CMOS/BIOS settings to interfere with the proper detection of your drive's capacity. So, sometimes you have to use various sorts of "expert mode" or sfdisk options to bypass these sorts of problems. More likely you need to have a kernel which is updated for your situation.
I must admit that I have yet to install any of these HUGE disk drives. I just picked up a 10.x Gb IDE drive for less than $200 (US) and plan to install it in my wife's computer (freeing up a couple of 4Gb SCSI drives for my web server and mail hosts). I haven't had to do anything special on any of the other systems I've worked with --- so I don't know what sort of problem you're having.
You can try 'cfdisk' or 'sfdisk' (prepare a rescue floppy and either copy one of these unto it or unto another diskette). If any of these work --- you can THEN bypass the portion of the setup/installation program where it asks is you have already partitioned your disk.
Note that you must have at least one ext2 filesystem and one "swap" partition for Red Hat --- and most other Linux distributions. This is not a constraint of Linux --- it's possible to install Linux on MSDOS/FAT, minix, xiafs or other filesystems it you work at it. You can even install Linux to boot across a network. However, these are exotic options and most distributions don't have setup programs that can cope with them.
Clearly you don't want to "fight" with your first installation by trying to be exotic.

(?) Thanks again

(!) If none of this works then I suggest reading more of the FAQs, Mini-HOWTOs etc. Also you can look for a local users group and ask around.
Some (like both the Silicon Valley LUG, and the Bay Area LUG (*) that I belong to) have regular "installfests" where you can bring your system into some cafeteria or auditorium and work with volunteers (like me) to get things installed and configured. There are "swap meets" (public vendor shows) which invite the CABAL (coalition of Bay Area Linux) user groups to set up tables and hang out. (Yes, we do this for free --- all we get is free admission to the show and the occasional free CDs, T-shirts or whatnot from some vendors).
Silicon Valley Linux Users Group
http://www.svlug.org
Bay Area Linux Users Group
http://www.balug.org
The FreeBSD users also have these events (and join us at some of the "swap meets" --- though they call them "installoramas" or something like that).
If you don't have any "installfests" or "installoramas" in your area, you might still find some LUG member or local Linux enthusiast to help. If all else fails you can hire a consultant to come in, help you install this and show you how things work. (That's the sort of consulting I specialize in --- one-on-one tutorial work; usually in person).
It used to be possible to call a 900 number (run by Yggdrasil, makers of the first CD Linux distribution). You can look at http://www.yggdrasil.com for details. (Yggdrasil is the "tree of life" in Norse mythology. I have no idea how that relates to Finnish folklore or if it is intended as a reference to Linus' ethnic background at all. But it is a cool name --- particularly for fans fo the old Marvel superhero "Thor"). I don't know if Adam Richter, founder of Yggdrasil is still in the Linux superhero business --- but someone, somewhere will probably be providing "per incident" phone support eventually.
(If I gathered a group of reliable and interested Linuxers I'd consider doing it myself. I don't because I'd hate to be "on call" all the time and I'd hate even more to have paying customers get a recording saying "Jim is off on a date with his wife, Heather ... call back later!").

Funny he should mention this, since as of publication time he has just joined a new startup, LinuxCare, specializing in corporate support for Linux. More details about this new company can be found at their home page, http://www.linuxcare.com.


Copyright © 1999, James T. Dennis
Published in The Linux Gazette Issue 38 March 1999


[ Answer Guy Index ] 1 2 3 4 5 6 7 8 9 10 11
12   14   16 17 18 19   21 22
23 24   26   28 29 30 31 32  


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]