A Newbie's Guide to Debian Linux
Total Page:16
File Type:pdf, Size:1020Kb
A Newbie’s Guide to Debian Linux T. R. Shemanske November 16, 2006 This document is really just a small supplement to very good installation guides for Debian Linux such as http://www.debian.org/releases/woody/installmanual http://www.debian.org/doc/manuals/quick-reference/index.en.html 1 Partitioning your disk There are many thoughts on the matter, and to some extent the decisions you make depend upon how many users will have accounts on your machine, and to what degree you want the rest of the world to have access to parts of your machine. You need at least a root (/) partition and a swap partition, though I would strongly recommend at least a separate /home partition. The reason for this is that in the event you need to reinstall the operating system (meltdown, whim, whatever), you will no doubt reformat the root partition. With a separate home partition, you will leave untouched all your personal files. • The swap partition is your “virtual memory”. If you have the space, make it twice the number of MB of RAM you have, but no more than 2048M is usually necessary. You can have multiple swap partitions if you do huge number crunching activities. • You need a root partition. If you are cavalier, this can be the only partition you create, though I would recommend against it. Other partitions that you might create are /usr, /var, /home. All of the public software you install goes into /usr. It should therefore be a sizeable partition with respect to the others (5G minimum). One advantage to making /usr its own partition is that you may want to mount it read only (I don’t, but paranoid sysadmins do). /var holds things like print and mail spools, system logs, and TEX fonts created by Metafont as well as postscript fonts, and it is also the temporary repository for all Debian packages when downloading from the Debian mirror. Thus at times there is a large demand for space, while at other times it is underutilized. It needs read/write permissions in general. It should be at least 1G. Then comes /home which contains the home directories of all users who have accounts on your machine. For most setups in which the Linux box is not going to have lots of users, the following might be reasonable. 1 Note your root partition will contain many important directories/mount points in- cluding: /etc (where all the config files are kept), /bin (some system binaries), /boot(kernels and system maps), /lib (among other things all the modules for each kernel), /root (root’s home directory), /sbin (more sensitive sysadmin binaries), /tmp (globally writable temp space). For a 10G drive: – swap: 1G – /: 1G – /usr: 4G – /var: 1G – /home: 3G For a 40G drive with only a few users: – swap: 2G (or multiple 2G partitions) – /: 2G – /usr: 15G – /var: 5G – /home: 15G If you have lots of users (and user files), you may want to put /usr at 10G and increase /home accordingly. 2 Setting up the Network: The first thing you need to access is whether you need a fixed IP address, or can get by with a dynamically assigned IP address. In general, you should try to use a dynamic address unless you are providing services: running various servers (e.g. web. print, mail, etc) where a fixed address is important to clients. If your mail is delivered to another machine (BlitzMail or the department mail server), you don’t need a fixed IP address. You should not need to run your own print server (that too routes through the department), and unless you want to run your own web site and not use the department pages, you don’t need a web server. So most workstations can get by just fine with a dynamic IP address. However, if you really need one, you apply for one by filling out the form at http://www.dartmouth.edu/~network/hostmaster.html If you are using a dynamic IP address the networking information will be setup automat- ically by the linux installer program. If you are setting up a fixed IP, you will need a name and some networking information. Once you decide on a name, fill out the form mentioned above, and you will be given the following type of information: 2 • IP address: 129.170.147.xxx • Netmask: 255.255.255.0 • Network address: 129.170.147.0 • Broadcast address: 129.170.147.255 • Gateway address: 129.170.147.1 In addition, you need the Domain Name server addresses: 129.170.16.4 and 129.170.17.4 3 LILO To be able to boot multiple operating systems, you need a loader which will load the desired operating system. LILO (LInux LOader) works well. Below is a typical lilo.conf file which I have annotated for some clarity. The reasons for having multiple Linux entries are mentioned below in the section on kernel building. # /etc/lilo.conf - See: ‘lilo(8)’ and ‘lilo.conf(5)’, # --------------- ‘install-mbr(8)’, ‘/usr/share/doc/lilo/’, # and ‘/usr/share/doc/mbr/’. # +---------------------------------------------------------------+ # | !! Reminder !! | # | | # | Don’t forget to run ‘lilo’ after you make changes to this | # | conffile, ‘/boot/bootmess.txt’, or install a new kernel. The | # | computer will most likely fail to boot if a kernel-image | # | post-install script or you don’t remember to run ‘lilo’. | # | | # +---------------------------------------------------------------+ # Enable map compaction: # Tries to merge read requests for adjacent sectors into a single # read request. This drastically reduces load time and keeps the # map smaller. Using ‘compact’ is especially recommended when # booting from a floppy disk. It is disabled here by default # because it doesn’t always work. # # compact 3 # Support LBA for large hard disks. # lba32 # boot=/dev/sda (for the first scsi drive) boot=/dev/hda map=/boot/map install=/boot/boot.b ## Puts up a prompt to choose which OS to boot prompt ## Times out in 5 seconds to the first (default) OS timeout=50 vga=normal default=linux #append="hdd=ide-scsi" image=/vmlinuz label=linux root=/dev/hda2 read-only image=/vmlinuz-2.4.18-pre6 label=linux-2.4.18-p6 root=/dev/hda2 read-only image=/vmlinuz.old label=linux-old root=/dev/hda2 read-only optional # If you have another OS on this machine to boot, you can uncomment the # following lines, changing the device name on the ‘other’ line to # where your other OS’ partition is. # other=/dev/hda1 label=win table=/dev/hda 4 The format is fairly simple. The image=/vmlinuz refers to a link in your / directory which points to a compressed kernel in /boot. The label is the label by which you want lilo to refer to this kernel, and which you will select at the LILO boot: prompt. 4 X server tidbits The installer for XFree86 has become much better, but you need to know some information about your video card. Much can be autodetected, but it is worth your while to gather as much information as you can before hand. Most cards are on the PCI bus, and typing lspci will scan the display and give you some information about the devices on the bus. For example, you might see: 01:00.0 VGA compatible controller: nVidia Corporation Riva TnT2 [NV5] (rev 11) This indicates not only the this is an nVidia Riva TnT2 card, but also that its bus address is “PCI:01:00:0”. If you don’t know, you may be able to find out how much memory the video card has by reading the BIOS messages when the machine first boots. Alternatively, many of these values will be probed and determined by reading the /var/log/XFree86.0.log file. To test X, you will need to install at least the following debian packages: xserver-xfree86 xterm xbase-clients xfonts-base xfonts-75pdi When you install these (in particular xserver-xfree86) you will be asked a series of ques- tions about your video card, and display device. Answer as well as you can, you can always redo it. If you don’t know the name of the driver to use (for example “nv” for the nVidia card), consult the driver status page at http://www.xfree86.org/. To test the configuration type startx from a (root) console. If you get a grey screen with an X that moves with your mouse, you are doing well. Hit CTRL-ALT-BACKSPACE to kill the Xserver. You can read the logs as mentioned above /var/log/XFree86.0.log to look for problems. You might also check root’s home directory for a .xsession-errors file. If the Xserver didn’t start, read the logs. You can try to use the standard configurer for X: /usr/bin/X11/xf86cfg. This will ask you lots of questions about your video card, and monitor specs, but it will provide a little more help. Next you need a window manager (e.g. twm, window maker, sawfish, etc), and perhaps a session manager (e.g. gnome, kde). I am rather a fan of gnome, so I will tell you how to get that going, and you can play from there. Install the packages: 5 gnome-session gnome-terminal sawfish-gnome After they are installed, once again type startx and see whether a gnome-session starts up. If it looks good, go on to add a few more things. If not, . Supposing it went well, hit CTRL-ALT-BACKSPACE to kill the Xserver, and install gdm gtk-engines* gnome-applets gnome-audio gnome-media The most important package is gdm (gnome display manager) which will (at reboot) start the xserver automatically and put up a login window.