Linux Manual Assignment 1
Linux Manual Assignment 1
Linux Manual Assignment 1
What are Linux Basic Installation Steps? & Record every configuration at each step in your notebook clear enough to allow someone else to exactly follow your installation Steps.
Custom installation allows you to make changes as you go through the installation procedure. It gives you maximum flexibility. Workstation will simply leave off a lot of stuff you may want such as ftp, web server, telnet capability, etc. Server is a hard core installation that is strictly intended to give you a Linux server with high performance. In other words, using Server means there is very little else on the system except the core files.
Partitioning
Most flavors of Linux, including Mandrake, Red Hat, and Slack ware, will give you the option of automatically partitioning or allowing you to custom partition.
If you dont plan to do anything fancy with your server, then you can go ahead and choose Automatic partitioning (often called Basic). Using a newer version of Linux, the result will be a very simple partitioning of your hard disk into three sections. This is fine for basic work or beginner use. If you prefer to use Disk Druid tool (often called Expert) it will enhance partitions and to give you more flexibility. It may sound intimidating, but using this tool ends up giving you a lot more control over what happens to your installation. If you use fdisk, although with some flavors it is the only option. fdisk, is used only for cases that require complicated partitions. If you choose Automatic (Basic) partitioning you will likely see:
It is absolutely critical that you ONLY select the hard disk/s that you want Linux running on! Otherwise, you will lose all data on all drives! In this example Ive unselected my Windows hard drive (hda). Once youve chosen which drive to automatically partition, please skip ahead to "Boot Loader Configuration" further below.
However, if you prefer to choose the Disk Druid tool (sometimes called Expert), please keep reading for details on partitioning.
Dual Booting? How can you add partitions to the same hard disk on which you have Windows or another OS? This can be done, but must be done carefully! It is not recommend sharing the same hard drive between multiple Operating Systems, especially when new hard disks are so cheap. Youll also find that some operating systems make it very difficult to have a dual boot with Linux. However, there are some options for sharing Linux and another OS: 1. Run Linux under another OS like MS Windows. This is not at all recommended since you will lose many of the benefits of Linux. 2. Erase all of the current partitions and make new ones to handle both Operating Systems. For instance you would create a vfat partition for Windows, and several ext3 partitions for Linux. This takes a lot of time, and requires a full reinstall. But it offers you a way to share one hard drive with several Operating Systems. 3. Purchase a second hard drive and install it into your system as the Linux hard drive. You can still choose which OS to load, but they are safely on separate hard drives in their own partitioning schemes.
NOTE that some versions of Windows have issues when placed on the 2nd drive. You may need to place Windows on the primary drive.
TIP: For dual-boot systems with more than one hard drive, please be certain that for each of the next few steps the Allowable Drive selected is only the one you want for deleting and creating Linux partitions on! You must do this each time you add a new partition mount point!
A. Create Mount Point: /boot Create Mount Point /boot which will be the area where Linux kernel and startup information is kept. Usually allocate several hundred MB at most to this. For this installation here we assigned 133MB.
B. Create mount point: / Create the Mount Point / that will be the area where root files and most programs are kept. It is usually recommended at least having 2GB in this area.
C. Create mount point: <Linux Swap> Create the Mount Point <Linux Swap> by going to the Partition Type, also called File System Type, and choosing Swap. Scroll down until you see Swap and select it. The Mount Point field will automatically fill in for you in most versions. The swap partition is a partition used to store temporary system data. We usually make the swap file smaller than our total system RAM or the system will end up swapping more than storing in memory! For instance our server has 512 MB of RAM, and we create a Swap of 256 MB. If you do this, on some of the newer versions of Red Hat and Mandrake youll get a strange error complaining that the Swap file is too small. You can just ignore this message as long as you have made your swap size larger than 100 MB. D. Create Mount Point: /usr Create Mount Point /usr which is the area where user related programs and files go. Be sure to select the option for Use Remaining Space. In some flavors this option is called Fill to maximum allowable size. This will correct the Actual size so that the remainder of your hard drive space is given to /usr. You should have at least 4GB of total disk space available to install everything from your Linux CD!
TIPS: You can also add the /home mount point to ensure there is a unique mount point for individual users. This is very helpful if you expect a lot of users on this server and intend to add additional disk drive space for them in the future.
Network Setup
Unselect the DHCP option and be sure to set a host name manually. We usually set up stand-alone Linux servers, such as intra-office web servers. So in almost no case we use DHCP (Dynamic Host Configuration Protocol). You can certainly use DHCP if you want another server to establish this system's network IP. Hostname is usually a simple name such as: myserver For some Linux versions, usually the simplified releases, the installation does not include steps to go through the details of network host and IP installation. In any case, we recommend that you add this information manually. You can always add or change network configurations later by typing at the Linux command prompt: netconfig Manually insert the system's IP address and host name. You can do this in some Linux flavors by pressing the Edit button next to your Network Device name. Then unselect the DHCP option!
just type in your machines IP and netmask into the available fields.
Some releases of Mandrake, Red Hat, and Slackware, once you designate the IP, will automatically fill in fields like Netmask and Gateway. If your Linux fills in Netmask for you, please be sure you really should be using the default setting of 255.0.0.0! Most networks require 255.255.255.0. The fields that will not be filled in are your DNS server IPs. You need to get them off another machine in your local network area or simply ignore them for now if you dont have a domain name server. TIPS: In many cases the easiest way to figure out what all these numbers should be in a business setting is to check a PC nearby. To find out about your particular networks IP information you may try these: If you have other Linux servers already in your LAN then use the command: netstat If you have Windows systems in your LAN use the command: winipcfg
Firewall Settings
Just leave your firewall settings on Medium if you have no idea what to do! This should be fine for running something like a simple Linux intranet web server. At the same time, you need to consider the security risk of your particular system. If its going to connect directly to the Internet the risk goes up substantially. TIP: We are installing a server within the corporate firewall and although security is always important, we have the ability to simplify my life by customizing the Medium secure firewall by doing the following: Selecting ETH0 (my servers ethernet card) as a trusted device Selecting the TCP, FTP, SSH, and Telnet options to allow incoming access from these connections and applicable ports. This is NOT a good idea if your server is going to be connected to the internet!
settings!
Password Protection
We rarely enable NIS, LDAP, or Kerberos. On the latest Red Hat and Mandrake releases, SMB is also an option. In some corporate situations where Kerberos IDs are standard we must include this. However, for a simple Linux server none of these are necessary.
Package Installation
Now when it comes time to select which Linux applications you want to install, there is a vast array of options. Many times, simply installing everything will work just fine! Do so if you have time and disk space! What you personally decide to do is a matter of choice, but should be tempered with the fact that installing everything doesnt make life easier, but installing too few things will definitely make life harder! We strongly recommend you install both KDE and GNOME interfaces which come with their own distinct applications. These are two of the popular X-Windows Desktop interfaces. It is well worth installing these two interface managers, even if you only plan on using one, since the installation will add lots of extra applications and goodies for you. The choices are yours to make and we recommend you take time to read through the basic listing. If you plan to install everything, be sure you have allowed at least 4GB of space. By leaving off a number of the developers tools like Kernel Development and
some Servers we never use like DHCP and News servers, the installation takes around 2GB. Also, since its been a point of confusion to many, you dont need to install the Windows File Server to just do basic file sharing between your Linux machine. This server actually loads SAMBA and other tools. Please note that some of the tools I refer to in this book are going to be installed only if you select the right packages or install everything.
First Time Boot-Up Troubleshooting The first time you start the Linux server, youll notice a number of detailed configurations information scroll across your screen. Next to all of these should be a green check or the word OK. However, if you encounter issues, we list some suggestions below:
If starting your system results in an indefinite hang at the initial load up, it may require turning off and back on your PC. If this doesnt fix it, you may have to try using your emergency boot disk. Sometimes this is a result of a serious error caused by a bad installation. Other symptoms of a bad install include Hard Disk errors that prompt you to use fsck to correct. These usually mean your hard drive has bad sectors, or that the Linux installation files were corrupted and require you to do a reinstall. If you get to the startup and next to Eth0 is the word Failed, you may need to simply plug in a LAN cable to your systems network card.
Partition
Disk partitioning is the creation of separate divisions of a hard disk drive using partition editors such as fdisk. Once a disk is divided into several partitions, directories and files of different categories may be stored in different partitions. Many new Linux sys admin (or Windows admin) create only two partitions / (root) and swap for entire hard drive.
Mount point
A mount point is a directory (typically an empty one) in the currently accessible filesystem on which an additional filesystem ismounted (i.e., logically attached). A filesystem is a hierarchy of directories (also referred to as a directory tree) that is used to organize files on a computer system. On Linux and other Unix-like operating systems, at the very top of this hierarchy is the root directory, which contains all other directories
on the system, inclusive of their subdirectories, etc. A variant of this definition is the part of the entire hierarchy of directories (i.e., of the directory tree) that is located on a single partition or disk. A partition is a logically independent section of a hard disk drive (HDD). The mount point becomes the root directory of the newly added filesystem, and that filesystem becomes accessible from that directory. Any original contents of that directory become invisible and inaccessible until the filesystem is unmounted (i.e., detached from the main filesystem). The default mount points for a system are the directories in which filesystems will be automatically mounted unless told by the user to do otherwise. They are listed in /etc/fstab, which is a plain text configuration file that contains information about the major filesystems on a computer. The first column in /etc/fstab shows the device (i.e., the partition or disk), and the second column shows its default mount point.
Package
In the past, many Linux programs were distributed as source code, which a user would build into the required program or set of programs, along with the required man pages, configuration files, and so on. Nowadays, most Linux distributors use prebuilt programs or sets of programs called packages, which ship ready for installation on that distribution
Boot loader
A bootloader is a small program that loads an operating system kernel into memory and transfers control to it from the BIOS. Typically a "boot loader" is a CD containing anywhere from 1 or more boot options, a popular disc is "barts boot disc." Another definition of "boot loader" is anything that boots up during windows when it starts, usually before windows has access to its critical components. Many virus checkers and even windows' own chkdsk (check disk) will be included with this definition.
Answer following 1. Why did you put /boot in the first location of the hard drive and forced it to be a primary Partition?
Your boot partition ought to be a primary partition, not a logical partition. This will ease recovery in case of disaster, but it is not technically necessary. It must be of type 0x83 "Linux native". If you are using a version of lilo before 21-3 (ie, from the 1990s), your boot partition must be contained within the first 1024 cylinders of the drive. (Typically, the boot partition need only contain the kernel image.) If you have more than one boot partition (from other OSs, for example,) keep them all in the first 1024 cylinders (All DOS partitions must be within the first 1024). If you are using a modern version of lilo, or a means other than lilo to load your kernel (for example, a boot disk or the LOADLIN.EXE MS-DOS based Linux loader), the partition can be anywhere.
2. What is the advantage of using different partitions for different sections of the file system?
There are several good reasons why you might partition your disk device
To improve performance
To improve performance, you should place frequently accessed files in a partition at the start of the hard disk drive.
To install more than one Operating System, you should create separate partitions for each OS.
To share data among Operating Systems, you should place your data in a file system in a separate partition that can be read from and written to by all your OS (e.g., FAT32).
To make computer maintenance tasks quicker, you should store your data in a separate partition.
Because managing multiple partitions can become onerous, you should only create or reserve space for as many partitions as you reasonably need.
3. Specifically describe the critical difference between the partitions /dev/hda1 and /dev/hda5.
Disk /dev/hda: 16 heads, 38 sectors, 683 cylinders Units = cylinders of 608 * 512 bytes Device Boot Begin Start /dev/hda1 * 1 1 /dev/hda5/ 255 255 End 203 331 Blocks Id 61693 6 310432+ 83 System DOS 16-bit >=32M Linux native
The first partition, /dev/hda1, is a DOS-formatted file system used to store the alternative operating system (Windows 95). This gives me 1 Gb of space for that operating system. The partitions, /dev/hda5 is e2fs-formatted file systems used for the / (root), /usr, and the /home partitions, respectively.
4. Why dont you want to use root as the regular login on your machine?
The most sought-after account on your machine is the superuser account. This account has authority over the entire machine, which may also include authority over other machines on the network. Remember that you should only use the root account for very short specific tasks and should mostly run as a normal user. Running as root all the time is a very very very bad idea. Linux shell and Basic shell commands
filename(s) Examples
Values to match What it does only list file/directory names in current directory list all file/directory information in current directory(long version) list all files in current directories and below list all files, sorted by most recent accessed first list files in the '/etc/ directory, only starting with 'rc' and sort results by most recent
Ls ls l ls R ls lt ls -lt /etc/rc*
) For a long view of the listing with time stamps, file permissions and file ownerships type
to change to, then press <Enter>: $ pwd /u/susannah $ cd /usr/adm $ pwd /usr/adm You tell cd which directory to change to by giving it an argument. You can use either a relative or an absolute (starting with ``/'') pathname as an argument to cd.
The /etc/directory contain essential System configuration files including /etc/hosts, /etc/resolv.conf, nsswitch.conf, defaults and network configuration files. These are mostly host specific system and application configuration files
You can use command [root@pc1
To display the path to the directory you r currently working in, type
If you are a system admin, you must frequently work with the UNIX Shell Terminal Command. If so, you've probably have come to a point where you want to know in which directory you are currently working. So to display the directory you are at, execute the following command: CODE:
pwd
Once you have entered this command, the shell will display the directory you are in example: CODE:
/home/my_name
Exercise-2: This exercise illustrates how to clear screen contents and display history of command already used in the shell.
If you what to see the list of all co`mmands you have used on the shell, type: To clear the terminal screen, type: If you need to clear the contents your screen very fast, depending on your shell, you can use either clear command, or ^L (Ctrl+L) combination, if you're using bash shell. ^L is available on bash shell, while clear is available on most UNIX releases and on most shells. I've tested it on AIX, Red Hat and FreeBSD on sh, bash, ksh. Also, you can issue the simple clear command and your screen will be cleared or add it as an alias for one key: alias a='clear' and pressing a key and then ENTER, your teminal will be cleared.
Exercise-3: This exercise illustrates how to Display or change system date and display calendar of different months and years. To display calendar of the current month type:
Just enter cal command as follows: $ cal Output:
August 2007 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Output: 1988
January
February
March
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
9 10 11 12
13 14 15 16 17 18 19
10 11 12 13 14 15 16
9 10 11 12 13 14 15
20 21 22 23 24 25 26
17 18 19 20 21 22 23
16 17 18 19 20 21 22
27 28 29 30 31
24 25 26 27 28 29
23 24 25 26 27 28 29
30 31
April
May
June
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
9 10 11 12
9 10
9 10 11 12 13 14
13 14 15 16 17 18 19
11 12 13 14 15 16 17
15 16 17 18 19 20 21
20 21 22 23 24 25 26
18 19 20 21 22 23 24
22 23 24 25 26 27 28
27 28 29 30
25 26 27 28 29 30 31
29 30
July
August
September
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
9 10 11 12
9 10 11 12 13
13 14 15 16 17 18 19
10 11 12 13 14 15 16
14 15 16 17 18 19 20
20 21 22 23 24 25 26
17 18 19 20 21 22 23
21 22 23 24 25 26 27
27 28 29 30 31
24 25 26 27 28 29 30
28 29 30
31
October
November
December
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
Su Mo Tu We Th Fr Sa
9 10 11
9 10 11 12 13
12 13 14 15 16 17 18
9 10 11 12 13 14 15
14 15 16 17 18 19 20
19 20 21 22 23 24 25
16 17 18 19 20 21 22
21 22 23 24 25 26 27
26 27 28 29 30 31
23 24 25 26 27 28 29
28 29 30 31
30
Use the following syntax to set new data and time: date --set="STRING" For example, set new data to Thu Mar 3 23:05:25 2009 , type the following command as root user:
# date -s "thu Mar 3 23:05:25 2009