Professional Documents
Culture Documents
open.sap.com Slide 2
SLES Storage Administration
Partitioning Utilities
There are multiple tools for partition management in SUSE Linux Enterprise Server:
o YaST partitioner module – Graphical or ncurses tool for partitioning, formatting and other block device and
filesystem management
o fdisk – traditional command line tool for manipulating MBR (MSDOS) type partition definitions
o parted – command line tool for MBR and GPT type partitions
open.sap.com Slide 3
SLES Storage Administration
MBR and GPT
open.sap.com Slide 4
SLES Storage Administration
Device Files for Block Devices
open.sap.com Slide 5
SLES Storage Administration
Supported Filesystems
From an applications perspective – in most cases – the filesystem does not matter because of Linux’s
use of the Virtual Filesystem Switch (VFS). The VFS makes the filesystem opaque.
open.sap.com Slide 6
SLES Storage Administration
The Virtual Filesystem Switch (VFS)*
open.sap.com Slide 7
SLES Storage Administration
/etc/fstab
• The /etc/fstab file (file systems table) is the primary configuration file for determining where, how
and when a partition or other storage device is to be mounted on the local system
• There are 6 fields that configure each partition/device
o Field 1: Name, file system label, or UUID
o Field 2: Mount point
o Field 3: Filesystem type
o Field 4: Mount options
o Field 5: Use the dump backup utility?
o Field 6: Sequence of filesystem checks to perform
open.sap.com Slide 8
SLES Storage Administration
Device, Filesystem, and Mounting Utilities
o mount/umount – command line tool for adding or removing a partition from the / (root) filesystem
• Examples of options: remount, rw/ro, sync, atime, user, defaults
o lsblk – list block devices
o blkid – display block IDs and the associated block device files
open.sap.com Slide 9
Copyright © SUSE LLC
© 2019 SUSE LLC. All rights reserved. SUSE and the SUSE logo are registered trademarks of SUSE
LLC in the United States and other countries. All third-party trademarks are the property of their
respective owners.
open.sap.com Slide 10
Thank You!
Contact Information:
open@sap.com
Week 4 Unit 2:
The Shell Environment
The Shell Environment
What is the Shell?
The shell is the most basic user interface to SUSE Linux Enterprise Server.
o Also referred to as the command line interface
There are multiple shells available in SLES, and they are listed in /etc/shells:
o bash (Bourne Again SHell) -> the default shell in SLES
o csh – the c shell
o ksh – the korn shell
o tcsh – an enhanced c shell
o zsh – the z shell
o etc.
open.sap.com Slide 2
The Shell Environment
The Shell Environment
The shell environment is made up of components that can be customized to the user’s preference
using:
o Variables – the most commonly customized part of the shell environment
o Functions – define core functionality of the shell
o Aliases – allow shortcuts to longer, sometimes complex, commands using shorter input
A shell can be invoked in two different ways
o Login shell – the user’s preferred environment (variables, functions and aliases) is set
• A login shell will ask for a username/password
• A login shell can be requested with the --login option when /bin/bash is called
o Non-login shell – the shell inherits an existing environment (from a previously started shell)
• A non-login shell will not ask for username/password (e.g. – a gnome-terminal session)
open.sap.com Slide 3
The Shell Environment
Shell Variables and Settings
open.sap.com Slide 4
The Shell Environment
Shell Aliases
A shell alias allows a typed shortcut to longer, more complex, commands using shorter input.
o Define an alias:
alias ALIAS_NAME=“COMMAND”
o Remove an alias:
unalias ALIAS_NAME
o List all defined aliases:
alias
o Alias definition file:
~/.alias
open.sap.com Slide 5
The Shell Environment
Shell History
When a command is entered in a shell, it is stored in the history file of the user who executed it:
o ~/.bash_history
o View the shell history with the history command
• Scroll through the history with the <up-arrow> and <down-arrow> keys
o Search the history for a command that begins with <string>
• <string><PageUp>/<string><PageDown>
o Search history for any <string>, press ctrl+r
• Execute the found item: press Enter
• Change the found item: press Tab
o Re-execute a numbered command from history:
• !<command-number>
open.sap.com Slide 6
The Shell Environment
Tab Auto-Completion
Commands in a shell can be automatically completed if they are unambiguous, or a list of possibilities
can be displayed:
open.sap.com Slide 7
The Shell Environment
Data Channels
open.sap.com Slide 8
The Shell Environment
Channel Redirection
Command Description
> Redirect stdout into a file
Example: ls /etc > /tmp/etc_files.txt
>> Redirect stdout, appending to a file
open.sap.com Slide 9
The Shell Environment
Chain Commands Together
Command Description
; Chain multiple commands together on a single command line
Example: echo Hello ; echo How are you?
&& Execute a second command only if the first command returns
no error (return code 0)
Example: grep “swap” /etc/fstab && echo Success
|| Execute a second command if the first command returns an
error (i.e. return a code other than 0)
Example: grep “XXX” /etc/fstab || echo Failure
open.sap.com Slide 10
The Shell Environment
Help Resources
open.sap.com Slide 11
Copyright © SUSE LLC
© 2019 SUSE LLC. All rights reserved. SUSE and the SUSE logo are registered trademarks of SUSE
LLC in the United States and other countries. All third-party trademarks are the property of their
respective owners.
open.sap.com Slide 12
Thank You!
Contact Information:
open@sap.com
Week 4 Unit 3:
Process Administration Basics
Process Administration Basics
Process Basics
o Terminology
• Program: Executable code, stored on a drive
• Process: Executable code, copied into RAM for execution
• Task: Synonym for process
o Basic process types:
• User: Associated with a controlling shell or terminal
• Daemon: Not associated with a controlling shell or terminal
o Every process is assigned a unique Process ID (PID)
o Processes can spawn other processes (parent/child relationship)
open.sap.com Slide 2
Process Administration Basics
View Processes
Command Description
Display running processes
ps Common options:
aux All processes, with user list
-ef All processes, full-format with CLI
Display running processes with their parent/child
pstree relationships
Common options:
-p Add PIDs to the output
top Display processes, sorted by usage and refreshed at an
interval
open.sap.com Slide 3
Process Administration Basics
Manage Processes
Command Description
kill <PID> [signal] Sends a signal to a specific PID
killall <process_name> [signal] Sends a signal to all processes with a specified name
(e.g. killall firefox TERM)
No. Signal Description No. Signal Description
1 HUP Hangup 11 SEGV Segmentation fault
2 INT Interrupt
12 USR2 User defined
3 QUIT Quit
4 ILL Illegal instruction
13 PIPE Broken pipe
5 TRAP Trace 14 ALRM Alarm clock
6 ABRT Aborted 15 TERM Terminated
7 BUS Bus error 16 STKFLT Stack fault
8 FPE Floating point exception 17 CHLD Child exited
9 KILL Killed 18 CONT Continued
10 USR1 User defined 19 STOP Stopped
open.sap.com Slide 4
Process Administration Basics
Process Priority
Command Description
open.sap.com Slide 5
Process Administration Basics
Jobs and Processes
o Jobs (processes) can be put into the background to allow continued use of the shell instead of
waiting for each task to finish
• ctrl+z Pause the task
• bg Continues the paused task in the background
o Start a job directly in the background: append “&”
• Example: xeyes &
• jobs – command to view jobs tied to a shell
• fg – bring background tasks into the foreground
open.sap.com Slide 6
Copyright © SUSE LLC
© 2019 SUSE LLC. All rights reserved. SUSE and the SUSE logo are registered trademarks of SUSE
LLC in the United States and other countries. All third-party trademarks are the property of their
respective owners.
open.sap.com Slide 7
Thank You!
Contact Information:
open@sap.com
Week 4 Unit 4:
Process Scheduling
Process Scheduling
Cron Jobs
o Cron jobs are the primary way that SUSE Linux Enterprise Server administrators schedule
tasks to be completed regularly. There are cron jobs for users and for the system.
o User cron jobs are configured via the crontab utility:
Option Description
-e Edit a user’s crontab
-l List a user’s crontab
-r Remove a user’s entire crontab
o There are fields in the crontab entries that represent different time intervals:
open.sap.com Slide 2
Process Scheduling
System Cron Jobs
o There are also some predefined directories where tasks can be dropped in for hourly, daily,
weekly, or monthly execution:
• /etc/cron.hourly/
• /etc/cron.daily/
• /etc/cron.weekly/
• /etc/cron.monthly/
open.sap.com Slide 3
Process Scheduling
Cron Architecture
open.sap.com Slide 4
Process Scheduling
The at Daemon
Command Description
at, batch Schedule a task
Ctrl+D exits command input
-f: specify a script file
atq View scheduled tasks for a user
atrm <job_number> Remove a scheduled task
File Description
/etc/at.allow Listed users can define jobs
/etc/at.deny Listed users cannot define jobs
open.sap.com Slide 5
Copyright © SUSE LLC
© 2019 SUSE LLC. All rights reserved. SUSE and the SUSE logo are registered trademarks of SUSE
LLC in the United States and other countries. All third-party trademarks are the property of their
respective owners.
open.sap.com Slide 6
Thank You!
Contact Information:
open@sap.com