Вы находитесь на странице: 1из 61

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Section 2 Install SUSE Linux Enterprise Server 11

Objectives
Understand Partitions, LVM, RAID, and File Systems Perform a SLES 11 Installation Understand the File System Hierarchy Standard (FHS)

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Understand Partitions, LVM, RAID, and File Systems


Before beginning an installation, you need to decide how to use the available hard disk space
Division should take into account intended uses

Hard disks can be logically divided into smaller portions called partitions
Primary partition: continuous range of cylinders
Limited to four primary partitions on x86 systems

Extended partition: continuous range of cylinders that can be subdivided into logical partitions
One primary partition can be an extended partition

Logical partition: exists within an extended partition


SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 3

Design Guidelines for Implementing Partitions


YaST proposes a partitioning scheme consisting of a swap partition and another partition using the rest of the disk space
If partition already exists, YaST tries to maintain it

When implementing your own partitioning scheme


If hard disk < 4GB, use one partition for swap and one for root (/) If hard disk > 4GB:
Create swap partition and root partition Can create separate partitions for different directories Candidates: /boot/, /opt/, /usr/, /var/, /srv/, /home/
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 4

Design Guidelines for Implementing Partitions (continued)


If partitioning is performed by YaST and other partitions are detected, they are entered in /etc/fstab to enable easy access to the data
Specified with noauto and user options Not automatically entered with the exec option

Linux hard drive names are /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd Partitions follow naming convention for the hard drive, followed by a partition number

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Design Guidelines for Implementing Partitions (continued)


Table 2-1 Device Name for Hard Drives Courtesy Course Technology/Cengage Learning

Table 2-2 Device Name for Partitions Courtesy Course Technology/Cengage Learning

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Understand Logical Volume Manager and Software RAID


Logical Volume Manager (LVM): provides high level view of disk storage
Used to create, manage, and resize logical volumes

Conventional partitioning of hard disk is inflexible LVM provides a volume group pool of memory space
Space used to generate logical volumes
Accessed by OS like conventional physical partitions

Lets you resize the physical media during operation without affecting the applications
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 7

Understand Logical Volume Manager and Software RAID (continued)


Basic structure of LVM includes:
Physical volume: partition or entire hard disk Volume group: one or more physical volumes grouped together
Add hard disk in a running system Use several hard disks with improve performance in RAID 0 mode

Logical volume: part of volume group


Enlarge if there is space, added in running system Can reach very large size, no limit on the number Snapshot feature enables consistent backups
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 8

Understand Logical Volume Manager and Software RAID (continued)

Figure 2-1 LVM Components Courtesy Course Technology/Cengage Learning

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Software RAID
RAID: used to combine hard disk partitions into one large virtual hard disk for optimizing performance
Hardware RAID: hard disks are connected to a separate RAID controller
Seen by OS as one device, no additional RAID configuration necessary at OS level

Software RAID: hard disks combined by the OS


OS sees each disk and needs to be configured to use them as RAID system Provides comparable performance and data security as Hardware RAID
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 10

Software RAID (continued)


RAID levels are determined by method in which disks are combined and by their number
RAID 0: two or more hard disks pooled together
Known as striping

RAID 1: data is copied to one or more had disks


Known as hard disk mirroring

RAID 5: data and a checksum are distributed across the hard disks
Minimum number of disks is three

RAID 6: comparable to RAID 5, two disks can fail without data loss
Minimum number of disks is four
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 11

Select a Linux File System


To use partition or logical volume it must have a file system
Linux OS used to create and manage file systems
Each file system has strengths and weaknesses Does not replace backup strategy

Types of file systems


Traditional file systems: do not journal data Journaling file systems: logs changes to a journal before writing them to main file system Network file systems: remote file systems included in file system tree
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 12

Virtual File System Switch


For a user or program, doesnt matter what file system format is used
Same interface to the data always appears Interface implemented by Virtual File System Switch (VFS)
Abstraction level in the kernel providing defined interfaces for processes Includes functions such as open file, write to file, read from file Displays file characteristics to the user as they are known from UNIX file system formats
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 13

Virtual File System Switch (continued)

Figure 2-1 LVM Components Courtesy Course Technology/Cengage Learning SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 14

Linux File System Internals


In Linux file systems data and administration information are kept separate
Each file described by an inode
Contains all information about a file except its name Must include inode for each file and directory 128 bytes in size Contains links to data blocks of the file

Data organization differs between file system formats

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

15

Ext2fs File System Format


Ext2 file system format is similar to traditional UNIX file system formats
Maximum number of files and inodes are specified at file system creation
Inode density can be set at file system creation

Block size specified at file system creation


Determines how much space is reserved for a file The larger the value, the more space consumed by the file, even if amount of data is smaller

Filename can be up to 255 characters, path up to 4096 characters


SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 16

Ext2fs File System Format (continued)


Data is stored in a linear block group, containing:
Boot sector: static information about file system SuperBlock: read when file is mounted, contains information about the file system Group descriptor: information on the other locations Block bitmap: information indicating which blocks in the group are free or occupied Inode bitmap: information indicating which inodes are free or occupied Inode table: file information Data blocks: where actual data is located
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 17

Ext2fs File System Format (continued)

Figure 2-3 ext2 File System Structure Courtesy Course Technology/Cengage Learning

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

18

ReiserFS Format
Organizes data differently than ext2
Fixed block size of 4096 bytes, but small files and ends of files stored together in the same block Inodes created only when they are actually needed Faster access to files
Use of balanced binary trees in organization of data blocks Require more processing power

Filename can be up to 255 characters long Path can be up to 4096 characters long, including slashes
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 19

Directories
Contain filenames and the number of the inode for the file
Serve as tables
Inode numbers are assigned line by line to filenames View the inode number using the ls i command

Inodes are uniquely defined on one partition only


Same inode number can exist on different partitions

. file: link to the current directory .. file: link to previous layer in the direction of the root
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 20

Links
Link: File that points to another file
Hard link: another entry in a directory that points to the inode of a file that already has a file name
Link and original file are indistinguishable Created using ln command File and link must be in the same partition, because inodes are unique only within a partition

Symbolic link: file of its own that points to another file in the file system
Link has different inode than original file Created using ln s command
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 21

File System Journaling


File systems: databases that store files and use metadata to organize and locate files on disk When modify a file system carries out two separate transactions
Can result in differences between data and metadata
Requires file system check and possibly repair

A journal based file system records of current transactions kept and updated upon completion
In case of corruption, need to check what transactions were not completed
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 22

Perform a SLES 11 Installation


The installation process includes multiple tasks To start installation process insert installation DVD in system optical drive and reboot the computer
Can select from various options of how to proceed:
Boot from hard disk (default) Installation: starts normal installation process Repair installed system: graphical repair utility Rescue system: minimal system for troubleshooting Check installation media Firmware test: starts a BIOS checker Memory test: tests RAM using read/write cycles
23

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Perform a SLES 11 Installation (continued)


Series of function keys placed at bottom of screen
Can be used to change variety of installation settings

YaST installation dialog user interface:


Left panel: overview of installation status Right panel: displays current installation step
Lower left corner: help button for information about current installation step Lower right side: buttons used to navigate to previous or next installation step or to abort installation

Language dialog: used to select language and keyboard layout and agree to license agreement
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 24

Check the Installation Media and Select the Installation Mode


It is recommended to verify that the installation media is valid
If verification fails, do not continue the installation
Obtain replacement copy of installation media

If verification succeeds, system hardware is probed and corresponding basic kernel drivers are loaded

Select the installation mode from following options:


New installation: normal new installation, default Update: updates SLES 10 installation to SLES 11 Repair installed system
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 25

Set the Clock and Time Zone and Specify the Server Base Scenario
Configure clock and time zone
YaST sets time zone based on language selection
If hardware clock set to UTC, system time set according to time zone and automatically adjusted

Specify the servers base scenario:


Physical machine: used on physical hardware without XEN Virtual machine: used in a para-virtualized virtual machine environment XEN Virtualization host: machine that will function as host for XEN virtual machines
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 26

Configure Installation Settings and Verify Partitioning


YaST analyzes the system and creates an installation proposal
Proposed settings are displayed, and can be changed, in the overview tab and in the expert tab In most cases, YaST partitioning scheme is reasonable, but may be changed:
To optimize partitioning for special purpose server To configure LVM To configure software RAID on more than one drive To delete existing OSs to free space for SLES 11 installation
27

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

Optimal partitioning scheme for a server depends on the purpose of the server SLES installation needs at least two partitions:
Swap partition: Extends the physically available system RAM Root partition: holds the root directory (/)

The Basic Linux Partitioning Scheme and Changing the Default Partitioning Proposal

Change default partitioning proposal to create partitions for directories in the file system
Adds a degree of stability to the system Use YaST Expert Partitioner to do this
Entry with information for each partition on hard disk
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 28

Create New Partitions and Edit Existing Partitions


Use YaST Expert Partitioner to create new partition
The options displayed depend on the specific hard disk setup Need to specify partition type, size, format, encryption, and mount options

To edit an existing partition, select it from the YaST Expert Partitioner list
Can only edit primary and logical partitions Can change all the options about a partition except its size
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 29

Delete and Resize Existing Partitions


Use Expert Partitioner to delete a partition
Select partition from list, and click delete Deleting extended partition deletes all logical partitions

Use Expert Partitioner to resize a partition


Backup data before resizing partition Resize partition by moving slider until enough unused disk space is available for the resized partition

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

30

Select Software
SLES 11 includes variety of software packages
Patterns: categories of packages based on function
Can be selected for installation as a group YaST often preselects software patterns by default

Package contains application and supporting files


Several applications bundled into one package Some packages are dependent on other packages to be installed
Dependency information stored within RPM package YaST automatically adds dependent software packages to installation proposal
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 31

Select Software (continued)


Possible displays for packages:
Patterns Package groups: hierarchical tree view
Several main groups, which can include subcategories

Language: support for additional languages Repositories: configured installation sources Search: search for packages Installation summary

Need to confirm package selection for YaST to start package installation


SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 32

Start the Installation Process and Set the root Password


Start installation after customizing installation proposal
Can always return to the installation proposal

Before installing software, YaST changes hard disk partitioning


After changing partitions and configuring them, installs software and reboots

Set password for root user, who has unlimited access to do anything
Should be used only for administrative tasks Password should be hard to guess
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 33

Set the Hostname and Configure the Network


YaST suggests default hostname of linux-xxxx
xxxx = random characters Change values to be suitable for the network
Can change hostname via DHCP or by writing it to /etc/hosts

Set up network configuration on the server


Select if to configure network setting later or use or adapt the configuration proposal
Proposal includes general network settings, firewall, network interfaces, DSL connections, ISDN adapters, modems, VNC remote administration, and proxy Need to make sure to configure network cards
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 34

Add a Network Card Manually


Need to configure network card if not automatically detected:
Device type: network device type, e.g., Bluetooth Configuration name: interfaces device number Module name: select appropriate network card from list
YaST loads the appropriate driver for selected card

Additional configuration required for wireless device type


Need to configure WLAN and WEP Keys
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 35

Edit and Delete an Existing Configuration


You can edit existing network interface configurations
Configure the address to be dynamic, statically assigned IP address, and hostname and server name Need to set hostname, domain name, and routing

To delete existing network card configuration, highlight it and press delete When finished changing network card, configurations save and return to proposal
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 36

Test the Internet Connection and Configure Novell Customer Center Configuration and Online Update
Test connection to the Internet
Can choose to do this now or at a later stage, but then cant update the system during installation

You can configure Novell Customer Center


Required to perform online updates
Updates can be downloaded and installed to fix bugs or security issues Must register at Novell web site May need to select from a list of available patches to decide what updates are installed
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 37

Configure Network Services


Configure certificate authority (CA) and OpenLDAP server
Select to skip configuration or used automatically generated configuration CA guarantees a trust relationship among communicating network services
Can use default configuration or adapt it If do not establish local CA, must secure server communications using SSL and TLS

Lightweight Directory Access Protocol (LDAP) server


Stores user and group account data

If not sure about correct settings, use YaST default


SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 38

Manage Users
Need to configure user authentication method to be one of the following:
Local: traditional file based authentication method
This is the default

LDAP: configures system as LDAP client NIS: configures system as NIS client Windows domain: configures server to use the user and group accounts in the Windows domain for authentication

If not sure what method to use, use Local Next steps depend on the method selected.
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 39

Add Local Users


If selected Local as authentication method, need to create at least one regular user account on system
Information stored in /etc/passwd and /etc/shadow Information entered includes:
Users full name Login name Password: should be at least eight characters, case sensitive, special characters allowed Receive system mail: email addressed to root account are forwarded to this user Automatic login User management: lets you add more users
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 40

Configure the System as an LDAP Client


If LDAP is the selected authentication method configure system as LDAP client
LDAP client: can configure the following:
Addresses of LDAP servers LDAP base DN: search base context on server LDAP TSL/SSL: encrypts communication with server LDAP version 2: select if server supports only LDAP version 2

Start automounter: provides information about automatic mounting of file systems Create new LDAP user
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 41

Configure Hardware
Configure server hardware using YaST YaST provides hardware configuration proposal, including:
Graphic card and monitor setup Printer and printer server settings Sound card configuration

Can change the automatically generated configuration Can skip hardware configuration at this point
Make sure settings of graphics card in configuration proposal are correct
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 42

Finalize the Installation Process


The installation is complete after configuring hardware Clone this system for autoyast: causes an Auto YaST file to be generated
The file can be used to set up identical systems

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

43

Understand the File System Hierarchy Standard (FHS)


Linux File system is different than that of other OSs
File systems can be spread out over many devices
Can be mounted any place in the hierarchy

File name can be up to 255 characters


Can contain special characters

Some characters have special significance for shells


To use without special meaning, character should be preceded by a \ to mask special meaning

You can use language specific characters Case sensitive


SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 44

Hierarchical Structure of the File System


Linux file system is hierarchical
Can be shown in the form of a tree
Not limited to a local partition Begins at the root directory (/)

A file is uniquely defined by its path


Absolute path: path starting from the root of the entire filesystem tree Always begins with a / representing root directory Relative path: path starting from current directory Length of path limited to 4096 characters including slashes
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 45

Hierarchical Structure of the File System (continued)

Figure 2-46 Content of the Root Directory Courtesy Course Technology/Cengage Learning SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 46

Hierarchical Structure of the File System (continued)

Figure 2-47 Absolute and Relative Paths Courtesy Course Technology/Cengage Learning

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

47

File System Hierarchy Standard


Structure of file system described in File System Hierarchy Standard (FHS)
Specifies which directories must be located on the first level after the root and what they contain Defines two layered hierarchy
Directories in the top layer Directories under /usr/ and /var/

root directory is highest layer of FHS tree


Normally contains only directories First to mount at boot time
All programs that run at system start must be on same partition
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 48

File System Hierarchy Standard (continued)

Figure 2-48 File System Hierarchy Standard Courtesy Course Technology/Cengage Learning

SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

49

Essential Binaries for Use by All Users (/bin/) and Boot Directory (/boot/)
/bin/ contains important binaries that are required when no other file systems are mounted
Includes various shells, the most important commands for working with files, commands for system analysis and configuration

Boot directory (/boot/) contains system files


Static files related to the boot loader GRUB Backed up information for the Master Boot Record (MBR) and system map files The kernel
Has the file name vmlinuz
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 50

Other Partitions (/data/) and Device Files (/dev/)


When YaST finds other partitions or hard disks during the installation it creates mount points for each partition labeled datax Each hardware component in system represented by file in /dev/ directory
Files used to address hardware components
Character oriented device files Block oriented device files Major number: identifies the number of the device driver to be used Minor number: identifies a specific device Special device files can be generated using mknod
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 51

Configuration Files (/etc/) and User Directories (/home/)


/etc/ and its subdirectories contain system configuration files and may not contain executables
Subdirectories may contain shell scripts Most files are ASCII files
Can be processed without editor Read by normal users, edited by root

Every user has an area to work with files known as home directory located under /home/
Can be addressed using ~ shortucut Includes individual configuration files
Hidden files, names begin with a dot
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 52

Libraries (/lib/) and Mount Point for Removable Media (/media/*)


/lib/ contains libraries of standard functions that are called up only when a program runs
Used by programs in /bin/ and /sbin/ Kernel modules located in /lib/modules/

All files are arranged in one big tree which can include several devices mount command attaches device file system to tree Directories in /media/ directory used for mounting removable media when it is detected
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 53

Application Directory (/opt/) and Administrators Home Directory (/root/)


/opt/ is used to store static files of installed programs
Files stored in subdirectory named for the application

/root/ is the home directory for the root user


Not located under /home/ like home directories for normal users Should be on same partition as root (/) directory
Guarantees that root user can always log in without a problem to his own configured environment
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 54

System Binaries, Data Directories for Services (/srv/), and Temporary Area (/tmp/)
/sbin/ contains important programs for system administration
Typically can be run by normal users, but only to display the configured values
Changes to the configuration made by root user

/srv/ directory contains subdirectories for containing data of various services /tmp/ stores temporary files created by various programs until these files are deleted
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 55

The Hierarchy Below /usr/, Variable Files (/var/), and Windows Partition (/windows/)
/usr/ directory represents second hierarchical layer
Location for all application programs, GUI files, additional libraries, locally installed programs and shared directories containing documentation

/var/ directory and subdirectories contain files that can be modified while system is running When YaST finds a partition with a Microsoft file system, creates a /windows/ directory
Subdirectories labeled with Windows drive characters
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 56

Process Files (/proc/)


/proc/ makes process information available to user
Process information does not contain any real file or occupy hard disk space Generated dynamically when it is accessed Each process has its own directory
Values can be read as if it were a file Some values can be set by writing to corresponding files

Also includes directories and files containing information about the state of the system
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 57

System Information Directory (/sys/) and Mount Point for Temporarily Mounted File Systems (/mnt/)
/sys/ directory provides information about hardware buses, hardware devices, active devices, and their drivers
Information in the form of a tree Does not contain any real files

/mnt/ is standard directory for mounting file system


Should only be used for temporary purposes
For permanent mount create a dedicated directory

To remove mounted file system, use umount command SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+

58

Directories for Mounting Other File Systems


Other file systems can be mounted to the files system at any point
Directory must exist where you intend to mount the new file system
Referred to as a mount point Anything contained in this directory is temporarily unavailable while new file system is mounted

Typically only root user can mount and unmount Use mount command to mount file system, and umount to unmount it Can share some directories with multiple computers
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 59

Summary
Storage space on hard drives divided into partitions Partitions must have a file system created on them LVM provides high level view of the disk storage on the system
Can be used to create logical volumes

Software RAID allows combination of several disk to provide increased performance and redundancy Linux supports various file systems, some of which keep a journal and recover faster from crash SLES can be installed from various media
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 60

Summary (continued)
SLES installation includes many configuration steps Layout of Linux file system follows File System Hierarchy Standard FHS defines directory structure and purpose of directories within root directory (/) and below /usr/ and /var/ directories Some directories must exist on same partition as root directory (/), while others can be on different partitions or other machines
SUSE Linux Enterprise Server Administration: CLA, LPIC-1 & Linux+ 61