Jan 21 Notes
Pre-Installation Linux Notes
When you are running the Slackware install, it's good to understand the standard designation that Linux uses to label your hard drive. The first hard drive found will be designated hda (hard drive A), in the /dev/ directory, so the path to your hard drive will be /dev/hda. As you might expect, additional hard drives would be labelled as/dev/hdb, /dev/hdc, and so forth. Generally, Windows calls the first local hard drive the C:\ drive, and Linux calls it /dev/hda.
Note: newer PCs and some laptops use SATA connections to the hard drives (several machines in the lab use these). In that case, Linux calls these /dev/sda instead of /dev/hda, and the fdisk below would use the command "fdisk /dev/sda", but otherwise be the same.
The general naming conventions that unix uses for hardware are explained, in some detail, on this wiki page: Device file system.
fdisk is a command line utility that allows you to view and make changes to local drives. As an example, you would run the following to begin fdisk on /dev/hda:
#: fdisk /dev/hda
Command m lists all the possible commands you can execute with fdisk on the selected drive.
Boot the machine with the Slackware install disk. You'll be prompted for extra parameters to the kernel. Ignore this and hit Enter. After more loading, you'll next be prompted for non-US keyboard support. Hit Enter again and continue.
You should now be at the installation welcome screen and being prompted to login as root. Hit Enter again.
You must now partition and format a hard drive in preparation for installing Slackware. You can either use fdisk (no GUI) or cfdisk (primitive GUI) to do this. Assuming you will use fdisk and have only a single drive, type the following into the terminal:
root@slackware:/#: fdisk /dev/hda
You want to create two new partitions (separate fields on the drive). One partition must be where the operating system lives – in this case, Linux. The other is a swap space to be used by Linux. So, enter the following series of commands into the fdisk field:
n (add new partition)
p (make primary partition)
1 (partition number)
1 (first cylinder)
When you are prompted for the number of the last cylinder, be careful. You don't want to fill up your whole drive; you need to leave room for the swap partition. So using the information that fdisk provides about hda, make a rough estimate and leave a gigabyte or two of swap space. For example, if fdisk tells you that hda is 8589 MB and 16644 cylinders, that's about 8 GB to 16000 cylinders, which means that 2 GB is about 4000 cylinders – so you would enter 12000 as the last cylinder of the first partition, leaving that extra 4000+ for swap.
Use the same set of commands to create the swap partition, and make sure that it is number 2. when you are finished, you should use the command p to make fdisk print the partition table. You'll see that the devices are listed as /dev/hda1 and /dev/hda2 – hard drive label followed by partition number.
On the far right of the fdisk printout you'll see fields titled Id and System. By default, the IDs for both partitions should be 83 and the System should be Linux. Using command t, change partition 2 to System type Linux swap (the hex code is 82), and then print the table again to check it.
When you're ready to write the changes to disk, use command w, and command q to quit fdisk.
Now that your disk is partitioned, you're ready to run setup. Type "setup" and hit Enter to begin.
For the most part, setup should be straightforward. Choose the Addswap option and follow the prompts until you get to pick your filesystem type, and make it ext3 or ext4, which are Linux journaling filesystems. You'll be able to select individual programs and applications that you want to install (what Linux calls "packages") or just install everything; if you're interested in saving space, sort through them, but if you'd rather save time and not risk removing a packet that's vital to running Slackware just install all of them.
If you're running off of 2 CDs instead of a DVD or an image, some of the packages will be on one CD and some on the other, so expect to switch disks in the middle of this installation process.
For the most part, Linux will know what the correct option is and select it for you. When in doubt, just let it do what it wants.
Install LILO so we can boot to Linux, select the simple option.
- Select your appropriate screen resolution for the LILO loader.
- You have no extra parameters to pass it.
Install LILO to Master Boot Record (MBR).
- Select your kind of mouse.
- Install GM.
- Select a hostname (the name of your computer).
- Select a domain (you can use anything).
Setup IP so use DHCP – leave DHCP host name blank.
- Prompts you with what you want to start up when you run. Select what feels right.
- Select time zone.
- Select window manager. You can change this later, see Misc. Tips in these notes.
- Prompts for setting root password. Do not forget this, or you won't be able to get onto your system at all.
Your first logon
When (if?) Slackware boots up after you're finished configuring, you'll be prompted for login after it loads. Login with username "root" and the root password you chose. If you want to start your window manager, simply use the following command to start an X session:
This will install a file to your system installpkg <path to file> xinit (contain what GUI you'll be using)
Sometimes you might want to recover data from your computer if the native OS is in trouble. One solution for this is to use a Live CD to perform a rescue. Many popular Linux distros, such as Ubuntu, are available with a Live CD option already on the install disk. Knoppix is an example of a Linux distro that is meant to be run off of a Live CD.
- Shift+Page Up and Shift+Page Down let you scroll through the terminal output. You're not limited to just what's visible on your monitor!
When you have Slackware up and running, and if you want a new type of X session other than the one you're currently using, Slackware has a default window manager utility that can be run using the command xwmconfig. You should then be presented with a menu of all the window managers you have installed and be able to pick a new one, then run it with startx or xinit.
- The /etc directory where all the system configurations are. For example, the /etc/fstab file (viewable with the command "more /etc/fstab") contains a list of all the mountable drives that your system knows about.
You can use the command mount and umount to mount and unmount devices that exist in the /dev/ folder or in the /etc/fstab file.
To shutdown your computer from commandline: shutdown -h now