===================== Mandrivalinux Install - fdisk partitioning, booting GRUB, etc. ===================== -IAN! idallen@idallen.ca [ VERSION #1 - January 12, 2006 ] Summary: This file explains how to: - use Knoppix and "fdisk" to add Linux extended partitions to your hard disk - set the system IDs (partition types) of those extended partitions - use mke2fs and mkswap to create Linux file systems in those partitions - put a bootable Mandrivalinux installer kernel into the first extended partition along with a Mandriva Linux Mini distribution ISO image - configure the GRUB bootloader to boot the installer kernel - boot the installer kernel and use it to install from the Mini ISO file into an empty partition - reboot and use GRUB to select the newly installed partition for booting Preparing Knoppix for networking -------------------------------- Make sure your system has Internet access: - boot Knoppix and open a terminal window - become root via su - make sure Knoppix has already recognized your Ethernet connection: # ifconfig - look for an eth0 or eth1 device with an IP address Identifying your hardware ------------------------- - this must be done as "root" - locate your caddy drive (/dev/hda or /dev/hdb or ...) using this command: # fdisk -l - identify your caddy drive as hda or hdb in the output - confirm the caddy drive location via a disk access test: # hdparm -t /dev/hdX # where X is correct for your caddy drive - make sure your caddy disk light comes on for the test - disk access speed should be 10MB/sec or greater - if not, try enabling DMA (below); or, get a better disk! You may now want to take a copy of these instructions (this file) and globally edit/change the string "hdX" to be correct for your computer and caddy (e.g. :1,$s/hdX/hda/g). Reading the correct hd numbers in the directions will make the following lines easier to understand and type. - enable DMA on your caddy drive, and then verify it: # hdparm -d1 /dev/hdX # where X is correct for your caddy drive # hdparm -t /dev/hdX # where X is correct for your caddy drive - disk access speed should be 10MB/sec or greater - to enable DMA automatically at Knoppix boot time, type "knoppix dma" at the "boot:" prompt. Umounting existing partitions ----------------------------- Knoppix often "helpfully" mounts as read-only any partitions it finds on your hard drive. We want to change the partitions on the disk; so, we must unmount everything before we do so. Look at the output of the "mount" command. For every line that mentions your hdX caddy, unmount the given device (as root). For example: # mount /UNIONFS/dev/hda1 on /mnt/hda1 type vfat (ro) /UNIONFS/dev/hda2 on /mnt/hda1 type vfat (ro) ...etc... You issue these commands as root (only for partitions on your hdX caddy!): # umount /mnt/hda1 # umount /mnt/hda2 ...etc... Create new partitions --------------------- We will use fdisk to add new partitions for Linux on the caddy drive. You need a minimum of 10GB of free disk space. If you have more space, you can add backup partitions to save your work. - DANGER: if you have other hard drives in your machine, giving the wrong drive letter to fdisk will cause it to access the wrong drive! If you write out the partitions to the wrong drive, you lose data! - NOTE: You are free to custom-partition your drive if you want to have other operating systems or partition layouts; however, if you do so, you are on your own for debugging boot problems. Assignments and exercises will assume the layout created below. Run fdisk on your caddy hard drive using it's correct device name letter: # fdisk /dev/hdX # where X is correct for your caddy drive Look at the help information for the "fdisk" command. Use fdisk internal commands to do the following actions: 1. list the existing partitions on your caddy - your Windows partition should be the first one - there may be an unused second partition (or more) 2. keep the first (Windows) partition and delete all others - make sure only the one Windows partition is left - verify that you have at least 10GB free space on the drive 3. add a new partition of type extended in partition slot #2 - use the default start and allocate all (default) the remaining space 4. add a new partition of type logical (#5 inside the #2 extended partition) - use the default start and enter a size of +300M - change the system id (type) for partition #5 to Linux swap type 5. add a new partition of type logical (#6 inside the #2 extended partition) - use the default start and enter a size of +1000M - toggle the boot flag ON for partition 6 (an * will appear there) 6. add a new partition of type logical (#7 inside the #2 extended partition) - use the default start and enter a size of +1000M - toggle the boot flag ON for partition 7 (an * will appear there) 7. write the new partition table to the disk WARNING: if you see errors from fdisk indicating that the kernel cannot re-read the partition table, you must reboot Knoppix after you exit fdisk! REBOOT KNOPPIX *only if* the kernel cannot re-read the new partition table! After the reboot (if necessary), confirm your work using fdisk -l: # fdisk -l /dev/hdX # where X is correct for your caddy drive Device Boot Start End Blocks Id System /dev/hdX1 * 1 1021 8201151 b W95 FAT32 /dev/hdX2 1022 2498 11864002+ 5 Extended /dev/hdX5 1022 1058 297171 82 Linux swap / Solaris /dev/hdX6 * 1059 1181 987966 83 Linux /dev/hdX7 * 1182 1304 987966 83 Linux The exact start and end numbers may be different for your drive. Verify that you have: partition 1: Windows partition 2: Extended - the rest of the disk partition 5: Linux swap - approximately 300K blocks partition 6: Linux - approximately 1000K blocks (bootable) partition 7: Linux - approximately 1000K blocks (bootable) - make sure the system ID type "Linux swap" is set for partition 5 - make sure the boot flag "*" is set for partition 6 and 7 - make sure the all partitions have the shown System IDs (partition types) - verify the approximate sizes (under the "Blocks" column) Create Linux file systems ------------------------- Once you have created the empty partitions, you need to put Linux file systems into them so that Linux can use them. The swap area needs to be initialized as well. Make sure the kernel has recognized the new partitions by running some access tests on the three new partitions numbered 5, 6 and 7: # hdparm -t /dev/hdX5 # where X is correct for your caddy drive ... I/O output ... # hdparm -t /dev/hdX6 # where X is correct for your caddy drive ... I/O output ... # hdparm -t /dev/hdX7 # where X is correct for your caddy drive ... I/O output ... If your system says "no such device" when you do the above, but running "fdisk -l" shows the partitions, reboot Knoppix to have the kernel re-read the partition table. Do not continue until the hdparm works. Initialize the system swap area on partition #5: # mkswap /dev/hdX5 # where X is correct for your caddy drive - ignore any comment about a missing Label on the partition Create a Linux journalling file system on partitions #6 and #7: # mke2fs -j /dev/hdX6 # where X is correct for your caddy drive # mke2fs -j /dev/hdX7 # where X is correct for your caddy drive Mount the new file systems -------------------------- Having created the file systems, we use the "mount" command to connect the new partitions to the Knoppix Linux directory tree. WARNING: Once you have mounted parts of a hard disk, Knoppix will cache hard disk information in memory. You *MUST* shut Knoppix down cleanly, using the menus, to preserve the hard disk information. Pushing RESET while you have hard drive partitions mounted may damage your partitions. After mounting from a hard disk, DO NOT PUSH THE RESET BUTTON! We will mount the newly created file systems under the Knoppix /mnt/ directory, as is traditional with most Unix/Linux systems. Create a directory and mount partition #6 on that directory: # mkdir -p /mnt/hdX6 # where X is correct for your caddy drive # mount /dev/hdX6 /mnt/hdX6 # where X is correct for your caddy drive # df /mnt/hdX6 # where X is correct for your caddy drive - confirm that there is approximately 900MB of space available # touch /mnt/hdX6/disk-hdX6 # where X is correct for your caddy drive - this creates a file whose name contains the Linux name of the partition - this name will be useful later in identifying this partition in GRUB Confirm that you have touched all the correct files: # ls -l /mnt/hdX6/disk-hdX6 # where X is correct for your caddy drive We could also mount the file system in partition #7; but, we aren't going to put anything into it. The Mandriva Installer will do that. Fetch the Mandriva Mini Install ISO image ----------------------------------------- We must fetch this Manriva Mini ISO (CDROM) image into partition #6 (hdX6) for use by the installer. We will also put the installer boot kernel into the same partition. The installer (run from partition hdX6) will read this ISO file and install the contained system into the already-created partition #7 (hdX7). (The Mandriva installer can also read this ISO file over the network; but, having the ISO on the local hard drive is fastest and allows you to re-install a new system anywhere from disk without any network access.) We use the program "wget" to fetch this ISO file from the gateway server at Algonquin. Make sure your partition #6 is mounted (see above), then do: # cd /mnt/hdX6 # where X is correct for your caddy drive # ls -l disk-hdX6 # where X is correct for your caddy drive - make sure you see the file you created using "touch", above # mkdir mini - creates a directory named "mini" # cd mini - makes "mini" your current directory # wget http://10.50.254.230/distributions/Mandriva/2005LE/Mandriva-Linux-2005-Limited-Edition-Club-Mini.i586.iso - this local IP address only works on-campus; it will not work from home [... wait a few minutes for download to finish ...] [... 700MB takes less than 3 minutes on an unloaded network ...] # md5sum Mandriva-Linux-2005-Limited-Edition-Club-Mini.i586.iso - run a checksum on the downloaded image to verify a good copy - make sure the md5sum agrees with this: 04243f25041c0d7016799aa7bafc14c9 Now, create a short symlink to the Mini ISO file (makes typing easier): # cd /mnt/hdX6 # where X is correct for your caddy drive # ls -l mini - make sure you can see the Mandriva Mini ISO file you just downloaded # ln -s mini/*.iso mini.iso - this makes "mini.iso" a short name for the Mini ISO file in the subdir # ls -l -L mini.iso - the "-L" option means "follow the symlink to where it points" - confirm that the symlink points to the correct Mini ISO file Save the Master Boot Record and partition info ---------------------------------------------- Just in case things go wrong from here on in, we save the current Master Boot Record and partition tables (the first block of the disk) in a file: # dd if=/dev/hdX of=/mnt/hdX6/mbr.bin count=1 # use correct X for caddy # ls -l mbr.bin -rw-r--r-- 1 root root 512 Jan 10 21:10 mbr.bin # file mbr.bin mbr.bin: x86 boot sector If things go very wrong, we can restore the boot block from this saved copy. Set up the GRUB bootloader in your caddy ---------------------------------------- We will install the GRUB bootloader into the Master Boot Record (MBR) of your caddy. GRUB will let us boot any one of several different partitions and/or kernels. WARNING: This overwrites your MBR! Your disk will be unbootable until you completely finish the GRUB installation and configuration! You must finish this step completely! Do not stop half-way! (If you do create an unbootable machine, you can use Knoppix to rescue you.> Initially, we want to boot the installer kernel from partition #6 and later boot the kernel that the installer installs in partition #7. We also want to boot Windows in partition #1. We now use Knoppix to install the GRUB bootloader into the MBR of drive hdX (replace X with your caddy drive letter). # grub-install --root-directory=/mnt/hdX6 /dev/hdX # replace X with letter # ls -l /mnt/hdX6/boot/grub/ # replace X with letter - make sure you see a list of the GRUB boot files We now mount the Mini ISO file read-only and copy over some basic Mandriva installer kernel boot images from the Mini ISO file to the boot directory in the first partition: # mkdir -p /mnt/iso - create an empty directory on which to mount the ISO image # mount -o ro,loop mini.iso /mnt/iso - mounts the Mini ISO file read-only on directory /mnt/iso # ls -l /mnt/iso/ - lists files to check that the image is mounted correctly # cp -p /mnt/iso/isolinux/alt0/* /mnt/hdX6/boot/ # replace X with letter - copies all the files under alt0/ to the boot directory # ls -l /mnt/hdX6/boot/ # replace X with letter - make sure you see the two files vmlinuz and all.rdz You already know what Linux drive name applies to your caddy (e.g. perhaps /dev/hda or /dev/hdb). GRUB doesn't use Linux names, since GRUB can boot all kinds of operating systems, not just Linux. We must find out which GRUB drive name applies to your caddy. GRUB names hard disk drives in the order that it finds them at boot time: (hd0), (hd1), (hd2), etc. (This is unfortunate, since it means that when your disk hardware changes, you have to change your GRUB menus to match!) GRUB partitions within those disk drives are (hd0,0) (hd0,1) (hd0,2), etc. [Note that Linux partition numbers start at 1, e.g. /dev/hda1; GRUB partition numbers start at 0, e.g. (hd0,0). Sorry!] We have touched file names (such as disk-hdX6) in each of our Linux partitions to make identifying the partitions in GRUB easier. Start GRUB: # grub At the GRUB prompt, type "cat (hd" and then push the key after the letter "d"; GRUB will show you the known hard disk drives by number, starting at zero: grub> cat (hd Possible disks are: hd0 hd1 If you only have one hard drive (drive zero), grub will simply complete the string after the and leave you with "(hd0,". For a list of partitions on GRUB disk (hd0), type "cat (hd0," (push the TAB key after typing the comma): grub> cat (hd0, Possible partitions are: Partition num: 0, Filesystem type is fat, partition type 0xb Partition num: 4, Filesystem type unknown, partition type 0x82 Partition num: 5, Filesystem type is ext2fs, partition type 0x83 Partition num: 6, Filesystem type is ext2fs, partition type 0x83 The above list is GRUB's way of showing GRUB partition numbers 0,4,5,6 that Linux fdisk would number as 1,5,6,7. Note that the extended partition (GRUB partition number 1, Linux fdisk partition number 2) doesn't show up in the GRUB partition list. For a list of pathnames on partition (hd0,5) (Linux fdisk partition 6), try typing "cat (hd0,5)/" (use the TAB key again): grub> cat (hd0,5)/ Possible files are: lost+found disk-hda6 mini mini.iso mbr.bin boot You can complete a pathname and actually use GRUB to see the file: grub> cat (hd0,5)/disk-hda6 File disk-hda6 is the empty file we created earlier by "touch" under Linux. If you have more than one disk, try each of the (hdX,5) disk partitions, looking for the disk that has the file names you recognize. Try (hd0,5)/, (hd1,5)/, (hd2,5)/ until you find the right disk (hdN,5)/ that shows you the GRUB partition 5 disk-hdX6 file you created earlier. Now you know the GRUB (hdN,5) name for partition #6 on your caddy drive *on this hardware*. The GRUB hdN number may change if you add/move hard drives. Remember this GRUB (hdN) disk number. Note that Linux partition /dev/hda6 is usually GRUB partition (hd0,5). (Linux numbers partitions from 1; GRUB numbers from zero. Sorry!) We need to tell GRUB how to boot from GRUB partition #5 (Linux partition number 6) and also from GRUB partition #6 (Linux partition number 7). Exit GRUB by typing "quit" at the grub> prompt. Create (using the vim editor) a /mnt/hdX6/boot/grub/menu.lst file: # vim /mnt/hdX6/boot/grub/menu.lst # replace X with your caddy letter Enter the lines given below as the menu.lst file. When copying and creating the menu.lst file below, replace hdN with the correct GRUB hdN number of your caddy drive, e.g. hd0, hd1, etc., and replace hdX with the correct Linux drive letter, e.g. hda or hdb. Don't mix them up! #----- file boot/grub/menu.lst file starts after this line ----- title Windows rootnoverify (hdN,0) chainloader +1 title Mandriva-Install-(hdN,5)-hdX6 kernel (hdN,5)/boot/vmlinuz root=/dev/ram3 ramdisk_size=128000 vga=791 initrd (hdN,5)/boot/all.rdz title System-1-(hdN,6)-hdX7 kernel (hdN,6)/boot/vmlinuz root=/dev/hdX7 initrd (hdN,6)/boot/initrd.img #----- menu.lst file ends before this line ----- When copying and creating the menu.lst file above, replace hdN with the correct GRUB hdN number of your caddy drive, e.g. hd0, hd1, etc., and replace hdX with the Linux drive letter, e.g. hda or hdb. Don't mix up hdN and hdX - replace them separately. The above menu.lst file will be read by GRUB when your machine boots. It tells GRUB that there are three bootable systems available: 1. Windows - chain-load the bootloader on the Windows partition 2. Mandriva-Install - boot the installer kernel 2. System-1 - boot an installed system (not finished yet!) 1. The Mandriva-Install entry is the "install" kernel that sets up a ramdisk and runs entirely in memory. You have already put the vmlinuz and all.rdz files into the /boot directory. This kernel allows you to choose from where to fetch the "real" kernel for installation onto your hard disk caddy. This first install kernel "vmlinuz" and its initial ramdisk "all.rdz" are stored under the /boot/ directory in GRUB partition #5 [Linux name /dev/hdX6, GRUB name (hdN,5)]. Putting the installation kernel and ISO image on disk means you can erase some or all the other partitions on the disk and still have a bootable installation kernel that lets you re-install. 2. The System-1 boot entry isn't available yet, since we haven't installed it; but, we will define it here now rather than have to come back and add it to this file later. The Mandriva-Install system will install the Mini system from the ISO image into this System-1 partition [Linux name /dev/hdX7, GRUB name (hdN,4)]. The installation process will put the kernel file "vmlinuz" and its initial ramdisk "initrd.img" into the /boot directory in the /dev/hdX7 partition. Create the above menu.lst file under the boot/grub directory. Make sure you edit out all the hdX and hdN correctly. Save the contents of menu.lst and exit vim. Your system is ready to boot the Mandriva-Install kernel. Make sure you put the menu.lst file in the correct place: # ls -l /mnt/hda6/boot/grub/menu.lst You will be using the Mandriva Install kernel, ISO image, and boot/grub/menu.lst file in Linux partition #6 to install a new system into empty partition #7. If anything goes wrong, you can reboot the installer (from partition 6) and just erase partition #7 and start over. Setting up more partitions in the GRUB menu -------------------------------------------- If you have disk space, you can reboot into the installer and use "Custom disk partitions" in the installer to create more logical partitions - #8, #9, #10 - and then install bootable systems into them. If you want to boot these extra partitions, having entries in your boot/grub/menu.lst file makes it easy. To boot these new extra partitions, you need to edit and add more entries to the bottom of your GRUB boot/grub/menu.lst file. Following the model given for the System-1 entry in menu.lst, edit the GRUB menu.lst file to add GRUB boot entries (System-2, System-3, etc.) for the new partitions you create, so that you can boot them. Each new System will need an entry in menu.lst for the next-higher number partition. For example, you could add this menu.lst entry: title System-2-(hdN,7)-hdX8 kernel (hdN,7)/boot/vmlinuz root=/dev/hdX8 initrd (hdN,7)/boot/initrd.img You can create System-2, System-3, etc. ahead of time, so that they are ready when you need them. Remember to update the hdN and hdXI for each new partition in menu.lst to be one higher than the previous partition. Finished with Knoppix - rebooting into the new GRUB menu -------------------------------------------------------- After you have created the boot/grub/menu.lst file with (at least) three boot entries in it, GRUB is ready to take control of your system when you reboot it. First, make sure you put the menu.lst file in the correct place - GRUB expects it under the boot/grub directory on hda6: # cat /mnt/hda6/boot/grub/menu.lst ... make sure there are no errors in the file ... You are done with Knoppix. You have several choices for a reboot. 1. You can use the regular Knoppix shutdown menu item. 2. You can become root (in a terminal window) and type: shutdown -r now 3. You can become root in a terminal window, change to the root directory on Knoppix and unmount all mounted disks, then push the RESET button: # cd / # umount -a ... you may now push RESET (since all disks are unmounted) ... Remove your Knoppix CD from the CDROM drive and reboot. (Never use RESET on a hard-disk based system!) On reboot, if your caddy drive is the only hard disk when you boot, it should be selected as the boot device. If you have multiple hard drives in your machine when you reboot, you need to go into the BIOS and arrange that it is your caddy that boots, not your existing hard disk. (Perhaps you can choose the boot device in the BIOS; or, perhaps you can disable all the other hard disks. You can also prepare and use a GRUB boot floppy that lets you choose which MBR to use.) If you have done everything correctly, you'll boot from the MBR on your caddy drive, into GRUB with a black-and-white menu, and you will see (at least) the three menu items from menu.lst available as boot choices. If you boot directly into a "grub>" prompt and don't see your expected menu.lst configuration file menu, use the "cat" command in GRUB to go searching for where you put it. You can use the "configfile" command in GRUB to load the file when you find where you put it. In the menu.lst menu, the arrow keys move up and down among choices. The RETURN key will boot a given selection. The letter 'e' will let you edit an item before booting it; 'c' will give you a "grub>" console. Choose the Mandriva-Install boot selection, which should be the second menu item. Push RETURN to have GRUB boot the the Mandriva install kernel. Doing a basic Mandriva Mini Install ----------------------------------- Assuming your system correctly boots the Mandriva Install kernel, you should see some boot information fly by, stopping with a screen that says: Please choose the installation method: This install kernel lets you install from NFS, FTP, HTTP, CDROM, or your hard disk. The arrow keys move the highlighted selection to choose the method. The TAB key selects the OK and CANCEL buttons. Highlight "hard disk" and push TAB to highlight the OK button, then hit RETURN to continue. You may next have to hit RETURN to say "OK" to some driver installation and configuration messages. Eventually you will see a screen that says: Please select the disk containing the copy of the Mandrivalinux Distribution install source. Since you are booting Linux, the disks are listed with their Linux names (hda, hdb, etc.). Use the arrow keys to choose the disk that is your hard drive caddy, TAB to the OK button, and push RETURN to continue. Next, you see: Please select the partition containing the copy of the Mandrivalinux Distribution install source. You downloaded the Mandriva Mini ISO file to partition #6 (Linux name /hdev/hdX6). Use the arrow keys to select this partition, TAB to the OK button, push RETURN. Next, you see: Please enter the directory (or ISO image file) containing the Mandrivalinux Distribution install source. You created a symlink "mini.iso" that points to the Mini ISO file in its subdirectory. You can use this short name in response to the above question. Enter "mini.iso" as the name, TAB to OK, push RETURN. (If this fails, you got the symlink wrong. You can specify the directory name instead: enter the directory name "mini", TAB to OK, push RETURN. On the next screen, select the ISO file, TAB to OK, press RETURN.) If you get the ISO file name correct, it will say "Loading program into memory (please wait)". The screen will switch to graphical X11 mode and you will have your mouse available. The Mandriva Install kernel is fetching the installation system out of the Mini ISO file. Select your desired Language, click NEXT with the mouse. Read and Accept the License Agreement, click NEXT. "Is this an install or an upgrade?" If you are asked what type of installation you want, select "Install" and not "Upgrade". You want to install into the a new partition. (Of course, if you want to fix an existing installation or add new software packages to an existing partition, you can choose to upgrade that partition here.) Drop the security level down to "Standard" in the security level pull-down menu. (We will install our own security rather than have Mandriva do it for us.) Leave the security login blank. Click NEXT on this screen. "The DrakX Partitioning wizard found the following solutions:" Choose "Use existing partitions" - you want to install into the existing partition #7 that we created earlier using Knoppix and fdisk. NOTE: If on a subsequent run of the installer you want to create a new partition and install another Mini system into it (e.g. into partition #8), select "Custom", select the correct caddy disk drive (if more than one), and create a new partition on it for a Linux journalized file system of type "ext3" with a mount point of ROOT ("/"). "Choose the mount points" You may see a list of disk partitions that the installer found and the suggested places that the installer would like to mount these partitions in your new system. If your caddy drive is not the only drive in your system, you may see partitions from all your other drives (even Windows drives, since Linux can read most Windows format file systems). Later, you might experiment with leaving some of these partitions enabled in your new system. For now, blank out (erase) all the mount points except the partition #6 (/dev/hdX6) and the partition #7 (/dev/hdX7). Set these names: The mount point for #6 /dev/hdX6 should be: /mnt/hd The mount point for #7 /dev/hdX7 should be: / You are saying that the ROOT directory "/" will be on partition #7. You will recall that your GRUB menu.lst file had the kernel option "root=/dev/hdX7" to tell this to the kernel being booted. Click NEXT once you have set the two mount points. (Erase all the others.) When asked which partitions you want to format, leave hdX7 (the root) selected, and click NEXT. This erases everything in the partition and recreates it with an empty Linux file system. "Do you have supplementary installation media to configure" Select "None" and click OK. We will add supplementary media later. "Package Group Selection" In the Package Group Selection menu, select everything, including the "Individual Package Selection" box at the bottom. (Later, for another install, you might experiment by selecting nothing extra and noting just how small a Linux system you can run. You can always add back the missing packages later.) Select everything! Click NEXT. "Choose the packages you want to install" Expand the list of packages (use the bottom left icon "Expand") and scroll down to select the mozilla-firefox web brower. Accept the related packages that must be installed. Click "Install". "Do you really want to install these servers?" You will see a warning screen notifying you of the servers that your new system will be stating by default. If your system is on the Internet, you must keep the servers mentioned patched with security updates to prevent your system from being exploited by bugs in old software. Leave the selection as YES and click NEXT. "Installation time remaining..." The installer will now extract packages from the Mini ISO file on partition #6 and install the packages into partition #7. You will see a progress bar showing this as it happens. It will only take a few minutes. While you are waiting, note that CTRL-ALT-F2 switches you to a console with a mini-root shell (not bash, but similar) running. See the heading below on "Using the installer mini-root" for details. To switch back to the graphical install screen, use ALT-F7. After a few minutes, all the packages from the Mini ISO will have been installed in partition #7. "Set administrator (root) password" You will be asked to set the root password for your new system. Set a good password (one that you can remember) and click NEXT. NOTE for LOST ROOT PASSWORD: If you ever forget the root password, you can reboot the installer kernel, load the Mini system ISO, and, without installing anything, switch consoles via CTRL-ALT-F2 to the mini-root shell on console 2, mount partition #7 (/dev/hdX7) on a temporary directory, and edit file /etc/passwd on that partition to erase root's password. You could also do the same work from Knoppix. When done, unmount the partition and reboot. "Enter a user" You will be asked to "Enter a user". You should create an "ordinary" unprivileged user of your system. Enter your full name and a preferred userid (no blanks or funny characters in the userid). Click on the icon if you want to change the user's graphical login icon (not used for a text login). You can also create other users now, if you like. (You can always add more users later.) Click "Accept User". When you are finished adding users, click on NEXT. "I can set up your computer to automatically log in on one user" Do *NOT* select "automatically log in one user". Turn it off! That isn't secure for a network machine. Disable this feature. Click NEXT. "Where do you want to install the bootloader" On the "LILO/grub Intallation" screen where it asks about the bootloader, say "SKIP". SKIP this item! You already have GRUB installed as a bootloader. When you created the menu.lst file for GRUB earlier, you already added an entry titled "System-1" that points to the kernel in partition #7. Now that the installation into partition #7 is complete, when you reboot, you can select this GRUB entry to boot the new installation. Choose "SKIP" - do not install another bootloader. NOTE: If you have just installed into a partition that is not yet mentioned in your GRUB menu.lst file (this file is stored in directory boot/grub under Linux partition /dev/hdX6), you may want to mount that partition and edit menu.lst to add the needed boot entry for the new partition. Since GRUB lets you modify any boot entry at boot time, you can always get temporary access to any parition by modifying an existing boot entry at boot time. Edit the file on disk later to make changes permanent. On the Mandriva "Summary" screen, make the following changes: - Change the Country/Region to Canada. - Configure the Graphical Interface (unless it is already configured): "Choose an X server" Normally, you would choose an X server that matches your video card; but, you are installing in a caddy drive that will be plugged into various kinds of hardware, video cards, and monitors. What do you choose? There is no easy answer. For now, accept the default X server that is offered to you. "Resolution" You might choose a conservative resolution that will work everywhere with most cards and monitors: 800x600 at 60Hz and 800x600 with 16bpp. If you are confident your hardware can support it (most modern hardware can), select the 1024x768 @ 70Hz and 1024x768 16bpp entries. Click "test" to try your selection. Click NEXT when done. "I can set up your computer to automatically start the graphical interface" No. Turn this off. A network server should not be running the windowing system all the time, only if/when needed. (Many network servers have the windowing system removed entirely for security.) By turning this off, you set the default run level in /etc/inittab to "3" instead of "5". (5 is the full X11 graphical run level.) - Configure the Network (unless it is already configured): If the network interface (LAN) is not configured as "lan", configure it. Ignore any errors about failure to load drivers. The labs have at least one network card that Linux understands. In Algonquin Labs, eth0 is the "top" card, and eth1 is the "bottom" card on the back of each machine. The network cable is attached to one of the cards - make sure you select that card when you set up a DHCP configuration. You don't need to enter any host names; however, your machine will boot up with whatever name the DNCP server gives it. If you want to choose your machine name, enter it here. You don't want users to be able to enable the network - say "No". "You have the opportunity to download updated packages" Bugs may have been found in packages since the CDROM was pressed. You have an opportunity now to download upgraded versions of packages. Since we can do this upgrade more easily later, say "NO" here. Don't forget to do your upgrades later! "Congratulations, installation is complete." The Mandriva Installer system, running in partition #6, has read all the packages from the Mini ISO in the same partition, and installed the packages into partition #7. We already have a menu.lst file for GRUB that contains an entry "System-1" that points to this newly installed system, so we are free now to reboot into GRUB and use GRUB to select the "System-1" boot entry for partition #7. Click on REBOOT. When GRUB comes up this time, move the highlight down to the "System-1" entry on partition #7, and push RETURN. You will be booting the newly-installed kernel in partition #7 this time. Booting the newly installed Mandriva Mini system ------------------------------------------------ If nothing happens at all at boot time (no messages on the screen), get experienced help. If you fail to boot back into your black-and-white GRUB menu - if you boot into a coloured Mandriva boot menu - then you have overwritten your GRUB installation and will have to repair it using Knoppix. (You must follow instructions and say "SKIP" when asked to install a bootloader!) If the boot process produces Linux messages but fails with "kernel panic" and/or "cannot find init", reboot into GRUB, select the System-1 line, and type "e" to edit the line. Type "e" again to edit the "kernel" line. Use the arrow keys to inspect and make sure that the "root=" option on the "kernel" line is correct for your system; it has to point to the Linux name of the partition, e.g. hda7, hdb7, hdc7, etc. Fix the line, push RETURN to save it, then type "b" to boot the system. You will have to make this modification every time you boot, until you edit the original boot/grub/menu.lst file and fix it. As the system boots, make note of any "FAIL" messages that appear during the boot process. When the prompt for a login appears, enter your account userid and password. From your unprivileged account, type "startx &" at the shell to bring up the X11 graphical window system. (Do not run "startx" as root - everything you do will have the potential of overwriting the disk! Run "startx &" using your own account.) The "df" command in the Mandriva Mini system will show you that you are using about 410MB out of 980MB on the partition. Configuring the Mini System - getting updates and more packages --------------------------- The Mandriva Mini system contains only a basic small set of packages. It doesn't have useful things such as "man", "telnet", or "tcpdump". You can use the Mandriva "urpmi" tool to fetch more packages from the Internet, once you have told urpmi where the site mirrors are using "urpmi.addmedia". See file "mandriva_config.txt" for details. Resources --------- Mandriva hard disk install: http://qa.mandriva.com/twiki/bin/view/Main/CookerHowTo ----------------------------- Using the installer mini-root ----------------------------- [used for emergency recovery] When running the Mandriva Installer kernel, CTRL-ALT-F2 gets you a console with a root prompt. In fact, this is not a traditional Unix shell. It is a Perl program reading lines and pretending to be a shell - many commands don't work, or work differently from the real commands of the same name. (For example, almost none of the options to ls are recognized!) If you look at the /bin/ directory of the installer, it has very few commands. This is called a "mini-root" installation - it is small and has just enough commands to install a system or do some simple diagnostics. Even the bash shell is too big for the mini-root, which is why they have a Perl program pretending to be a shell for you. When running the Mandriva Installer, you can switch to console 2 (CTRL-ALT-F2) and look around at the real system as it is being assembled under mount point /mnt/. The "df" command will show you that the install process has mounted your newly created Mandriva system using directory /mnt/ and a partition name of /dev/hdX7. ALT-F3 shows you the installer log messages; ALT-F4 shows the system logger messages (which are not written to a file in a mini-root system). Since the installer is installing a more complete system under the /mnt/ directory, you can often use commands installed under /mnt/ if they are missing from the installer mini-root /bin/ directory. A classic example of this is "vim", which is not in the installer mini-root anywhere. Once the installer has installed packages into the the /mnt/ directory, you can find a useful copy of vim at /mnt/bin/vim-minimal. If you are having problems booting an installed kernel, you can often boot the installer kernel, switch to the #2 console (CTRL-ALT-F2), and then mount the partition that is giving you problems and fix it, even using commands such as vim-minimal from the system you are mounting and fixing. If you wanted to edit the GRUB menu.lst file before rebooting your newly installed system, you would have to first make a mount point directory, mount the partition containing the menu.lst file, then use the vim-minimal editor located over in the system being built under the /mnt/ partition (since vim doesn't come with the installer kernel!). It would look like this: Boot the system into the Mandriva-Installer. Load the mini.iso image. Use CTRL-ALT-F2 to switch to the mini-root #2 console. Then: # mkdir -p /mnt/hdX6 # where X is correct for your caddy drive # mount /dev/hdX6 /mnt/hdX6 # where X is correct for your caddy drive # cd /mnt/hdX6 # where X is correct for your caddy drive # ls - confirm that you can see your disk-hdX6 file, created earlier - if you don't see this file, you mounted the wrong partition! # cd boot/grub # ls -l menu.lst - make sure the menu.lst file is still there, from before # /mnt/bin/vim-minimal menu.lst - it will complain about your terminal type; but, it should work anyway - edit the file and save it # cd / # umount /mnt/hdX6 # where X is correct for your caddy drive You are ready to reboot. You can also use your Knoppix CD to repair files on your hard disk, by mounting the partitions under Knoppix, editing the files you need, then unmounting the partitions, as shown above. Knoppix comes with vim, so you don't have to scrounge it from the /mnt/ directory!