Administration & Server Software
- 1 Being 'root'
- 2 Backup
- 3 Emergency Recovery
- 4 Managing Processes
- 5 Mounting
- 6 Scheduling
- 7 System Services
- 8 Getting Organized
- 9 Bash Aliases
- 10 Xen 3.0 How To - Mandriva 2006 PowerPack
- 11 Advanced Administration
1 Being 'root'
'root' is the most powerful account on a Linux system. Learn how to use it wisely and appropriately.
- Introducing 'root'
- Using 'root' Considered Harmful
- Tasks Which Require 'root' Privileges
- Becoming 'root' With 'su'
- 'su' Going Graphical: 'kdesu'
- 'su' Made Convenient: 'sudo'
2 Backup
You should back up your personal files on a regular basis. Usually, each user saves his personal files in the user directory under the /home directory. All the global administrative configuration files are stored in /etc and can be written only by the root user.
Tools for backup are:
- tar command
- dd (device dump) command
- partimage … save whole partitions of Ext2FS, ReiserFS, NTFS and FAT32 - This is very useful when installing the same software on many machines: just install one of them, create an image, and just restore the image on all other machines. Then after the first installation, each subsequent installation is done automatically and requires only a few minutes.
3 Emergency Recovery
How to cope with severe system errors.
- Rescue vs Reinstalling
- Basic Rescue Tools
- The Mandrake Linux Rescue System
- Booting 'failsafe'
- Single User Mode
- The root Shell
- Linux Systems On Other Media
- Scenario I: System Doesn't Boot
- Scenario II: System Stops During Boot
- Scenario III: Login Fails
- Scenario IV: System Hangs On Loading X
- Scenario V: System Freeze
- Scenario VI: Important Files Deleted
4 Managing Processes
Almost everything going on in Linux is a process. Take a look at what the processes are and how to manage them.
- Introducing Processes
- Process Monitors
- Processes In Detail
- Process Accounting
- Estimating Process Resource Usage
- Setting Resource Limits
- Dealing With Bad Processes
5 Mounting
How to handle file systems in Linux.
- Why Linux Handles Media Differently
- Default mount Setup In Mandrake Linux
- Mounting In Detail
- Writing Windows NTFS
- Uses Of 'fstab'
- 'fstab' Entries explained
- Using 'supermount'
- "maximal mount count reached - check forced"
- "device was not cleanly unmounted on shutdown - check forced"
- "mount: only root can do that"
- CD-Rom Tray Is Blocked
- 'df' doesn't list external media anymore
- "mount: can't find /mnt/{device} in /etc/fstab or /etc/mtab"
- '{device} is not a valid blockdevice'
- Audio CDs Don't Play When Mounted
- "input/output error"
- No Proper Unmounting ('Device Busy')
- No User Access To Files On Mounted Windows Partitions
- Trouble Mounting Removable Media With Different File Systems
- Preparations
- Creating Mount Points
- Configuring autofs Files In /etc
- Desktop Icons For Easy Access
6 Scheduling
How to tell your computer to do certain things at a certain time.
- What Scheduling Can Do
- 'sleep', 'at', 'cron' and 'anacron'
- 'sleep'
- 'at'
- Specifying Execution Time
- Writing Your Own Crontab
- Example: Monthly Compression Of 'sent_mail' Folder
- anacron
- Interactive Schedulers
7 System Services
System services: what they are and how to control them.
- Introducing System Services
- Advantages Of The Service Mechanism
- DrakXServices
- How Services Work
- Annotated List of Common Services (a-h)
- Annotated List of Common Services (i-n)
- Annotated List of Common Services (o-y)
- Deprecated Services
8 Getting Organized
8.1 Config files
Do you ever have trouble remembering where the config files are for all those services you run?
Then get organized. Create a /root/config directory, sub-directories for each service you run, and symlinks for those configuration files:
For example, as root:
mkdir /root/config cd /root/config mkdir samba apache dns network cups sasl rsync cd samba ln -s /etc/samba/smb.conf ln -s /etc/samba/smbusers ln -s /etc/lmhosts cd /root/config/apache ln -s /etc/httpd/conf/httpd2.conf ln -s /etc/httpd/conf/commonhttpd.conf ln -s /etc/httpd/conf/vhosts/Vhosts.conf cd /root/config/dns ln -s /etc/hosts ln -s /etc/resolv.conf ln -s /var/named/named.ca ln -s /etc/named.conf ln -s /etc/networks ln -s /var/named/localhost cd /root/config/network ln -s /etc/sysconfig/network-scripts/ifcfg-eth0 ln -s /etc/sysconfig/network-scripts/ifcfg-eth1 ln -s /etc/services
Now everything will be in one place the next time you configure a service. If you use an editor that creates backup files, with the '~~' suffix, you won't have them all over your filesystems.
9 Bash Aliases
Do you ever get tired of typing
tail /var/log/syslog
less /var/log/messages
Then get lazy1.1 Make yourself some aliases. Put these lines in /root/.bashrc.
alias tslog='/usr/bin/tail /var/log/syslog' alias lslog='/usr/bin/less /var/log/syslog' alias tmsg='/usr/bin/tail /var/log/messages' alias lmsg='/usr/bin/less /var/log/messages' alias tauth='/usr/bin/tail /var/log/auth.log' alias lauth='/usr/bin/less /var/log/auth.log' alias tmail='/usr/bin/tail /var/log/mail/info' alias lmail='/usr/bin/less /var/log/mail/info' alias tkern='/usr/bin/tail /var/log/kernel/info' alias lkern='/usr/bin/less /var/log/kernel/info' alias thacc='/usr/bin/tail /var/log/httpd/access_log' alias lhacc='/usr/bin/less /var/log/httpd/access_log' alias therr='/usr/bin/tail /var/log/httpd/error_log' alias lherr='/usr/bin/less /var/log/httpd/error_log' alias thsacc='/usr/bin/tail /var/log/httpd/ssl-access_log' alias lhsacc='/usr/bin/less /var/log/httpd/ssl-access_log' alias thserr='/usr/bin/tail /var/log/httpd/ssl-error_log' alias lhserr='/usr/bin/less /var/log/httpd/ssl-error_log' alias tsmb='/usr/bin/tail /var/log/samba/log.smbd' alias lsmb='/usr/bin/less /var/log/samba/log.smbd' alias tnmb='/usr/bin/tail /var/log/samba/log.nmbd' alias lnmb='/usr/bin/less /var/log/samba/log.nmbd' alias urpmi='nice -n 15 urpmi ––split-level 10 ––split-length 8' alias rpm='nice -n 15 rpm' alias make='nice -n 16 make'
These aliases will become new commands the next time you login. If you can't wait, type each one at the command prompt so they will also be available in your current login session. Learn these new commands, and system administration will be easier.
10 Xen 3.0 How To - Mandriva 2006 PowerPack
INSTALLING XEN ON MANDRIVA LINUX 2006
XEN is a system allowing you to run multiple virtual machines on one host machine. XEN if fairly stable. If you are running XEN on a laptop the ACPI code in the XEN kernel is not as robust as the main Linux kernel, so it's possible to encounter ACPI related issues.
XEN consists of a host system, and one or more guest systems. The guest systems reside on the host system.
Your guest systems will typically reside on a separate partition, with their own swap. You can create this install either by doing a CD/DVD install or cloning the host system using tar or rsync.
REQUIRED XEN PACKAGES There are 3 packages you need to install on either the host or guest system:
- 1. xen (the package with the init scripts and command line utilities);
- 2. kernel-xen0 (the hypervisor kernel for the system to provide services to the guest systems); and
- 3. kernel-xenU (the guest system kernel).
BOOTLOADER PREPARATION
XEN requires Grub, and at present it does not work with LILO as shipped in Mandriva. The xen0 and xenU do not create an initrd as you might be accustomed to with a normal kernel install.
To creat initrd, please go enter the commands
- mkinitrd -v /boot/initrd-2.6.12-18mdkxen0.img 2.6.12-18mdkxen0
- mkinitrd -v /boot/initrd-2.6.12-18mdkxen0.img 2.6.12-18mdkxenU
A sample of how the stanza within /boot/grub/menu.lst should look is:
- title 2612-18Xen3
- kernel (hd0,18)/boot/xen-3.0.gz dom0_mem=131072 console=vga
- module /boot/vmlinuz-2.6.12-18mdkxen0 root=/dev/hda19 ro console=tty0 acpi=force
- module /boot/initrd-2.6.12-18mdkxen0.img
- chkconfig -- -- --add xend xendomains
For the client, you create a file in /etc/xen, describing the characteristics of the client system. I have created 2 guests, 2006_1 and 2006_2.
- /etc/xen/2006_1:
- kernel = "/boot/vmlinuz-2.6.12-18mdkxenU"
- ramdisk = "/boot/initrd-2.6.12-18mdkxenU.img"
- memory = 128
- name = "2006_1"
- nics = 1
- dhcp = "dhcp"
- disk = ['phy:hda14,hda1,w','phy:hda20,hda2,w']
- root = "/dev/hda1 ro"
- hostname = "2006_1"
- /etc/xen/2006_2:
- kernel = "/boot/vmlinuz-2.6.12-18mdkxenU"
- ramdisk = "/boot/initrd-2.6.12-18mdkxenU.img"
- memory = 128
- name = "2006_2"
- nics = 1
- dhcp = "dhcp"
- disk = ['phy:hda15,hda1,w','phy:hda21,hda2,w']
- root = "/dev/hda1 ro"
- hostname = "2006_2"
The line of most interest is the "disk" line. This line describes a mapping between the physical partitions the guest is using and the virtual partition they will be using. The guest system will be installed on the first argument (hda14 for 2006_1 in this example). fstab should reflect the virtual partition name (hda1). hda20/hda21 are swap partitions allocated for the guests.
The complete partition setup for my XEN guests is:
- /dev/hda14 6790 7140 2819407 83 Linux
- /dev/hda15 7141 7491 2819407 83 Linux
- /dev/hda20 7492 7538 377496 83 Linux
- /dev/hda21 7539 7584 369463+ 83 Linux
- # mount /dev/hda14 tmp
- # chroot tmp
- # exit
- # umount tmp
Boot proceeds as normal, select the xen0 from the grub menu and boot the host system.
Some system services may not work correctly with the xen0 kernel and you can disable those services. One sample error is cpufreq, which occurred during this configuration.
NOTE: If you have issues with ACPI and the xen0 kernel, you may have problems running X.
Once the system is booted, you can check the status of the xen service with:
- # xm list
To start XEN, enter the command:
- # xm create 2006_1 -c
- "xm -- -- --help"
To stop the virtual machine, enter # shutdown -h from the guest command line.
With both guests running the "xm list" output will reflect the new state.
VNC
You can install tightvnc-server on the guests and setup a user account to start if you'd like an X session available on the guest, or to assist with whatever services you might like on the guests to provide services such as multiple Apache servers.
11 Advanced Administration
Version 1.41 last modified by Arkub on 09/04/2007 at 12:25
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Comments (1)