SYSTEM ADMINISTRATION LAB

91
examkey.wordpress.com 1 T.J.S Polytechnic College SYSTEM ADMINISTRATION LAB NAME : REGISTER NO : DEPARTMENT : COMPUTER ENGINEERING YEAR/SEM : III/VI

Transcript of SYSTEM ADMINISTRATION LAB

Page 1: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

1 T.J.S Polytechnic College

SYSTEM ADMINISTRATION

LAB

NAME :

REGISTER NO :

DEPARTMENT : COMPUTER ENGINEERING

YEAR/SEM : III/VI

Page 2: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

2 T.J.S Polytechnic College

Page 3: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

3 T.J.S Polytechnic College

SI.NO DATE INDEX

EXPERIMENT TITLE SIGNATURE

PART – A WINDOWS 2003/2008 SERVER EXPERIMENTS

1. Windows Server 2008 Installation

2. Device manager and Driver Query

3. Active Directory Services

4. Windows Server Automated Installation

5. Windows Server2008 components Installation

6. DHCP Server Installation and Configuration

7. Configuring Disks and Volumes using Disk

Manager

8. Mail Server Installation

9. RAID(0,1,5) Configuration

10. Router Configuration

PART – B LINUX SERVER EXPERIMENTS

1. Red Hat Installation in Graphical mode

2. Red Hat Installation in command prompt

3. Creating user and assigning rights

4. Configuration and Troubleshooting of

/etc/inittab and /etc/passwd

5. Configuration and Troubleshooting Grub

6. TCP/IP Network Configuration

7. RPM(Redhat Package Manager)

8. Samba Server

9. Data Backup using TAR

Page 4: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

4 T.J.S Polytechnic College

Page 5: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

5 T.J.S Polytechnic College

Ex.No.1 Windows Server 2008 Installation

Aim

Procedure

Steps to install Windows Server 2008 :

1. Insert the appropriate Windows Server 2008 installation media into your DVD drive.

2. Reboot the computer.

3. When prompted for an installation language and other regional options, make your

selection and press Next.

4. Next, press Install Now to begin the installation process.

Page 6: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

6 T.J.S Polytechnic College

5. Select your correct version in the next

screen,

6. Read and accept the license terms by

clicking to select the checkbox and

pressing Next.

7. In the "Which type of installation do

you want?" window, click the only

available option – Custom (Advanced).

8. In the "Where do you want to install

Windows?", if you're installing the

server on a regular IDE hard disk, click to

select the first disk, usually Disk 0, and

click Next.(If you're installing on a hard

disk that's connected to a SCSI controller,

click Load Driver and insert the media

provided by the controller's

manufacturer.)f you must, you can also

click Drive Options and manually create a

partition on the destination hard disk.

9. The installation now begins.

Copying the setup files from the DVD to

the hard drive only takes about one minute.

However, extracting and uncompressing

the files takes a good deal longer. After 20

minutes, the operating system is installed.

The exact time it takes to install server core

Page 7: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

7 T.J.S Polytechnic College

depends upon your hardware specifications. Faster disks will perform much faster installs…

Windows Server 2008 takes up

approximately 10 GB of hard drive space.

10. Then the server reboots you'll be

prompted with the new Windows Server

2008 type of login screen. Press

CTRL+ALT+DEL to log in.

Once the install is finished, we’re prompted to change our password before logging in.

Windows requires that you have a strong

password, seven characters long with at least

three of the four following: uppercase letter,

lowercase letter, numeral, or symbol. You’ll

want to make sure you write it down

somewhere for now, because if you forget it

later, the entire install will have to be re-done.

11. Finally, the desktop appears and that's

it, you're logged on and can begin working.

You will be greeted by an assistant for the

initial server configuration, and after

performing some initial configuration tasks,

you will be able to start working.

Result

Page 8: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

8 T.J.S Polytechnic College

Ex.No.2 Device manager and Driver Query

Aim

Procedure

Opening Device Manager

Device Manager can be opened in any of the following ways:

Using the Windows interface

To open Device Manager by using the Windows interface 1. Click Start, and then click Control Panel.

2. Click Hardware.

3. Click Device Manager. One of the following occurs:

o If you are logged on as the built-in Administrator account, Device Manager

opens.

o If you are logged on as a user that is a member of the Administrators group, then

the User Account Control dialog box appears, and you must click Continue to

open Device Manager.

o If you are logged on as a standard user, a message appears indicating that you

cannot make any changes to the devices. Click OK to open Device Manager in

read-only mode.

Using a command line

To open Device Manager by using the command line At a command prompt, in the Start Search box, or in the Run box, type the following

command:

mmc devmgmt.msc

Using Computer Management

To open Computer Management by using the Windows interface 1. Click Start, then right-click Computer, and then click Manage.

2. Click Device Manager in the navigation pane.

Device installation in Windows

Device and device driver installation in Windows Server 2008 operates as shown in the

following diagram. "PnP" in the diagram refers to the Plug and Play service running in

Page 9: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

9 T.J.S Polytechnic College

Windows. If any of the described security checks fail, or if an appropriate device driver package

cannot be found, then the process stops.

1. When a user inserts a device, Windows detects the new hardware and signals the Plug

and Play service to make the device operational.

2. Plug and Play identifies the device.

3. Plug and Play searches the driver store for a driver package that matches the device. If a

matching package is not found, goto step 4. If a matching package is found, skip to step 8.

4. Windows searches for a matching driver package by looking in the following locations,

stopping as soon as a matching package is found:

o Searching folders specified by the DevicePath registry entry. For more

information, see Configure Windows to Search Additional Folders for Device

Drivers.

o Searching the Windows Update Web site. For more information, see Configure

Windows to Search Windows Update for Device Drivers.

o Prompting the user for media.

5. Windows checks that the user has permission to place the driver package in the driver

store. The user must have administrator credentials, or computer policy is set to allow

standard users to install devices that have this identifier. For more information about this

policy, see Configure Computer Policy to Allow Non-Administrators to Install Specific

Devices.

6. Windows checks that the driver package has a valid digital signature. If the driver

package is signed by a certificate that is valid, but not found in the Trusted Publishers

store, then Windows prompts the user for confirmation.

Page 10: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

10 T.J.S Polytechnic College

7. Windows places a copy of the driver package in the driver store.

8. PnP copies the driver files from the driver store to their operational locations, typically

%systemroot%\windows32\drivers.

9. PnP configures the registry to instruct Windows how to use the newly installed drivers.

10. PnP starts the newly installed drivers. This step is repeated at each computer restart to

reload the drivers.

Uninstalling a Plug and Play device

Typically, you do not need to uninstall a Plug and Play device. Just disconnect or unplug the

device so that Windows does not load or use the driver. Some devices might require that you turn

off the computer first. To ensure that you do this properly, see the device manufacturer's

instruction manual.

Uninstalling a non-Plug and Play device

Uninstalling a non-Plug and Play device typically involves two steps:

1. Using Device Manager to uninstall the device.

2. Removing the device from your computer.

Use Device Manager to uninstall a non-Plug and Play device. After uninstalling a device,

you must physically disconnect or remove the device from your computer. For example, if the

device is connected to a port on the outside of your computer, shut down your computer,

disconnect the device from the port, and then unplug the power cord for the device.

Result

Page 11: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

11 T.J.S Polytechnic College

Ex.No.3 Active Directory Services

Aim

Procedure

Installation

Open Server Manager and click on roles, this will bring up the Roles Summary on the right

hand side where you can click on the Add Roles

link.

This will bring up the Add Roles Wizard where you can click on next to see a list of

available Roles. Select Active Directory Domain Services from the list, you will be told that you

need to add some features, click on the Add Required Features button and click next to move

on.

A brief introduction to Active Directory will be displayed as well as a few links to additional

resources, you can just click next to skip past here and click install to start installing the binaries

for Active Directory.

Page 12: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

12 T.J.S Polytechnic College

When the installation is finished you will be shown a success message, just click close.

Configuration

Open up Server Manager, expand Roles and click on Active Directory Domain Services. On

the right hand side click on the Run the Active Directory Domain Services Installation Wizard

(dcpromo.exe) link.

Page 13: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

13 T.J.S Polytechnic College

This will kick off another wizard, this time to configure the settings for you domain, click

next to continue.

The message that is shown now relates to older clients that do not support the new

cryptographic algorithms supported by Server 2008 R2, these are used by default in Server 2008

R2, click next to move on.

Page 14: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

14 T.J.S Polytechnic College

Choose to create a new domain in a new forest.

Now you can name your domain, we will be using a .local domain the reason why will be

explained in an upcoming article.

Page 15: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

15 T.J.S Polytechnic College

Since this is the first DC in our domain we can change our forest functional level to Server

2008 R2.

We want to include DNS in our installation as this will allow us to have an AD Integrated

DNS Zone, when you click next you will be prompted with a message just click yes to continue.

Page 16: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

16 T.J.S Polytechnic College

You will need to choose a place to store log files, it is a best practice to store the database

and SYSVOL folder on one drive and the log files on a separate drive, but since this is in a lab

environment I will just leave them all on the same drive.

Choose a STRONG Active Directory Restore Mode Password and click next twice to kick

off the configuration.

Page 17: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

17 T.J.S Polytechnic College

You will be able to see what components are being installed by looking in the following box.

When its done you will be notified and required to reboot your PC.

Page 18: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

18 T.J.S Polytechnic College

That’s all there is to it guys, now you have a working installation of Active Directory.

CREATE USER :

1. Click on Start Administrative tools Active Directory User and Computers .

2. Expand Domain name tree (com-networks.com ) then Right -click on Users then Click

on New and then click on User .

3. On the New Object-User windows , Type First name , initials , last name and then Give the

User Logon name . then Click on Next .

Page 19: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

19 T.J.S Polytechnic College

4. Now Type Password and then confirm Password .

if you want user can change password at next logon then select User must change password at

net logon .

and if you want user can not change password then Select Password never expired . And then

Click on Finish .

User Assign Permissions Using Logon :

To assign a logon script to a local user account

1. Click Start, Administrative Tools and Active Directory Users and Computers.

2. In the console tree, click Users .

3. Right-click the user account that you want, and then click Properties .

4. On the Profile tab, in Logon script , type the file name and relative path of the script.

Page 20: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

20 T.J.S Polytechnic College

To create logon script

Our objective with this map network drive script remains to map a drive, but this time it's the

J: drive. My share name and server are, '\home' and '\\alan'.

1. Open Notepad.

2. Type

' VBScript to map a network drive to a UNC Path.

Option Explicit

Dim objNetwork

Dim strDriveLetter, strRemotePath

strDriveLetter = "J:"

strRemotePath = "\\alan\home"

' Purpose of script to create a network object. (objNetwork)

' Then to apply the MapNetworkDrive method. Result J: drive

Set objNetwork = CreateObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

WScript.Quit

' End of Example VBScript.

3. Save the file with .vbs extension e.g. MapNetworkDrive.vbs.

4. Double click your script and check in your Windows Explorer for a new drive called :

home on 'alan' (J:)

Pre-requisites.

1. On Line 10 change the server name from '\\alan' to your server name.

2. Make sure that your server has a share called '\home'.

Assign Permission Using Group Policy:

To start GPMC

Do either of the following:

o Click Start, click All Programs, click Run. Type gpmc.msc in the text box, and

then click OK or press ENTER.

o Click Start, click Administrative Tools Programs, click Group Policy

Management.

To create a Group Policy object

1. In the GPMC console tree, right-click Group Policy Objects in the forest and domain in

which you want to create a GPO.

2. Click New .

3. In the New GPO dialog box, specify a name for the new GPO, and then click OK .

To edit a Group Policy object

1. In the GPMC console tree, double-click Group Policy Objects in the forest and domain

containing the GPO that you want to edit.

2. Right-click the GPO, and then click Edit .

To edit Administrative Templates policy settings

Page 21: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

21 T.J.S Polytechnic College

1. Using the Local Group Policy Editor, open the Local Group Policy object you want to

edit.

2. In the console tree, click the folder under Administrative Templates that contains the

policy settings you want to configure.

3. In the Setting column, click the name for a policy setting to read a description of the

policy setting.

4. To change that policy setting from its current state, double-click the name of the policy

setting.

5. In the policy setting dialog box, click one of the following:

o Not Configured : The registry is not modified.

o Enabled : The registry reflects that the policy setting is selected.

o Disabled : The registry reflects that the policy setting is not selected.

6. Select any other options that you want, and then click OK .

To delete a GPO

1. In the Group Policy Management Console (GPMC) console tree, double-click Group

Policy Objects in the forest and domain containing the Group Policy object (GPO) that

you want to delete.

2. Right-click the GPO, and then click Delete .

3. When prompted to confirm the deletion, click OK

Result

Page 22: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

22 T.J.S Polytechnic College

Ex.No.4 Windows Server Automated Installation

Aim

Procedure

Step 1 : Create an ImageUnattend.xml Setup Script – Windows Server 2008 (SP2 or R2)

1. Insert the Windows Server 2008 DVD media.

2. Copy all the Windows Server 2008 catalog files into the Catalogs folder of the device

driver repository. For example:

copy DVDDrive:\source\*.clg C:\Unattend\Drivers\{WSK8|W28R2}\Catalogs

3. Launch the Windows System Manager application and create a new ImageUnattend.xml

Setup Script by doing the following:

a. Click Start-->All Programs -->Microsoft Windows AIK -->Windows System

Image Manager.

b. In the Answer File pane, right-click and select New Answer File.

c. If a message dialog appears asking to open a new Windows image now, click No.

4. Do the following to specify the Windows Server 2008 Catalog file that matches the

Windows Server 2008 edition (Standard, Datacenter, or Enterprise) that you are

installing:

a. In the Windows Image pane, right-click and select Windows Image.

b. In the Files Type list box, select Catalog files (*.clg), then click Browse to specify

the Catalogs folder in the device driver repository.

Ensure that you select the Catalog file that matches the Windows Server 2008

edition you are installing. For example, for Windows Server 2008 SP2 Standard,

select:

C:\Unattend\Drivers\{W2K8|W2K8R2}\Catalogs\install_Windows_Server_2

008_SERVERSTANDARD.clg

5. Do the following to specify an installation key value.

a. In the Answer File pane, click and expand 2

offlineServicing,architecture_Microsoft-Windows-

PnPCustomizationsNonWinPE_version.

b. Click and expand PathAndCredentials and enter a sequence key value as well as

the UNC device driver path in the repository.

For example, to add the device driver for the Sun Storage PCIe SAS RAID

HBA option, enter:

Key 1

Path \\wds-server\W2K8-Drivers\Lsi\1.19.2.64

c. In the Credential section for each PathAndCredentials component, click and

expand the component to insert the UNC domain, logon, and password (if

Page 23: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

23 T.J.S Polytechnic College

required), which allow access to the device drivers stored in the repository. For

example:

Domain UNC_domain

Password UNC_password

Username UNC_username

d. Repeat Steps 5a through 5c for each device driver you want installed during the

Windows Server 2008 installation.

6. Validate the ImageUnattend.xml file using the Windows System Image Manager

application:

o In the Windows System Image Manager application, click the Tools menu and

select Validate Answer File.

A message appears in the Message pane indicating that No Warnings or Errors

are found.

o Save the .xml Setup Script as ImageUnattend.xml using the Windows System

Image Manager application:

c. In the Windows System Image Manager application, click the File menu and

select Save Answer File as.

d. Save the .xml Setup Script in the device driver repository as:

c:\Unattend\Drivers\W2K8\Catalogs\ImageUnattend.xml

e. Exit the Windows System Image Manager application.

The creation of the ImageUnattend.xml Setup Script is complete.

Step 2 : Map ImageUnattend.xml Setup Script to Windows Server 2008 (SP2 or R2)

Install Image

Follow the steps in this procedure to map the ImageUnattend.xml Setup.

1. Perform the following to launch the Windows Deployment Services Administration tool

and import the Windows Server 2008 SP2 install WIM.

a. Click Start-->All Programs-->Windows Deployment Services.

b. Right-click Install Images and select Add Install Image.

c. Click Browse to select the Windows Server 2008 SP2 Install WIM image located

at: DVDDrive:\sources\install.wim; then proceed by clicking Open then Next.

d. Select the Windows Server 2008edition (Data Center, Standard, or Enterprise) to

import into Windows Deployment Services, then click Next.

Page 24: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

24 T.J.S Polytechnic College

e. Perform the following steps to open the Windows Server 2008 (SP2 or R2) image

properties.

f. Launch the Windows Deployment Services Administration tool.

Click Start-->All Programs-->Windows Deployment Services.

g. In the Windows Deployment Services (WDS) Administration tool, click and

expand the Windows Server 2008 image group.

h. Right-click Microsoft Windows Server and select Properties.

i. Perform the following steps to map the ImageUnattend.xml Setup Script to the

Windows Server 2008 image.

j. In the General Tab of the Windows Server 2008 image properties, check Allow

image to install in unattended mode and click Select File.

k. Browse to the following location then click OK.

Drive:\RemoteInstall\images\{W2K8|W2K8R2}\install\Unattend\ImageUnatt

end.xml

l. Click OK to map the ImageUnattend.xml Setup Script to

the Windows Server 2008 WIM image.

The Windows Server 2008 WIM image is ready to be

installed using Windows Deployment Services.

m. Exit the Deployment Tools Command Prompt and the

Windows Deployment Services Administration tool.

Step 3 : Install Windows Server 2008 (SP2 or R2) Using PXE

1. Reset or power on the server.

2. Press F10 to specify a temporary boot device.

3. In the Please Select Boot Device menu, select the appropriate PXE installation boot

device and press Enter.

4. In the Boot Agent dialog, press F12 for a network service boot.

5. Continue the normal Windows Server 2008 SP2 or 2008 R2 WDS network installation.

Result

Page 25: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

25 T.J.S Polytechnic College

Ex.No.5 Windows Server 2008 Components Installation

Aim

Procedure

Windows Server 2008 eases the task of managing roles in an enterprise with the new Server

Manager console. Server Manager replaces several features included with Windows Server 2003,

including Manage Your Server, Configure Your Server, and Add or Remove Windows

Components.

Procedure :

1. Open Server Manager:

o Run Administrative Tools | Server Manager

o Click Features in the left-hand tree

o Click “Add New Feature” to initiate the “Add Features Wizard”

2. Select the .Net Framework feature:

o When the wizards starts, it presents a welcome screen, click the Next button

o Expand the “.Net Framework 3.5.1 Features”

o If you plan to install IIS on this machine, stop: you should first install IIS and then

come back to .Net 3.51

o Else, just click the checkbox called “.Net Framework 3.5.1″

(Note: do not click the checkbox called “.Net Framework 3.5.1 Features” because

this installs portions of IIS!)

(Even More Details: from a security perspective, you should not install IIS on a

database server.)

3. Complete the installation:

o Click the Next button until you see the final screen.

o Click the Finish button at the final screen.Once you have complete this

installation.

Page 26: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

26 T.J.S Polytechnic College

Result

Page 27: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

27 T.J.S Polytechnic College

Ex.No.6 DHCP Server Installation and Configuration

Aim

Procedure

Open Server Manager

Right click on roles, and then select add roles.

You will be prompted with the normal “Before You Begin” screen, and after clicking Next

you’ll be able to choose DHCP Server.

Page 28: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

28 T.J.S Polytechnic College

Next you’ll want to select the network connection to bind the DHCP protocol to.

Put in the IP address of your DNS Server, which in this case is the same machine–but be

careful not to put the loopback address (127.0.0.1) as this will be the address your clients will

go to for name resolution.

Click next again to skip the WINS setup, this will bring you to creating a DHCP Scope,

where you can click the Add button.

Page 29: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

29 T.J.S Polytechnic College

Now you need to:

Give your scope a name

Enter the first address that you want available to clients to use

Enter the last address that you want available to clients to use

Enter the subnet mask (usually 255.255.255.0)

Enter the IP address of your default gateway (usually your router IP at .1)

Once you have clicked on OK, you can click next 4 times to get to the confirmation screen

where you can finally click install.

Page 30: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

30 T.J.S Polytechnic College

Once the installation is complete your DHCP will be functioning, and you can start managing

your DHCP server right away.

Result

Page 31: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

31 T.J.S Polytechnic College

Ex.No.7 Configuring Disks and Volumes using Disk Manager

Aim

Procedure

To start Disk Management:

1. Log on as administrator or as a member of the Administrators group.

2. Click Start -> Run -> type compmgmt.msc -> click OK. Alternatively, right-click on the

My Computer icon and select 'Manage'.

3. In the console tree, click Disk Management. The Disk Management window appears.

Your disks and volumes appear in a graphical view and list view. To customize how you

view your disks and volumes in the upper and lower panes of the window, point to Top or

Bottom on the View menu, and then click the view that you want to use.

How to create a new partition or a new logical drive

To create a new partition or logical drive on a basic disk:

1. In the Disk Management window, complete one of the following procedures, and then

continue to step 2:

o To create a new partition, right-click unallocated space on the basic disk where

you want to create the partition, and then click New Partition.

o To create a new logical drive in an extended partition, right-click free space on an

extended partition where you want to create the logical drive, and then click New

Logical Drive.

2. In the New Partition Wizard, click Next.

3. Click the type of partition that you want to create (either Primary partition, Extended

partition, or Logical drive), and then click Next.

4. Specify the size of the partition in the Partition size in MB box, and then click Next.

5. Decide whether to manually assign a drive letter, let the system automatically enumerate

the drive, or do not assign a drive letter to the new partition or logical drive, and then

click Next.

6. Specify the formatting options you want to use by using one of the following procedures:

o If you do not want to format the partition, click Do not format this partition, and

then click Next.

o If you want to format the partition, click Format this partition with the following

settings, and then complete the following procedure in the Format dialog box:

a. Type a name for the volume in the Volume label box. This is an optional

step.

b. Click the file system that you want to use in the File system box.

You can change the disk allocation unit size, and then specify whether to

Page 32: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

32 T.J.S Polytechnic College

perform a quick format, or enable file and folder compression on NTFS

volumes.

Click Next.

Confirm that the options that selected are correct, and then click Finish.The new partition

or logical drive is created and appears in the appropriate basic disk in the Disk Management

window. If you chose to format the volume in step 6, the format process now starts.

How to format a basic volume

To format a partition, logical drive or basic volume:

1. In the Disk Management window, right-click the partition or logical drive that you want

to format (or reformat), and then click Format.

2. In the Format dialog box, type a name for the volume in the Volume label box. This is an

optional step.

3. Click the file system that you want to use in the File system box. If you want, you can

also change the disk allocation unit size, specify whether you want to perform a quick

format, or enable file and folder compression on NTFS volumes.

4. Click OK.

5. Click OK when you are prompted to format the volume. The format process starts.

How to view the properties of a basic volume

To view the properties of a partition or logical drive:

1. In the Disk Management window, right-click the partition or logical drive that you want,

and then click Properties.

2. Click the appropriate tab to view the appropriate property.

How to delete a partition or a logical drive

To delete a partition or logical drive:

1. In the Disk Management window, right-click the partition or logical drive that you want

to delete, and then click Delete Partition or Delete Logical Drive.

2. Click Yes when you are prompted to delete the partition or logical drive. The partition or

logical drive is deleted.

Managing Disks and Volumes using Command Prompt: Click Start > Run and type “CMD” and press Enter. We need to next start the Disk Part tool, type “DISKPART” into the Command Line and press Enter

Page 33: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

33 T.J.S Polytechnic College

Check number of disk connected on diskpart

Diskpart > list disk

Selecting the disk or partition

Diskpart > select disk 1

Listing all the partition on computer

Diskpart > list volume

Deleting the volume/partition

Diskpart > delete volume 13

Creating partition

Diskpart > create partition primary

Formatting partition

Diskpart > select volume 13

Volume 13 is selected

Page 34: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

34 T.J.S Polytechnic College

Diskpart> format fs=ntfs quick // for Formatting in NTFS in quick mode

or

Diskpart> format fs=fat32 //for formatting in FAT32 file system simple

Assigning drive latter

Diskpart > assign p for assigning latter p

Diskpart> assign d:/new volume for assigning mount folder

For all other functionality which is rarely used, you can refer the help section of diskpart.

Diskpart > help

Result

Page 35: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

35 T.J.S Polytechnic College

Ex.No.8 Mail Server Installation

Aim

Procedure

Installing the SMTP feature

1. Click Start > Run and then enter servermanager.msc in the Open dialogue box then

click OK to load Server Manager:

C:\>servermanager.

msc

2. Use the Add Features Wizard to select SMTP Server on the Select Features page. To

initiate this, right-click on Features and click Add Feature:

3. In the Features section check SMTP Server and click Next:

4. You may see a dialogue box like the one below stating that certain role services and

features are required for SMTP:

Page 36: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

36 T.J.S Polytechnic College

5. Click Add Required Role Services and then you will return to the previous Features

section. Ensure SMTP Server is checked then click Next.

6. In the Web Server (IIS) section, click Next to proceed to the Role Services section:

7. The Role Services should be pre-populated – IIS 6 Management Compatibility should

be selected, and below it, IIS 6 Metabase Compatibility and IIS 6 Management Console

should also be checked. Click Next to continue:

Page 37: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

37 T.J.S Polytechnic College

8. In the Confirmation section click Install:

9. In the Results section click Close to complete the installation of the SMTP Server:

Configuring the SMTP Server

The next step is to configure SMTP. To do so we will need to open Internet Information

Services (IIS) Manager 6.

10. Click Start > Run and then enter inetmgr6 in the dialogue box then click OK to load IIS

Manager

11. In IIS 6 Manager right-click on SMTP Server and select Properties:

Page 38: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

38 T.J.S Polytechnic College

12. In the General tab, unless you want the SMTP Server to use a specific IP address, leave

the settings as they are so that the IP address is set to (All Unassigned):

13. To proceed, click on the Access tab:

Page 39: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

39 T.J.S Polytechnic College

14. Click on the Authentication button and ensure Anonymous access is checked and then

click OK:

15. Once back in the Access tab, click on the Connection button. Select Only the list below

and then click Add. Enter 127.0.0.1 as the IP addess and then click OK:

The Connection setting controls which computers can connect to the SMTP server and send

mail. By granting only localhost (127.0.0.1) acces,s limits only the server itself the ability to

connect to the SMTP server. This is a requirement for security.

16. Click OK to return to the Access tab and then click on the Relay button. Enter 127.0.0.1

as the IP addess and then click OK:

Page 40: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

40 T.J.S Polytechnic College

17. Next, go to the Messages tab. Here you can enter an email address where copies of non-

delivery reports are sent to. You can also configure the location of the Badmail director,

however, the default setting should suffice:

18. Next, go to the Delivery tab:

19. Click on the Outbound Security button and ensure Anonymous access is selected. As

the only server that can connect and relay mail through the SMTP server is localhost this

security settings is fine:

Page 41: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

41 T.J.S Polytechnic College

20. Click OK to return to the Delivery tab and then click on Outbound Connections. Leave

the defaults as they are:

21. Click OK to return to the Delivery tab and then click on Outbound Connections, then

click on the Advanced button:

Here you will need to enter the fully-qualified domain name of the SMTP server. This will be

the host name or A record that has been created in your DNS zone file. This is straight-

forward to do but you will have to confirm how you do this with the party that manages DNS

for your domain. I have entered mail.vsysad.com as this is fully-qualified. If you click on the

Check DNS button you can confirm whether your chosen name resolves successfully. In my

case it does as I see the following:

Page 42: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

42 T.J.S Polytechnic College

22. Click OK and then OK again to exit the SMTP Virtual Server Properties.

You can also perform this test by running nslookup to confirm the existence of the host name

as well as confirming the IP address it resolves to – which should the IP address of your

server:

Testing the SMTP Server The next step is to verify that the SMTP server is able to send email successfully. To do this

follow the steps below:

23. Create a text file on your desktop called email.txt and paste the following into it,

remembering to change the email address information to reflect your own details:

From:

[email protected]

To:

[email protected]

Subject: Email

test

24. Save the changes to email.txt and then copy the file to C:\inetpub\mailroot\Pickup. The

SMTP server monitors this folder and when it detects the email.txt file, it will read the

contents and send the email to the address in the To: section. This should happen almost

immediately.

25. Check the email address the email was sent to and it should arrive shortly – the email was

sent to my Gmail account:

Result

Page 43: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

43 T.J.S Polytechnic College

Ex.No.9 RAID Configuration

Aim

Procedure

Accessing the Disk Manager with Multiple Methods

1. Press Windows Key + R (run dialogue) and type "diskmgmt.msc"

2. Click "Start" (Alternative Method)

a. Expand "Administrative Tools"

b. Select "Server Manager" (Right click and Pin to Taskbar for ease of access later).

i. In Server Manager, Click on the [+] next to

"Storage"

ii. Click on Disk Management.

Convert Basic Disks to Dynamic Disks

1. While in the Disk Management interface, select the disks. You may be prompted to

“initialize” the new disks, this will not interfere. Please initialize the disks.

2. On the Left-Side of the LOWER pane, you see physical disk descriptions, “Disk 0”

a. Right-Click on the gray area of your 320GB Drives with the description and

select “Convert to Dynamic Disk”

b. Repeat for your second 320GB Disk. (Note both of their DISK#s for Creating a

Volume)

RAID 0

In this section a striped volume will be created using two similarly sized disk drives

connected to a Windows Server 2008 R2 system (note that if the disks are of different sizes

Windows will base the available volume size on the smallest disk drive in the striped set).

1. Within the Disk Management tool right click on the unallocated space in the graphical

view of the first disk to be used in the stripe set and select Create New Striped Volume.

2. Click Next on the welcome screen to proceed to

the disk selection screen. Initially, the wizard only

lists the currently selected disk in the Selected

column. In order to proceed, at least one more disk

is required. To add disks to the striped, select a

suitable disk from the available disks in the right

hand column and click on Add to add it to the

selected disks list:

3. With the necessary disks selected click Next to

proceed and assign a drive letter or mount point

for the volume.

4. The Next button will then proceed to the Format

Volume screen where the file system type and

Page 44: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

44 T.J.S Polytechnic College

compression options may be selected. To view the summary screen, press the Next

button. Assuming the summary is acceptable the Finish button will format the volumes

and create the striped volume ready for use.

RAID 1

In this section a mirrored set will be created using two similarly sized disk drives connected

to a Windows Server 2008 R2 system. The system used in this example contains three disks

numbered 0, 1 and 2 respectively. Disk 0 is the system disk and disks 1 and 2 will be used to

create a mirrored set.

1. Within the Disk Management tool right click on the unallocated space in the graphical

view of the first disk to be used in the mirror set.

2. select New Mirrored Volume... to invoke the New Mirrored Volume wizard.

3. Click Next on the welcome screen to proceed to the disk selection screen. As mentioned

previously, a mirrored set must be comprised of two disk drives. Initially, the wizard only

lists the currently selected disk in the Selected column. In order to proceed, one more disk

is required. To add a disk to the mirrored set, select a suitable disk from the available

disks in the left hand column and click on Add to add it to the selected disks list:

4. With the necessary disks selected click Next to proceed and assign a drive letter or mount

point for the volume.

5. The Next button will then proceed to the Format Volume screen where the file system

type and compression options may be selected. To view the summary screen, press the

Next button. Assuming the summary is acceptable the Finish button will format the

volumes and create the mirrored volume ready for use.

RAID 5

RAID 5 implementation requires a minimum of 3 disk drives. A system containing four disk

drives is assumed. In this scenario, disk 0 is the system disk and disks 1 through 3 are

available for use in the RAID 5 configuration.

1. Assuming these prerequisites are met the first step is to right click on one of the 3 disks in

the Disk Management graphical view. In the resulting popup menu select the New RAID-

5 Volume... option to invoke the New RAID-5 Volume wizard.

2. On the wizard's welcome page click on the Next button to proceed to the Disk Selection

screen. This screen contains a list of disk drives available for inclusion in the disk array

together with a list of selected disks. Currently only the current disk is included in the

Selected list. Two more disks must be added to the selected disks before the RAID 5

array can be built.

3. Select disks from the Available list and click on the Add> button to add the disk to the

selected list. Once sufficient disks (in this case disks 1, 2 and 3) are selected the Next

button will activate to allow the remainder of the configuration to be completed. Note

that disk 0 (the system disk) is not included in the RAID 5 array:

Page 45: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

45 T.J.S Polytechnic College

4. With the disk selections completed, the Next button proceeds to the drive letter and

mount point assignment screen.

5. Once these settings are configured click Next to proceed to the Format Volume screen.

Select the appropriate file system and compression options.

6. click on Next to proceed to the Summary screen. Review the information displayed and

click on Finish to initiate the RAID 5 creation process. During this process the Disk

Management graphical view will list the disks as Formatting and then Resynching. The

amount of time these phases will take depends on the size of the volumes in question.

Once the process is complete the status will change to Healthy and the RAID 5 volume is

ready for use.

Result

Page 46: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

46 T.J.S Polytechnic College

Ex.No.10 Router Configuration

Aim

Procedure

Step 1 : Assign IP address as shown figure.

Step 2 : Install Routing on Windows Server 2008

1. Start Server Manager.

2. Click on Roles, and then click on Add Roles.

3. Since this is a clean install we get a Before You Begin warning page telling us that if

we’re going to install a role on a server to make sure it is secure. If you get this page, just

click Next.

4. On the Select Server Roles page go ahead and place a check next to Network Policy and

Access Services. Click Next after you’re done.

Page 47: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

47 T.J.S Polytechnic College

5. The next page gives you an overview of the Network Policy and Access Services and

everything that you can do with it. Read through the various options and click Next.

6. The Select Role Services page now comes up and we are going to go ahead and place a

check next to Routing & Remote Access Services.

Note that you cannot just click on Routing because it is dependent on the Remote Access

Service also being installed; then click Next.

7. You are now asked to confirm your installation selections, review everything and then

click on Install.

8. After a few minutes you should see an Installation Results page and the outcome hopefully

is Installation Succeeded, review any messages and then click Close.

9. Now in Server Manager you can see in roles that Network Policy and Access Services is

now installed, but it is in a down state because no devices are associated to the service.

Page 48: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

48 T.J.S Polytechnic College

Step 3 : Configure Routing on Windows Server 2008

1. Click on Start, Administrative Tools, Routing and Remote Access

2. When the Routing and Remote Access MMC starts you will notice that the server has a red

down arrow showing that it is currently offline.

Right click on the server and select configure and Enable Routing and Remote access.

3. The Routing and Remote Access Server Setup Wizard will now come up, go ahead and

click Next to get started.

4. There are quite a few default options for this service that include:

Page 49: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

49 T.J.S Polytechnic College

Remote Access

Network Address Translation (NAT)

Virtual Private Network (VPN) & NAT

Secure Connection Between Two Private Networks

Custom Configuration

We are going to choose Custom Configuration and click Next.

5. In the Custom Configuration screen you can choose several services, but for this demo go

ahead and place a check next to LAN routing and then click Next.

6. Again you will see a summary of your selections and you can go ahead and click on

Finish.

7. Next a pop-up window will tell you that Routing & Remote Access service is now ready

to use, and you can click on Start service to start it.

8. After a few seconds the service will start and the wizard will close. You can see in the

Routing and Remote Access MMC that the server now has a green up arrow which shows that it

is in a enabled state and functioning.

Page 50: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

50 T.J.S Polytechnic College

Step 4 :

ROUTE COMMAND :

The route command-line tool, which is designed specifically to display and manage the IP

routing table.

Syntax

route [/f] [/p] [<Command> [<Destination>] [mask <Netmask>] [<Gateway>] [metric

<Metric>]] [if <Interface>]]

Paramete

r Description

/f Clears the routing table of all entries.

/p

When used with the add command, the specified route is added to the registry and is

used to initialize the IP routing table whenever the TCP/IP protocol is started. By default,

added routes are not preserved when the TCP/IP protocol is started.

<Comman

d>

add Adds a route.

change Modifies an existing route.

delete Deletes a route or routes.

print Prints a route or routes.

<Destinati

on> Specifies the network destination of the route. The destination can be an IP network

address (where the host bits of the network address are set to 0), an IP address for a host

route, or 0.0.0.0 for the default route. mask

<Netmask>

<Gateway

>

Specifies the forwarding or next hop IP address over which the set of addresses

defined by the network destination and subnet mask are reachable.

metric

<Metric>

Specifies an integer cost metric (ranging from 1 to 9999) for the route, which is used

when choosing among multiple routes in the routing table that most closely match the

destination address of a packet being forwarded.

if

<Interface> Specifies the interface index for the interface over which the destination is reachable.

/? Displays Help at the command prompt.

Example:

route print

route add 0.0.0.0 mask 0.0.0.0 10.0.20.1 /p

Result

Page 51: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

51 T.J.S Polytechnic College

Page 52: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

52 T.J.S Polytechnic College

Ex.No. 1 Red Hat Installation in Graphical mode

Aim

Procedure

Boot computer using Red Hat Installation DVD.

1. Select Install or upgrade an existing

system option on Grub Menu

2. Choose a language

3. Choose a keyboard type

4. Choose a installation media

Page 53: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

53 T.J.S Polytechnic College

5. Skip DVD media test (or select media

test, if you want to test installation media

before installation)

6. Red Hat 6 graphical installer starts,

select next

7. Accepct Pre-Release Installation

8. Select storage devices

9. Insert computer name

Page 54: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

54 T.J.S Polytechnic College

10. Select time zone

11. Enter a password for root user

12. Select type of installation

Read every options info carefully. And

select encrypting if needed and option to

review and modify partition layout.

13. Review partition layout

Modify if needed.

14. Accept write changes to disc

Page 55: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

55 T.J.S Polytechnic College

15. Writing changes to disc

16. Configure boot loader options

Select device to install bootloader and

check/create boot loader operating system

list.

17. Select softwares to install and enable

repositories

This case we select Software

Development Workstation and enable Red

Hat Enterprise Linux 6.0 Beta Repository

and select Customize now.

18. Customize package selection

Select PHP and Web Server to

installation.

19. Checking dependencies for

installation

Page 56: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

56 T.J.S Polytechnic College

20. Starting installation process

21. Installing

packages

22. Installation is complete

Click reboot computer and remove

installation media.

Red Hat 6 RHEL Finishing

Installation

23. Selecting RHEL 6 from grub

Page 57: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

57 T.J.S Polytechnic College

24. Booting Red Hat 6

25. Red Hat 6 Welcome screen

26. Create normal user

27. Setup date and time and keep up-to-

date with NTP

28. Login Red Hat 6 Gnome Desktop

Page 58: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

58 T.J.S Polytechnic College

29. Red Hat (RHEL) 6 Gnome Desktop,

empty and default look.

Result

Page 59: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

59 T.J.S Polytechnic College

Ex.No.2 Red Hat Installation in command prompt

Aim

Procedure

1. Insert the downloaded Red hat Linux DVD on the DVD ROM, make the DVD ROM to boot

first by changing the boot devices priority in the bios setup by pressing Del or F2 or F10

key depending upon your manufacture.

2. Tab to Edit the menu, at the end type “linux text”

3. DVD will check the hardware information, it will ask you to verify the integrity of the

installation media (DVD). Select Skip by using Tab and Enter to continue.

Page 60: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

60 T.J.S Polytechnic College

4. Use Tab and press Enter on Welcome Screen.

5. Use up or down arrow to select the language and Tab or Alt-Tab to switch between options,

press Enter to OK.

6. Use up or down arrow to select the keyboard and Tab or Alt-Tab to switch between options,

press Enter to OK.

Page 61: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

61 T.J.S Polytechnic College

7. Next is the new installation for the HDD, it will ask you to initialize the HDD because

it doesn’t have partition or table. If you are trying to install on the HDD that has other

partitions, won’t ask you like this.

8. Select the Time Zone.

Page 62: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

62 T.J.S Polytechnic College

9. Enter root password.

10. As this is the new installation, you can select Replace Existing Linux System and then press

enter.

Page 63: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

63 T.J.S Polytechnic College

11. Confirm the installation.

12. Installing the Red hat Enterprise Linux.

Page 64: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

64 T.J.S Polytechnic College

13. Installation finished, Enter to reboot.

14. Login with as root with it’s password.

Page 65: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

65 T.J.S Polytechnic College

Result

Ex.No.3 Creating user and assigning rights

Aim

Procedure

There are two methods for adding new users to a system, one way is using the graphical User

Manager tool and the other is to use the useradd command-line tool. In this section we will look at both

approaches.

Page 66: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

66 T.J.S Polytechnic College

To add a new user to your RHEL system using the User Management tool, select the System

desktop menu and choose Users and Groups from the Administration sub-menu. A dialog similar to the

one shown below will appear:

To add a new user, click on the Add User button located in the toolbar. The Create New User

dialog will subsequently appear ready to be filled in with data relating to the new user, such as

username, real name, password and contact information:

Page 67: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

67 T.J.S Polytechnic College

Once the new user is configured, click on the OK button to add the new user. Once added, the new user

should appear in the list of users in the settings dialog and it should be possible to login into the RHEL

system using the username and password specified. As mentioned above it is also possible to add new

users from the command-line. To do so, start a terminal window session (Applications -> Accessories ->

Terminal) and at the command prompt enter a command similar to the following:

su -

useradd --home /home/john john

passwd john

The above commands will prompt for the root password of your system and the password for the

account. Once the information has been gathered useradd creates the new account and the /home/john

home directory. The useradd command provides a number of different options which can be learned

from the man page:

man useradd

A user account may also be deleted from command-line using the userdel utility:

su -

userdel john

Page 68: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

68 T.J.S Polytechnic College

It is also possible to remove the user's home directory and mail spool as part of the deletion process:

su -

userdel --remove john

Linux User rights

There are two types of user rights (traditional):

File level user rights or permissions granted using chmod and chown command

Administrative (root) level rights granted using sudo.

If you type the following command:

$ ls -l

-rw-r--r-- 1 vivek webusers 14814 2006-07-26 13:25 working-nixcraft.txt

Look at 3rd, 4th and last columns.

vivek is username or the owner of the file (userid)

webusers is group name, so all users in webusers can access file working-nixcraft.txt

working-nixcraft.txt is the file name.

As the root user you can change or setup user file related rights/permission using chmod and chown

command.

change file owner and group

Consider following example:

$ ls -l foo.txt

Output:

-rw-r--r-- 1 vivek webgroups 8 2006-08-08 17:57 foo.txt

Change files ownership to tony user:

# chown tony foo.txt

# ls -l foo.txt

Output:

-rw-r--r-- 1 tony webgroups 8 2006-08-08 17:57 foo.txt

Linux (and almost all other Unixish systems) have three user classes as follows:

User (u): The owner of file

Group (g): Other user who are in group (to access files)

Other (o): Everyone else

Page 69: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

69 T.J.S Polytechnic College

You can setup following mode on each files. In a Linux and UNIX set of permissions is called as

mode:

Read (r)

Write (w)

Execute (x)

However, above three modes or permission have different meaning for file and directory:

Linux Read mode permissions

Read access on a file allows you to view file

Read access on a directory allows you to view directory contents with ls command

Write mode permissions

Write access on a file allows you to write to file

Write access on a directory allows you to remove or add new files

Execute mode permissions

Execute access on a file allows to run program or script

Execute access on a directory allows you access file in the directory

Octal numbers and permissions

You can use octal number to represent mode/permission:

r: 4

w: 2

x: 1

For example, for file owner you can use octal mode as follows. Read, write and execute (full)

permission on a file in octal is

0+r+w+x = 0+4+2+1 = 7

Only Read and write permission on a file in octal is

0+r+w+x = 0+4+2+0 = 6

Only read and execute permission on a file in octal is

0+r+w+x = 0+4+0+1 = 5

Use above method to calculate permission for group and others.To give full permission to owner,

read & execute permission to group, and read only permission to others, then calculate permission as

follows:

Page 70: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

70 T.J.S Polytechnic College

User = r+w+x = 0+4+2+1 = 7

Group= r+w+x = 0+4+2+0 = 6

Others = r+w+x = 0+0+0+1 = 1

Effective permission is 761.

chmod command

To setup file permission use chmod command:

chmod {mode} {file-name}

To setup file permission 761 use chmod command as follows: # chmod 0761 file

To setup a file readable by anyone and writable by the owner only: # chmod 644 file

To setup a file readable/executable by everyone and writable by the owner only: # chmod 755 file

Change permissions for all files and directories within a directory by using the -R option on the

chmod command. For example, to setup others read and execute access to all files and directories

(and files and directories within directories), type command as follows (i.e. change the modes of the

file hierarchies rooted in the files instead of just the files themselves):

# chmod -R 755 directory-name/

Page 71: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

71 T.J.S Polytechnic College

Result

Ex.No.4a Configuration and Troubleshooting

Aim

Procedure

Syntax : id:rstate:action:process

The inittab file supplies the script to init's role as a general process dispatcher. The process that

constitutes the majority of init's process dispatching activities is the line process /etc/getty that

initiates individual terminal lines. Other processes typically dispatched by init are daemons and the

shell.

The inittab file is recreated automatically by idmkinit at boot time anytime the kernel has been

reconfigured. To construct a new inittab file, idmkinit concatenates the device driver init files in

/etc/conf/init.d onto the end of /etc/conf/cf.d/init.base (the default inittab).

I To add an entry directly to inittab, the change exists only until the kernel is relinked. To add an

entry permanently, then edit /etc/conf/cf.d/init.base. The init.base file has the same format as inittab.

The inittab file is composed of entries that are position-dependent. Each entry is delimited by a

new-line; however, a backslash (\) preceding a new-line indicates a continuation of the entry. Up to

512 characters per entry are permitted. Comments may be inserted in the ``process'' field using the sh

convention for comments. Comments for lines that spawn gettys are displayed by the who

command. It is expected that they will contain some information about the line such as the location.

There are no limits (other than maximum entry size) imposed on the number of entries within the

inittab file.

The four fields per entry in inittab or init.base are:

id This is up to four characters used to uniquely identify an entry.

rstate This defines the run-level in which this entry is to be processed. Each process spawned by

init is assigned one or more run-levels in this field at which it is allowed to exist. The run-levels

are represented by the numbers from 0 through 6, and the letters S or s (see init(M)).

Page 72: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

72 T.J.S Polytechnic College

For example, init processes the entries which have a 2 (or no specified run-level) in this field

when the system goes to run-level 2,

action Key words in this field tell init how to treat the process specified in the process field.

init recognizes the following actions:

boot The entry is to be processed only at init's boot-time read of the inittab file. init is to start the

process, not wait for its termination; and when it dies, not restart the process. In order for this

instruction to be meaningful, the rstate should be the default or it must match init's run-level at

boot time. This action is useful for an initialization function following a hardware reboot of the

system.

bootwait The entry is to be processed the first time init goes from single-user to multi-user state after

the system is booted. (If initdefault is set to 2, the process will run right after the boot.) init starts

the process, waits for its termination and, when it dies, does not restart the process.

initdefault An entry with this action is only scanned when init is initially invoked. Additionally, if init

does not find an initdefault entry in /etc/inittab, then it will request an initial run-level from the

user at reboot time.

off If the process associated with this entry is currently running, send the warning signal

(SIGTERM) and wait 20 seconds before forcibly terminating the process via the kill signal

(SIGKILL). If the process is nonexistent, ignore the entry.

once Upon init's entering a run-level that matches the entry's rstate, start the process; do not wait

for its termination. When it dies, do not restart the process. If upon entering a new run-level,

where the process is still running from a previous run-level change, the program will not be

restarted.

ondemand This instruction is really a synonym for the respawn action. It is functionally identical to

respawn but is given a different keyword in order to divorce its association with run-levels. This

is used only with the a, b, or c values described in the rstate field.

powerfail Execute the process associated with this entry only when init receives a power fail signal

(SIGPWR; see signal(S)).

powerwait

Page 73: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

73 T.J.S Polytechnic College

Execute the process associated with this entry only when init receives a power fail signal

(SIGPWR) and wait until it terminates before continuing any processing of inittab.

respawn If the process does not exist, then start the process; do not wait for its termination (continue

scanning the inittab file), and when it dies, restart the process. If the process currently exists, then

do nothing and continue scanning the inittab file.

sysinit init executes these entries when the system first goes to single-user mode after being

rebooted. It does not execute these entries if the system is subsequently put in single-user mode

from any of run-levels 1 through 6. Entries with sysinit in their action field do not specify a run-

level in their rstate field.

wait Upon init's entering the run-level that matches the entry's rstate, start the process and wait for

its termination. All subsequent reads of the inittab file while init is in the same run-level will

cause init to ignore this entry.

process This is a command to be executed by sh. The entire process field is passed to a forked sh to

be run by init. For this reason, any legal sh syntax can appear in the process field. Comments can

be inserted with the ; #comment syntax.

Example :

id:5:initdefault:

Edit inittab file:

# vi /etc/inittab

Page 74: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

74 T.J.S Polytechnic College

Result

Ex.No.4b Configuration and Troubleshooting

Aim

Procedure

/etc/passwd file stores essential information, which is required during login i.e. user account

information. /etc/passwd is a text file, that contains a list of the system's accounts, giving for each

account some useful information like user ID, group ID, home directory, shell, etc. It should have

general read permission as many utilities, like ls use it to map user IDs to user names, but write access

only for the superuser (root).

Understanding fields in /etc/passwd

The /etc/passwd contains one entry per line for each user (or user account) of the system. All

fields are separated by a colon (:) symbol. Total seven fields as follows.

Generally, passwd file entry looks as follows (click to enlarge image):

(Fig.01: /etc/passwd file format - click to enlarge)

1. Username: It is used when user logs in. It should be between 1 and 32 characters in length.

2. Password: An x character indicates that encrypted password is stored in /etc/shadow file.

3. User ID (UID): Each user must be assigned a user ID (UID). UID 0 (zero) is reserved for root

and UIDs 1-99 are reserved for other predefined accounts. Further UID 100-999 are reserved by

system for administrative and system accounts/groups.

4. Group ID (GID): The primary group ID (stored in /etc/group file)

Page 75: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

75 T.J.S Polytechnic College

5. User ID Info: The comment field. It allow you to add extra information about the users such as

user's full name, phone number etc. This field use by finger command.

6. Home directory: The absolute path to the directory the user will be in when they log in. If this

directory does not exists then users directory becomes /

7. Command/shell: The absolute path of a command or shell (/bin/bash). Typically, this is a shell.

Please note that it does not have to be a shell.

Task: See User List

/etc/passwd is only used for local users only. To see list of all users, enter: $ cat /etc/passwd To search for a username called tom, enter: $ grep tom /etc/passwd

/etc/passwd file permission

The permission on the /etc/passwd file should be read only to users (-rw-r--r--) and the owner must

be root:

$ ls -l /etc/passwd

Output:

-rw-r--r-- 1 root root 2659 Sep 17 01:46 /etc/passwd

Reading /etc/passwd file

You can read /etc/passwd file using the while loop and IFS separator as follows:

#!/bin/bash

# seven fields from /etc/passwd stored in $f1,f2...,$f7

while IFS=: read -r f1 f2 f3 f4 f5 f6 f7

do echo "User $f1 use $f7 shell and stores files in $f6 directory."

done < /etc/passwd

Page 76: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

76 T.J.S Polytechnic College

Result

Ex.No.5 Configuration and Troubleshooting of Grub

Aim

Procedure

The GRUB (GNU GRand Unified Boot loader) is the default boot loader for AMD32, AMD64,

Intel x86 and Intel EMT64T based hardware platforms. GRUB (GNU GRand Unified Boot loader)

enables the selection of the installed operating system at boot time. GRUB also allows the user to pass

arguments to the kernel while booting.

A sample grub.cof file is shown below. The lines beginning with a "#" are comments.

### Beginning of grub.conf ###

# grub.conf generated by anaconda

# Note that do not have to rerun grub after making changes to this file

# NOTICE: /boot partition. This means that

# all kernel and initrd paths are relative to /boot/, eg.

# root (hd0,0)

# kernel /vmlinuz-version ro root=/dev/sda2

# initrd /initrd-version.img

Page 77: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

77 T.J.S Polytechnic College

#boot=/dev/sda

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

#####First Operating System#####

title Red Hat Enterprise Linux Server (2.6.18-8.el5)

root (hd0,0)

kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet

initrd /initrd-2.6.18-8.el5.img

#####Second Operating System#####

title RedHat Operating System 2

root(hd1,0)

kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/sdb2 rhgb quiet

initrd /initrd-2.6.18-8.el5.img

### End of grub.conf ###

The grub.conf configuration file is explained in detail below.

• The default=0 directive points to the first stanza, which is the default Operating System to boot.

• The timeout=5 directive specifies the time, in seconds, for GRUB to automatically boots the default

operating system.

• The splashimage directive locates the graphical GRUB screen.

• The hiddenmenu directive means that the GRUB options are hidden.

A stanza begins with a titile, (the text to be displayed in boot menu for selecting the Operating

System) and the next three lines specify the location of the /boot directory, the kernel, and the initial

RAM disk (The initial RAM disk (initrd) is an initial root file system that is mounted prior to when

the real root file system is available), respectively.

• root (hd0,0) - Specifies the boot directory is in first hard disk, first Partition.

• kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet - Specifies the kernel location which is

inside the /boot folder. This location is related to the root(hd0,0) statement. The "ro" option specifies

the kernel should be opened as read only to protect it from any accidental writes from the initial

RAM disk and "rhgb" enables the RedHat Graphical boot option.

• initrd /initrd-2.6.18-8.el5.img - Initial RAM disk.

Page 78: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

78 T.J.S Polytechnic College

Result

Ex.No.6 TCP/IP Network Configuration Aim

Procedure

On most Linux systems, can access the TCP/IP connection details within 'X Windows' from

Applications > Others > Network Connections. The same may also be reached through Application >

System Settings > Network > Configure. This opens up a window, which offers configuration of IP

parameters for wired, wireless, mobile broadband, VPN and DSL connections:

Page 79: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

79 T.J.S Polytechnic College

The values entered here modify the files:

/etc/sysconfig/network-scripts/ifcfg-eth0

/etc/sysconfig/networking/devices/ifcfg-eth0

/etc/resolv.conf

/etc/hosts

The static host IP assignment is saved in /etc/hosts

The DNS server assignments are saved in the /etc/resolv.conf

IP assignments for all the devices found on the system are saved in the ifcfg-<interface> files

mentioned above.

If you want to see all the IP assignments, you can run the command for interface configuration:

# ifconfig

Page 80: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

80 T.J.S Polytechnic College

Following is the output of the above command:

[root@gateway ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:AB:21:3E

inet addr:192.168.1.18 Bcast:192.168.1.255 Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:feab:213e/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:1550249 errors:0 dropped:0 overruns:0 frame:0

TX packets:1401847 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:167592321 (159.8 MiB) TX bytes:140584392 (134.0 MiB)

Interrupt:19 Base address:0x2000

lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:71833 errors:0 dropped:0 overruns:0 frame:0

TX packets:71833 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:12205495 (11.6 MiB) TX bytes:12205495 (11.6 MiB)

The command ifconfig is used to configure a network interface. It can be used to set up the interface

parameters that are used at boot time. If no arguments are given, the command ifconfig displays the

status of the currently active interfaces. If to see the status of all interfaces, including those that are

currently down, can use the argument -a, such as -

# ifconfig -a

Fedora, Redhat Enterprise Linux, CentOS and other similar distributions supports user profiles as

well, with different network settings for each user. The user profile and its parameters are set by the

network-configuration tools. The relevant system files are placed in:

/etc/sysconfig/netwroking/profiles/profilename/

After boot-up, to switch to a specific profile you have to access a graphical tool, which will allow

you to select from among the available profiles. You will have to run:

$ system-config-network

Or for activating the profile from the command line -

$ system-config-network-cmd -p <profilename> --activate

Page 81: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

81 T.J.S Polytechnic College

Start and Stop the Network Interface Card

The ifconfig command can be used to start and stop network interface cards:

# ifconfig eth0 up

# ifconfig eth0 down

The ifup & ifdown command can also be used to start and stop network interface cards:

# ifup eth0

# ifdown eth0

Result

Ex.No.7 RPM(Redhat Package Manager)

Aim

Page 82: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

82 T.J.S Polytechnic College

Procedure

RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking

RPM packages on your Linux system.

RPM stands for Redhat Package Manager.

With root privilege, can use the rpm command with appropriate options to manage the RPM

software packages.

1. Installing a RPM package Using rpm -ivh

RPM filename has packagename, version, release and architecture name.

For example, In the MySQL-client-3.23.57-1.i386.rpm file:

MySQL-client – Package Name

3.23.57 – Version

1 – Release

i386 – Architecture

When installing a RPM, it checks whether the system is suitable for the software the RPM package

contains, figures out where to install the files located inside the rpm package, installs them on the

system, and adds that piece of software into its database of installed RPM packages.

The following rpm command installs Mysql client package.

# rpm -ivh MySQL-client-3.23.57-1.i386.rpm

Preparing... ########################################### [100%]

1:MySQL-client ########################################### [100%]

rpm command and options

-i : install a package

-v : verbose

-h : print hash marks as the package archive is unpacked.

Also use dpkg on Debian, pkgadd on Solaris, depot on HP-UX to install packages.

2. Query all the RPM Packages using rpm -qa

Use rpm command to query all the packages installed in the system.

# rpm -qa

cdrecord-2.01-10.7.el5

bluez-libs-3.7-1.1

setarch-2.0-1.1

.

.

-q query operation

Page 83: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

83 T.J.S Polytechnic College

-a queries all installed packages

To identify whether a particular rpm package is installed on the system, combine rpm and grep

command as shown below. Following command checks whether cdrecord package is installed on the

system.

# rpm -qa | grep 'cdrecord'

3. Query a Particular RPM Package using rpm -q

The above example lists all currently installed package. After installation of a package to check the

installation, query a particular package and verify as shown below.

# rpm -q MySQL-client

MySQL-client-3.23.57-1

# rpm -q MySQL

package MySQL is not installed

Note: To query a package, you should specify the exact package name. If the package name is

incorrect, then rpm command will report that the package is not installed.

4. Query RPM Packages in a various format using rpm –queryformat

Rpm command provides an option –queryformat, which allows to give the header tag names, to list

the packages. Enclose the header tag with in {}.

# rpm -qa --queryformat '%{name-%{version}-%{release} %{size}\n'

cdrecord-2.01-10.7 12324

bluez-libs-3.7-1.1 5634

setarch-2.0-1.1 235563

.

.

#

5. Which RPM package does a file belong to? – Use rpm -qf

List of files and would want to know which package owns all these files. rpm command has options

to achieve this.

The following example shows that /usr/bin/mysqlaccess file is part of the MySQL-client-3.23.57-1

rpm.

# rpm -qf /usr/bin/mysqlaccess

MySQL-client-3.23.57-1

-f : file name

6. Locate documentation of a package that owns file using rpm -qdf

Page 84: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

84 T.J.S Polytechnic College

Use the following to know the list of documentations, for a package that owns a file. The following

command, gives the location of all the manual pages related to mysql package.

# rpm -qdf /usr/bin/mysqlaccess

/usr/share/man/man1/mysql.1.gz

/usr/share/man/man1/mysqlaccess.1.gz

/usr/share/man/man1/mysqladmin.1.gz

/usr/share/man/man1/mysqldump.1.gz

/usr/share/man/man1/mysqlshow.1.gz

-d : refers documentation.

7. Information about Installed RPM Package using rpm -qi

rpm command provides a lot of information about an installed pacakge using rpm -qi as shown

below:

# rpm -qi MySQL-client

Name : MySQL-client Relocations: (not relocatable)

Version : 3.23.57 Vendor: MySQL AB

Release : 1 Build Date: Mon 09 Jun 2003 11:08:28

PM CEST

Install Date: Mon 06 Feb 2010 03:19:16 AM PST Build Host:

build.mysql.com

Group : Applications/Databases Source RPM: MySQL-3.23.57-1.src.rpm

Size : 5305109 License: GPL / LGPL

Signature : (none)

Packager : Lenz Grimmer

URL : http://www.mysql.com/

Summary : MySQL - Client

Description : This package contains the standard MySQL clients.

8. List all the Files in a Package using rpm -qlp

To list the content of a RPM package, use the following command, which will list out the files

without extracting into the local directory folder.

$ rpm -qlp ovpc-2.1.10.rpm

/usr/bin/mysqlaccess

/usr/bin/mysqldata

/usr/bin/mysqlperm

.

.

/usr/bin/mysqladmin

q : query the rpm file

l : list the files in the package

p : specify the package name

Can also extract files from RPM package using rpm2cpio as discussed earlier.

9. List the Dependency Packages using rpm -qRP

Page 85: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

85 T.J.S Polytechnic College

To view the list of packages on which this package depends,

# rpm -qRp MySQL-client-3.23.57-1.i386.rpm

/bin/sh

/usr/bin/perl

10. Find out the state of files in a package using rpm -qsp

The following command is to find state (installed, replaced or normal) for all the files in a RPM

package.

# rpm -qsp MySQL-client-3.23.57-1.i386.rpm

normal /usr/bin/msql2mysql

normal /usr/bin/mysql

normal /usr/bin/mysql_find_rows

normal /usr/bin/mysqlaccess

normal /usr/bin/mysqladmin

normal /usr/bin/mysqlbinlog

normal /usr/bin/mysqlcheck

normal /usr/bin/mysqldump

normal /usr/bin/mysqlimport

normal /usr/bin/mysqlshow

normal /usr/share/man/man1/mysql.1.gz

normal /usr/share/man/man1/mysqlaccess.1.gz

normal /usr/share/man/man1/mysqladmin.1.gz

normal /usr/share/man/man1/mysqldump.1.gz

normal /usr/share/man/man1/mysqlshow.1.gz

11. Verify a Particular RPM Package using rpm -Vp

Verifying a package compares information about the installed files in the package with information

about the files taken from the package metadata stored in the rpm database. In the following

command, -V is for verification and -p option is used to specify a package name to verify.

# rpm -Vp MySQL-client-3.23.57-1.i386.rpm

S.5....T c /usr/bin/msql2mysql

S.5....T c /usr/bin/mysql

S.5....T c /usr/bin/mysql_find_rows

S.5....T c /usr/bin/mysqlaccess

The character in the above output denotes the following:

S file Size differs

M Mode differs (includes permissions and file type)

5 MD5 sum differs

D Device major/minor number mismatch

L readlink(2) path mismatch

U User ownership differs

G Group ownership differs

T mTime differs

12. Verify a Package Owning file using rpm -Vf

Page 86: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

86 T.J.S Polytechnic College

The following command verify the package which owns the given filename.

# rpm -Vf /usr/bin/mysqlaccess

S.5....T c /usr/bin/mysql

#

13. Upgrading a RPM Package using rpm -Uvh

Upgrading a package is similar to installing one, but RPM automatically un-installs existing versions

of the package before installing the new one. If an old version of the package is not found, the

upgrade option will still install it.

# rpm -Uvh MySQL-client-3.23.57-1.i386.rpm

Preparing... ###########################################

[100%]

1:MySQL-client ###########################################

14. Uninstalling a RPM Package using rpm -e

To remove an installed rpm package using -e as shown below. After uninstallation, query using rpm

-qa and verify the uninstallation.

# rpm -ev MySQL-client

15. Verifying all the RPM Packages using rpm -Va

The following command verifies all the installed packages.

# rpm -Va

S.5....T c /etc/issue

S.5....T c /etc/issue.net

S.5....T c /var/service/imap/ssl/seed

S.5....T c /home/httpd/html/horde/ingo/config/backends.php

.

.

S.5....T c /home/httpd/html/horde/ingo/config/prefs.php

S.5....T c /etc/printcap

Result

Ex.No.8 Samba Server

Page 87: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

87 T.J.S Polytechnic College

Aim

Procedure Samba allows both RHEL resources to be shared with Windows systems and Windows resources

to be shared with RHEL systems. RHEL accesses Windows resources using a package named

samba-client. RHEL resources, on the other hand, are shared with Windows systems using a

package named samba.

Installation of Samba :

Before installing lets check if it's already installed or not by following command.

[root@samba~]# rpm -q samba

[root@samba~]# package samba is not installed.

Now install the package.

Rpm –ivh samba-3.5.4-68.el6_0.1.x86_64

Editing /etc/samba/smb.conf file to create shares available for windows users.

[root@samba~]# vim /etc/samba/smb.conf

Now time to choose between public & private shares.

Public shares :

Accessible by any user, just you need to open run in windows xp then type ip of samba server.

like \\192.168.85.155\ . all the public shares will be listed. you can access there.

See how to create one:

[root@samba~]# vim /etc/samba/smb.conf

just add following lines at the end of the file.

#/etc/samba/smb.conf

[public]

comment = Public Shares

browsable = yes

path = /var/data

public = yes

writable = yes

guest ok = yes

Page 88: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

88 T.J.S Polytechnic College

public ==> share name.

Now your Samba server is ready start the service make it up and running to share data between linux

and window.

[root@samba~]# /etc/init.d/smb restart

Start samba at startup :

[root@samba~]# chkconfig smb on

Result

Page 89: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

89 T.J.S Polytechnic College

Ex.No.9 Data Backup using TAR

Aim

Procedure

Tar is archiving utility in Linux. With tar command we can archive multiple files and

directories into a single file, extension of that file is “.tar”. gzip and bzip compression techniques can

be used with tar command.

Synatx :

# tar [options] [name of tar file to be created] [list of files & directories to be included]

Options:

-A, --catenate, --concatenate ----> append tar files to an archive

-c, --create ----> create a new archive

-d, --diff, --compare ---> find differences between archive and file system

--delete ---> delete from the archive (not on mag tapes!)

-r, --append ---> append files to the end of an archive

-t, --list ----> list the contents of an archive

--test-label ---> test the archive volume label and exit

-u, --update ---> only append files newer than copy in archive

-x, --extract, --get ----> extract files from an archive

In these examples, use the following file structure: a top level directory called DIR1 containing the

files picture.jpg, document.doc and database.db.

DIR1/

DIR1/picture.jpg

DIR1/document.doc

DIR1/database.db

[Creating a tarball]

Page 90: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

90 T.J.S Polytechnic College

If were in the directory DIR1 and wanted to backup all the files to a tarball called backup.tar, then

could issue this command:

$ tar cvf backup.tar .

./

picture.jpg

doucment.doc

database.db

tar: backup.tar is the archive; not dumped

Note: c=create (an archive)

v=verbose (just because)

f=filename (the name of our tarball)

.=current directory (what's going to be backed up)

Also worth mentioning is that by default tar is recursive- meaning it will back up all files and

subdirectories recursively unless otherwise specify with the n flag (non-recursive)

[Displaying the Contents of a Tarball]

The current directory will now contain a file called backup.tar. To display the contents of the tarball

file, can could issue this command:

$ tar tvf backup.tar

drwxr-xr-x root/gci 0 Jun 29 10:10 ./

-rw-r--r-- root/gci 1 Jun 29 10:10 picture.jpg

-rw-r--r-- root/gci 1 Jun 29 10:10 document.doc

-rw-r--r-- root/gci 1 Jun 29 10:10 databse.db

Note: t=table of contents (list)

v=verbose (display all info)

f=filename (backup.tar)

[Extracting Data from a Tarball] To extract the entire contents of the tarball to the current directory type:

$ tar xvf backup.tar

./

picture.jpg

doucment.doc

database.db

Note: x=extract

v=verbose

f=filename (backup.tar)

To extract only the picture.jpg file from the archive, type the following command:

$ tar xvf backup.tar picture.jpg

Page 91: SYSTEM ADMINISTRATION LAB

examkey.wordpress.com

91 T.J.S Polytechnic College

Alternatively, can use wild cards in either the creation or extraction of a tarball. To extract all jpg

files from the archive, use command like this:

$ tar xvf backup.tar *.jpg

[Using Compression]

To add compression to the tarballs, then combine the gzip utility with tar on the command line by

adding the z switch to the command. Usually when this is done, then change the suffix of tarball

filename from .tar to either .tgz or .tar.gz. This will let whoever sees the file know that it is a gzipped

tarball.

$ tar zcvf tarball.tgz .

Note: z=gzip compression

c=create

v=verbose

f=filename (backup.tgz)

.=current directory (what to backup)

Result