Originally Published: Sunday, 4 July 1999 Author: David Apfelbaum
Published to: featured_articles/Featured Articles Page: 1/1 - [Std View]

Dave's Diary, Entry 4 (Part 1): Installing Red Hat 5.2

Time to install Red Hat 5.2. You can install Linux on anything from a 386 on up, which is nice because 386's and 486's are dirt cheap--I have a 486/25 running Linux that set me back almost $10.

For the record here though, I'm performing my install on a 200 MHz Pentium box, FIC 503 motherboard, 64 Megs of RAM, 10.1 gig harddrive, Matrox Millennium I video card, 3c509-B (ISA) ethernet card, SoundBlaster-16 (PNP) sound card, and an IDE CDROM drive....

Time to install Red Hat 5.2. You can install Linux on anything from a 386 on up, which is nice because 386's and 486's are dirt cheap--I have a 486/25 running Linux that set me back almost $10.

For the record here though, I'm performing my install on a 200 MHz Pentium box, FIC 503 motherboard, 64 Megs of RAM, 10.1 gig harddrive, Matrox Millennium I video card, 3c509-B (ISA) ethernet card, SoundBlaster-16 (PNP) sound card, and an IDE CDROM drive. If you are trying to install on a laptop, I suggest that you buy support as things, specifically the GUI and PCMCIA support, may be a bit more challenging. Laptops tend to have customized non-standard undocumented hardware, creating lots of little annoyances.

Start by putting your Boot floppy (made from boot.img, as explained in Entry 2 of the diary) in your floppy drive, and rebooting your system.

As we go through this, you might start wondering when we'll use the Supp (supp.img) disk. Well, in this example, I won't use it. But if you try something a little different from what I'm doing, Red Hat may ask you for the Supp disk. (Particularly, I believe, if you play with PCMCIA.) And, in my ever so humble opinion, you're better off having the Supp disk and not using it than not having it when you need it.

You boot off the boot floppy and you reach the Red Hat introduction screen. (It says "Welcome to Red Hat Linux!" at the top.) There are interesting options here--feel free to look around. But, in the end, you want to hit Enter to perform an install/upgrade. If you take too long to decide, Red Hat will assume you want to perform an install/upgrade and take you to the next screen. It is possible to specify additional options before hitting Enter. I have never needed to do so, but your mileage may vary.

You will see Loading initrd.img... followed by an increasing number of periods as initrd.img is loaded. This is then followed by Loading vmlinuz... and an increasing number of periods as vmlinuz in loaded. After that, a large number of messages will appear. What you are watching is the linux OS being loaded off the floppy, followed by the Linux boot messages.

You eventually wind up, without having pressed any additional keys, at a new "Welcome to Red Hat Linux!" window. This is the first of a series of non-graphical (text-based) windows in which you will be asked a series of questions regarding how to configure and install your system.

In these windows, you can use the arrow keys and/or tab/shift-tab to move around between fields. Space and/or enter will select the current field/button.

In this first window, you are being advised to read Red Hat's manual before continuing. And, if you've purchased your software from Red Hat, to register over at redhat.com. Hit space or Enter to acknowledge the "Ok" and continue.

Next window: "Choose a language". Use the up/down arrow keys to select your language of choice. (Left/right arrow keys will move you down to the "Ok" button.) Hitting Enter on the language of choice will select it (without going down to the Ok button).

Next window: "Keyboard type". Same deal with arrow keys & enter as before. I'll choose "us".

Next window: "What type of media contains the packages to be installed". Here our paths may diverge.

If you have a Red Hat CDROM, or a copy thereof, you will probably want to choose "Local CDROM". If you are doing a network install from an anonymous FTP server, you'll want to choose "FTP". If your copy of Red Hat resides on another Unix box that is serving those files over NFS (Network File System), choose "NFS". If you have your copy of Red Hat on your local hard drive, choose "hard drive". If you have your copy of Red Hat on another Windows machine that is sharing those files under Windows, choose "SMB image".

In all my years of playing with Linux, I've only needed "Local CDROM". And, for rare antiquated (read: CHEAP) systems that lacked a CDROM, "FTP".

I should point out that you can use SCSI CDROM drives. And you can even use CDROM drives that are attached to sound cards. But doing so, particularly for proprietary drives attached to sound cards, tends to be somewhat more challenging than using a cheap IDE cdrom drive. I also feel compelled to point out that, in my experience, this difficulty appears to rise exponentially if (1) you are employed by Microsoft and (2) you are writing an article on the ease of use of Linux.

Anyway, I've acquired one of those US$2 CDROM copies of Red Hat Linux. (I didn't want the support.) And I have one of those cheap IDE CDROM drives. So I'll select "Local CDROM".

Next window: "Note" "Insert your Red Hat CD into your CD drive now" CDROM's in the drive. I'll hit Enter on the "Ok" button.

Now, as I have an IDE CDROM drive, Red Hat will nicely find it for me. If I did not have an IDE CDROM, or if Red Hat had problems finding my IDE CDROM for some reason, Red Hat would ask me more questions (SCSI vs Other). (See the installation guide.)

Next window: "Initializing CDROM". This window goes away on its own. I don't have to do anything. As Red Hat utilizes my CDROM drive, the message "in second stage install" appears briefly at the bottom of my screen. After a moment, it too goes away.

Next window: "Installation Path". I get to choose whether I want to perform a fresh install or upgrade an older (prior) installation of Red Hat. I'll select "Install", which will create a virgin copy of Red Hat linux.

Next window: "Installation Class". You know, I've never used the "Workstation" or "Server" options. I wonder what they do. Red Hat's manual indicates that they wipe the hard drive--and, presumably, automate many of the choices I'd like to make. Forget that! I'll choose "Custom"! I'm setting my machine up to be a dual-boot Linux/win95 box. (At least until such time as WINE is a bit further developed. Occasionally I still need to run the odd Windows application.)

Next window: "SCSI Configuration". Do I have any SCSI adapters? I'm ashamed to admit it, but no, I don't have any SCSI adapters on this system. Gotta fix that one of these days. It's just that IDE costs so much less. So I'll select "No".

Next window: "Disk Setup". It's time to partition the disk and label the partitions as linux-native / linux-swap. There are two tools that you can use here. "Disk Druid" is a new, modern, GUI based tool. I never use it. "fdisk" is an older, command-line oriented version. I think it's great. So I'll choose "fdisk".

Next window: "Partition Disks". Fdisk only supports working on one disk at a time. If you have more than one disk, pick the disk that you want to work on. You can pop back and forth between this screen and fdisk to edit (partition) multiple disks. If you only have one disk, that's probably the one that's highlighted. I'll choose the "Edit" button to partition my harddrive. (Up/Down arrows to select /dev/hda. Tab to select Edit. Enter to push the button. Or just hit Enter on the selected drive.)

I should point out there that IDE drives typically start with 'hd', whereas SCSI drives typically start with 'sd'. This convention makes hda typically the primary IDE channel master drive, hdb the primary IDE channel slave drive, hdc the secondary IDE channel master drive, and hdd the secondary IDE channel slave drive.

The partition number generally follows. So the 3rd partition on the primary IDE channel master drive would be hda3. And the 7th partition on the primary IDE channel slave drive would be hdb7.

Linux generally places these devices in the /dev directory. So /dev/hda is typically the primary IDE channel master drive. And /dev/hda3 is typically the 3rd partition of the hda drive.

You will notice that I say "typically" and "usually" a lot. Linux is amazingly customizable. Making the locations of files determined by user conventions. Not by operating system limitations.

All that said, I'm now editing /dev/hda. I'll hit:

A general rule of thumb here, though: partition your Linux partitions with Linux tools (fdisk/DiskDruid) and your DOS/Windows partitions with the DOS/Windows tools (also called fdisk). This is not a hard and fast rule. I break it all the time. But you should be aware of the following:

[Excerpted from the fdisk man page. Run man fdisk under linux.]

The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.

So if you do use Linux fdisk to partition DOS partitions, you may need to go in and play some games with dd before reformatting those partitions under DOS! (See man fdisk under Linux.)

One other point too: If you are going to create a lot of partitions, you probably want to create one extended partition. Linux has no problems booting off a linux-native partition located inside an extended partition. However, you may recall my earlier remarks concerning Windows not playing nicely when it did not have a token FAT partition inside an extended partition. Also, Windows seems to "desire" a primary partition if you want to boot it. Or, for that matter, install it--depending on your version of Windows.

Anyway, partition up your hard drive however you want it. If you get into trouble, use 'q' to quit without saving and try again from the beginning. It's really not that hard.

Of course, I'll also make a point of creating my primary partitions before my extended partition. And I'll specify all my partition sizes in cylinders. (When you hit 'p', it specifies the size of your cylinders right before it prints the current partition table.) I find that, if I specify my partition sizes in megabytes, there's always a roundoff factor that gets in my way. After all, there's no way to split a cylinder. (If you're wondering what a cylinder is, check out Tom's Hardware Guides under Storage or Quantum's Storage Basics under Disk Geometry.)

Now that I'm done, my partition table looks like:

Command (m for help): p

Disk /dev/hda: 255 heads, 63 sectors, 1232 cylinders
Units = cylinders of 16065 * 512 bytes

Device, Boot, Start, End, Blocks, Id, System
/dev/hda1, *, 1, 127, 1020096, 6, DOS 16-bit >=32M
/dev/hda2, , 128, 254, 1020127+, 83, Linux native
/dev/hda3, , 255, 381, 1020127+, 83, Linux native
/dev/hda4, , 382, 1232, 6835657+, 5, Extended
/dev/hda5, , 382, 510, 1036161, 6, DOS 16-bit >=32M
/dev/hda6, , 511, 639, 1036161, 6, DOS 16-bit >=32M
/dev/hda7, , 640, 655, 128488+, 82, Linux swap
/dev/hda8, , 656, 671, 128488+, 82, Linux swap
/dev/hda9, , 672, 800, 1036161, 83, Linux native
/dev/hda10, , 801, 929, 1036161, 83, Linux native
/dev/hda11, , 930, 1058, 1036161, 83, Linux native
/dev/hda12, , 1059, 1232, 1397623+, 83, Linux native

Command (m for help): q

As you can see, my drive has (16065 * 512) or 8,225,280 bytes per cylinder. You should also note that, with my configuration, I can't put a Linux partition containing /boot in /dev/hda11 or /dev/hda12 as those partitions exceed the 1023 cylinder limit for LILO. (Well, technically I could put it in /dev/hda11. But that's like playing russian roulette. If /boot or the files inside /boot happen to fall above the 1023 boundary, things will break for no apparent reason. I don't feel like getting burned at some unknown future date, so I won't boot off /dev/hda11!)

If you're wondering why my different Linux partitions are different sizes. Well... This drive was previously set up and used for Windows. And I'm playing games to hopefully avoid disturbing the previously existing Windows data. What can I say--some days it just sucks to be me.

Some of you might note that I've set up 256 Megs of swap. And you'll recall that I've only got 64 Megs of RAM. And you're probably wondering about why I've chosen four times my RAM after I stated my 2x rule in an earlier diary entry. It's simple, really... I'm planning my upgrade path. I plan to increase my RAM in another month or two. I should also point out that linux doesn't really need 64 Megs of RAM, let alone 128 Megs of RAM. I've run Linux quite happily with only 16 Megs. And I believe it works on even less. However, the application software that I make my living writing and using professionally is a bit more of a hog. And 64 megs just isn't cutting it any more...

Getting back to installing Linux, I'm still in the "Partition Disks" window. So I'll tab down and select "Done".

Next window: "Current Disk Partitions". This is where we decide which partition we are going to install linux on. I think I'll put my root (/) linux partition on hda9. It could just as easily be hda2, hda3, or hda10. Why hda9? Why not?

So I'll use the up/down arrow keys to select the hda9 line. Then I'll tab over and select "Edit". This brings up another window called "Edit Partition: /dev/hda9" (over top of the "Current Disk Partitions" window). Under Mount Point: I'll enter "/". Then I'll tab down and select "OK".

At this point, I can go on to add in other partitions as subdirectories under my root directory. Ie: /boot, /usr, /home, /tmp, /opt--whatever I want. But, you know, I don't need to start with more than 1 gig. And it's so easy under Linux to add new partitions incrementally as I need them, that I think I'll wait until I actually need the extra space... Who knows, I may decide to throw another gig at Windows so I can load that new game... (Even if Windows, unlike Linux, does trash its registry by renumbering all the drive letters...)

So, back on the "Current Disk Partitions", with only /dev/hda9 set to "/", I'll tab down and select "OK".

Next Window: "Active Swap Space". This is actually a scrollable window. Use the arrow keys to scroll down and space to select the swap partitions that you want to use. I'll select hda7 and hda8. Then I'll tab down and enable, with the space bar, "Check for bad blocks during format". (Hey, why not? When did checking for disk problems ever hurt anybody?) And then I'll tab down and select "Ok".

I get a nice little "Formatting" window now, as my swap partitions are formatted, complete with a little progress indicator, followed by a "scanning" window, as Red Hat scans the available packages.

Next window: "Partitions to Format". You're not required to format your Linux partitions here. But if they're not already formatted (and, for that matter, when I'm doing a fresh install), formatting my partition only makes sense. So, space to enable formatting on /dev/hda9 (my "/" partition). Tab down and space again to select "Check for bad blocks during format". (Hey? Why not? If there's a problem I'd rather know sooner rather than later.. And tab down and select "OK".