Monday, July 26, 2010

LVM


LVM is an implementation of a logical volume manager for the Linux kernel. It was originally written in 1998 by Heinz Mauelshagen, which was based on Veritas Volume Manager used in HP-UX systems.

LVM includes many of the features expected of a volume manager, including:

Resizing logical groups 
Resizing logical volumes 
Read-only snapshots (LVM2 provides read and write) 
Logical Volume RAID0 

LVM RAID1 or RAID5 is not implemented, so it is recommended to use specific software RAID for these operations, taking over the LV RAID

Advantages of using LVM in a small system 
  • One of the decisions faced by a user installing GNU / Linux is how to partition the hard disk. The need to estimate how much space is required for the system, for temporary or personal data can become problematic and that many users choose to create a partition that fills the disk and enter the data there.Even having correctly estimated how much space is needed for / home, / usr, / tmp, or any other important directory is not uncommon for us to stay out of space in these partitions, when we have plenty of room somewhere else.

  • With the use of a logical volume manager, the entire disc can be assigned to a single logical group and define different logical volumes to store / home or other directories. In case we run out of space, for example, / home, and we have space in / opt, could resize / home and / opt and use the space we've taken from / opt and add it to / home. Keep in mind that to do this, your file system must support resizing the top and bottom, as ReiserFS.

  • Another alternative would be to allow a certain amount of unallocated disk space and where necessary, expand the volume.

Advantages of using LVM in a large system

  • Administering a system with many disks is time-consuming work, and is particularly complex if the system contains records of different sizes. Balancing storage requirements of different users (often conflicting) can be a very laborious and complex task.

  • User groups (call them for example administration, development, etc ...) can have its logical volumes and these can grow as needed, and the administrator can perform the appropriate operations on those volumes.

When a new record is added to the system, it is necessary to move the user data. Simply add the new album to the corresponding logical group and expand the logical volumes all that is appropriate. You can also migrate data from old disks to new ones, completely transparent to the user.



Anatomy of LVM 
  • An LVM is broken down into three parts:

    Physical volumes (PV) are the hard disks, partitions or any other "thing" that looks like a hard disk (raid's)

    Logical Volumes (LV) is the equivalent to a partition on a traditional system. The LV is visible as a standard of blocks, so it can contain filesystems (eg / home) 

    Volume group (VG) is the top of the LVM. It is the "box" where we have our logical volumes (LV) and our physical volumes (PV). It can be seen as an administrative unit in which encompass our resources. It should be noted that while PV is not added to the VG, we can start using it.

In turn, one PV is divided into chunks of data, known as PE (physical extents), which are the same size as the PE of VG. In addition, a LV is also divided into LE (logical extents), whose size is the same for all LV's VG.

For example, with reference to the image of the beginning of the article, suppose we have a VG called CASA, with 4MB of PE, which we add the LV for / tmp /. We added two disk partitions, / dev/sda4 and / dev/sdb3, to be called PV1 and PV2 (you can rename the user's discretion). The PV's can be of different size and therefore have a different number of PE, so suppose we have 99 PE's for PV1 and PV2 248 PE's. Now, we need to create the LV, which can be any size between 1 and 347 (99 +248) PE. This will create a table that relates PE's and LE's and if, for example, write 4 MB at LE LV No. 1, will correspond to the PE 51 of the PV1.

The table that relates PE's and LE's, is called mapping table, and correspondence can be of two types: 

Live: assign a PE's range to another range of LE's in order. For example, the LE's the number 1 through 99 are mapped onto the PE's from 100 to 347, PV2. 

Intertwined: the LE's are intertwined on the PE's of the physical volumes, for example:

Destination
Origin
First chunk of LE1
First chunk of the PV1
Second chunk of LE1
First chunk of PV2
Third chunk of LE1
Second chunk of the PV1
...
...
 
Snapshots (snapshots)
Snapshots (snapshots) allow the administrator to create a new device that will be an exact copy of the LV, frozen at some point in time. Normally this is done automatically, not to alter the normal functioning of the system. When the snapshot is complete, the administrator can remove the device without any problems.Furthermore, it is necessary that the data in the LV are in a consistent state, as many file systems in the 2.6 kernel is done automatically.

An important difference between LVM version 1 (LVM1 from now) and version 2 (LVM2) is that in the first, the snapshots were read-only, while in LVM2 are reading and writing. What is the difference? In LVM1, creating what is called a table of exceptions, which are used to maintain a list of which disk blocks have changed. If a block will be modified at the source is first copied to the snapshot, marked as copied in the table of exceptions and then new data is copied to the original volume. In LVM2, snapshots work as in LVM1, but with the feature that if data is written to the snapshot (once assembled), the block is marked as used in the table of exceptions and not copied to the original volume. This feature is very useful because we can create our instant, assemble and test a new program or a file browser.If something disastrous happens, the tire, we delete it and replace the original volume. 

Putting it all together
A concrete example will help: 

Suppose we have a volume group called VG1, this volume group has a physical extension of 4MB. Within this volume group we put two partitions, / dev/hda1 and / dev/hdb1. These partitions will become physical volumes PV1 and PV2 (can be given more meaningful names depending on the administrator). The PV's are divided into chunks of 4MB, and this is the extent size of the volume group. The discs are of different sizes and 99 extensions will PV1 and PV2 248. Now we can create a logical volume, which may have the size you want between 1 and 347 (248 + 99) extensions. When we created the logical volume defines a mapping between logical and physical extensions, eg. a logical extension could be mapped onto physical extent 51 of PV1, data written in the first 4 MB of the logical volume is written to the extension 51 of PV1. 

Common Tasks

Initializing a disk or partition to use with lvm

pvcreate / dev / sda
pvcreate / dev/sda1
pvcreate / dev/sda5

Volume Group 
As we know the volumes of groups include partitions or disks, therefore, if we want to create a volume group called the foundation and add multiple partitions do the following:

vgcreate foundation / dev/sda1 / dev/sda2 / dev/sdb1


Then we need to activate the volume group

vgchange-ay foundation

to clear output:

vgchange-an Foundation
To clear the founding group wrote:

vgremove Foundation
Note: This will delete the volume group and all its logical volumes.

If we extend our volume group, ie, we need to add another partition or disk, then typed 

vgextend foundation / dev/sda1
This adds the partition / dev/sda1 to our volume group foundation.
To see the changes wrote:

vgdisplay Foundation
And to see the active partition and associated volume group:
 
pvdisplay
Removing physical volumes from a volume group

If we are to / dev/sdc1 of our founding group volume, then:

vgreduce foundation / dev/sdc1
Logical Volumes

To create a logical volume from 1GB to our foundation we group volume:

lvcreate-L +1 G-n LV1 Foundation
where is our logical volume LV1 create
If you want the logical volume is located in a specific partition of the volume of founding group then becomes as follows:

lvcreate-L +1 G-n LV1 foundation / dev/sdb1
After this should create a logical volume at / dev/fundacion/lv1 the format which would give him and then got on our filesystem:

mkfs.ext3 / dev/fundacion/lv1
Then you are ready to be mounted wherever you want

mount / dev/fundacion/lv1 / mnt

Extending a logical volume
If you need more space in our logical volume LVM1 then we extend it to our way taking into account the volume space group we belong to, is, we can not exceed the size of our logical volume free space beyond the volume that has our group. Serious:

First unmount the partition, if fitted:

umount / mnt /

lvextend-L +1 G / dev/fundacion/lv1
This increases the logical volume LV1 1Gb. In addition to this, we must tell the operating system change that volume:

e2fsck-f / dev/fundacion/lv1
to check the filesystem. Then:

resize2fs / dev/fundacion/lv1.
After this you can mount the partition again LV1 with the changes.

Reducing a logical volume:

Note: It can be very dangerous to perform this task.

If our logical volume LV1 has 2Gb of space and we want to reduce it to 1GB, we performed the following:

Dismantle up volume is mounted.

umount / mnt

e2fsck-f / dev/fundacion/lv1

Then I do the resize operating system level

resize2fs / dev/fundacion/lv1 1G
What this does is tell the OS that the LV1 logical volume will now be 1Gb

Finally we reduce it:

lvreduce-L-1G / dev
To confirm that the cash has verified the size of the volume:

lvdisplay / dev/fundacion/lv1
And confirmed in the operating system

fdisk-s / dev/fundacion/lv1

Finally assemble again with the new logical volume size:

mount / dev/fundacion/lv1 / mnt

Bibliography:

http://es.wikipedia.org/wiki/LVM
http://www.tldp.org/HOWTO/LVM-HOWTO.html 

GNU/Linux distribution timeline

  I recently found an interesting image about the History of all the Linux distributions displayed in a timeline graphic.


(click on the image to see the original picture)

Linux is mainly 3 distributions: Debian, Slackware and Red Hat. They mainly differ by their packaging system (Red Hat: rpm, Debian: deb, Slackware: tgz).
It is unbelievable how hundreds of distributions have been created from them.

bootchart - How fast are you booting?


With bootchart, you are able to mesure how fast your pc is booting. You just need to install the package:yum install bootchart
The following instruction (
init=/sbin/bootchartd) is added in the /etc/grub.conf file in the kernel line.
Then reboot your pc. A data file is created in 
/var/log/bootchart.tgz. Then just run bootchart to generate a png file.

F8: How to install Live images on a USB drive

You decided to test Fedora 9-beta but you don't want to install it yet on your disk. A good solution is to install the live version of Fedora 9-beta on your usb stick and then boot on it.
But how to install an iso image on a usb drive?

Well, insert your usb drive and check on which device your usb drive is mounted.

# mount
[...]
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=501)


Then check that you have the necessary tools installed on your pc.

# rpm -q livecd-tools
livecd-tools-013-1.fc8


If not, install them as root:

yum install livecd-tools


Then run live-iso-to-disk as root:

# livecd-iso-to-disk Fedora-9-Beta-Live-i686.iso /dev/sdb1
Verifying image...
Fedora-9-Beta-Live-i686.iso: 1df4a4bc641220fa44cfd5d252dadb16
Fragment sums: 74221c82498ad77168fb66d935bd358ba8ca1727cbf3b5bf55259ff692c6
Fragment count: 20
Percent complete: 100.0% Fragment[20/20] -> OK
100.0
The media check is complete, the result is: PASS.

It is OK to use this media.
Copying live image to USB stick
Updating boot config file
Installing boot loader
USB stick set up as live image!

Note that your usb drive has to be bootable:

# fdisk -l /dev/sdb
Disk /dev/sdb: 1031 MB, 1031798272 bytes
255 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x91f72d24

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 126 1007584 6 FAT16
Partition 1 has different physical/logical endings:
phys=(124, 254, 63) logical=(125, 112, 50)


Leave your usb drive and reboot your pc on it.

Ethernet bonding

Ethernet bonding is a way to combine multiple ethernet channel into a single one. If, for example, you have 2 ethernet cards of 1 Gb/s speed each, you can combine them to have one virtual card of 2 Gb/s speed.

Suppose you have a cluster of several nodes, one of them is the master node and has 3 ethernet cards, one for the network 192.168.1.0/24 (file ifcfg-eth2) and the two others (file ifcfg-eth0 and ifcfg-eth1) bonded together (file ifcfg-bond0) for the network 192.168.7.0/24.

The ethernet card in the network should be configured with file ifcfg-eth2 as follows:
DEVICE=eth2
BOOTPROTO=none
HWADDR=00:05:48:A8:F2:H6
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.13
GATEWAY=192.168.1.254

Juste create in /etc/sysconfig/network-scripts, the file ifcfg-bond0 containing the following lines:
DEVICE=bond0
BOOTPROTO=none
BROADCAST=192.168.7.255
IPADDR=192.168.7.20
NETMASK=255.255.255.0
NETWORK=192.168.7.0
GATEWAY=192.168.1.254
ONBOOT=yes
USERCTL=no
TYPE=Ethernet

which is what you would have for a single ethernet card in a file called ifcfg-eth0. On the master node, you have to specify the gateway 192.168.1.254.

On the other nodes, you will specify the gateway to be 192.168.7.20 which is the IP address of the master node in the network 192.168.7.0/24:

DEVICE=bond0
BOOTPROTO=none
BROADCAST=192.168.7.255
IPADDR=192.168.7.22
NETMASK=255.255.255.0
NETWORK=192.168.7.0
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
GATEWAY=192.168.7.20

You must also create the files ifcfg-eth0 and ifcfg-eth1, one file for each card in which you will put the following:

In ifcfg-eth0:
DEVICE=eth0
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=no
TYPE=Ethernet

In ifcfg-eth1:
DEVICE=eth1
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
BOOTPROTO=no
TYPE=Ethernet

This way, both cards know who is the master.

On the master node, ifconfig should give:
# ifconfig 
bond0 Link encap:Ethernet HWaddr 00:02:55:C7:ED:73 
inet addr:192.168.7.20 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:27451 errors:0 dropped:0 overruns:0 frame:0
TX packets:13703 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:2542289 (2.4 MiB) TX bytes:1328584 (1.2 MiB)

eth0 Link encap:Ethernet HWaddr 00:02:55:C7:ED:73 
inet6 addr: fe80::202:55ff:fec7:ed73/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:13684 errors:0 dropped:0 overruns:0 frame:0
TX packets:6854 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:1239023 (1.1 MiB) TX bytes:663919 (648.3 KiB)

eth1 Link encap:Ethernet HWaddr 00:02:55:C7:ED:73 
inet6 addr: fe80::202:55ff:fec7:ed73/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:13767 errors:0 dropped:0 overruns:0 frame:0
TX packets:6849 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:1303266 (1.2 MiB) TX bytes:664665 (649.0 KiB)

eth2 Link encap:Ethernet HWaddr 00:03:47:B1:F9:E6 
inet addr:192.168.1.13 Bcast:192.168.1.15 Mask:255.255.255.240
inet6 addr: fe80::203:47ff:feb1:f9e6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:311014 errors:0 dropped:0 overruns:0 frame:0
TX packets:443837 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:110699104 (105.5 MiB) TX bytes:434496718 (414.3 MiB)
Memory:effc0000-effe0000 

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:185354 errors:0 dropped:0 overruns:0 frame:0
TX packets:185354 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:421703302 (402.1 MiB) TX bytes:421703302 (402.1 MiB)

On the slave nodes, ifconfig should give
# ifconfig 
bond0 Link encap:Ethernet HWaddr 00:02:55:C7:ED:EE 
inet addr:192.168.7.22 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::202:55ff:fec7:edee/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:14694 errors:0 dropped:0 overruns:0 frame:0
TX packets:3973 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:1138254 (1.0 MiB) TX bytes:359734 (351.3 KiB)

eth0 Link encap:Ethernet HWaddr 00:02:55:C7:ED:EE 
inet6 addr: fe80::202:55ff:fec7:edee/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:7380 errors:0 dropped:0 overruns:0 frame:0
TX packets:1991 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:579813 (566.2 KiB) TX bytes:178136 (173.9 KiB)
Interrupt:193 Base address:0x6000 

eth1 Link encap:Ethernet HWaddr 00:02:55:C7:ED:EE 
inet6 addr: fe80::202:55ff:fec7:edee/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:7322 errors:0 dropped:0 overruns:0 frame:0
TX packets:1994 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:558969 (545.8 KiB) TX bytes:183558 (179.2 KiB)
Interrupt:201 Base address:0xa000 

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:152 errors:0 dropped:0 overruns:0 frame:0
TX packets:152 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:10980 (10.7 KiB) TX bytes:10980 (10.7 KiB)

F10: How to setup a pxeboot + tftp + dhcp server?

The solution is to confiure a tftp server (so the client will be able to boot on through PXE), a dhcp server different from the one in my firewall and an NFS server.
The NFS server is called nfsserver (10.0.21.17), the dhcp and the tftp server are on the same server, calledpxeserver (10.0.21.210). These server can reside on different machines.

Here are the packages to be installed:

  • system-config-netboot
  • system-config-netboot-cmd
  • tftp
  • tftp-server
  • dhcpd
Configuration of the NFS server on nfsserverDownload the DVD iso image of the Fedora 10 distribution.
Then mount it in a directory /mnt/f10tmp:
# mkdir /mnt/f10tmp
# mount Fedora-10-i386-DVD.iso /mnt/f10tmp -o loop

Copy the content of /mnt/f10tmp into /mnt/f10.
# mkdir /mnt/f10
# cp -r /mnt/f10tmp/* /mnt/f10

Add the following line in /etc/exports:
/mnt/f10 *(rw,async,no_root_squash)

Then run
# exportfs -va

Configuration of the tftp server on pxeserver
Run system-config-netboot and configure a network installation:
  • Oprating system identifier: name of your distribution (Fedora10)
  • Description: some desciption!
  • Select protocol for installation: choose NFS
  • Kickstart: if you have a kickstart file, put the path to it here, if not, leave empty
  • Server IP address : 10.0.21.17
  • Location: /mnt/f10
Click OK. This creates a directory /tftpboot/linux-install/Fedora10 with files like initrd.img and vmlinuz downloaded from your nfsserver (/mnt/f10/images/pxeboot/).

Create a New PXE configuration file:
  • Hostname of IP Address/subnet: the IP of your hosts
  • Operating system: Fedora10 should be there. It is auto-populated from the previous step.
Click OK. A file named default is created in /tftpboot/linux-install/pxelinux.cfg.

Edit the file /etc/xinetd.d/tftp and change the line containing server_args:

service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot -v -v
per_source = 11
cps = 100 2
flags = IPv4
}


Check that the server is on:
# chkconfig --list tftp
tftp on

If off, set it on:
# chkconfig tftp on

and the start the server xinetd:
# /etc/init.d/xinetd restart

You can test your tftp server with the tftp client from your home directory:
$ tftp pxeserver
get linux-install/pxelinux.0

You should have the file pxelinux.0 in your home directory.

Configuration of the dhcp server on pxeserver
Edit the file /etc/dhcpd.conf and add the following lines:

subnet 10.0.21.208 netmask 255.255.255.240 {
range 10.0.21.209 10.0.21.222;
allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 10.0.21.210;
filename "linux-install/pxelinux.0";
}
}

Even if you have a running dhcp server somewhere, this will work.

Start the dhcp server:
# /etc/init.d/dhcpd restart

Check in /var/log/messages:
Dec 5 11:49:06 pxeserevr dhcpd: Listening on LPF/eth0/00:15:c5:53:fd:f5/10.0.21.208/28
Dec 5 11:49:06 pxeserver dhcpd: Sending on LPF/eth0/00:15:c5:53:fd:f5/10.0.21.208/28
Dec 5 11:49:06 pxeserver dhcpd: Sending on Socket/fallback/fallback-net


Restart now your client (target) pc to boot over the network.

You should see something like this in /var/log/messages:

Dec 5 11:49:32 pxeserver dhcpd: DHCPDISCOVER from 00:04:76:51:2e:d8 via eth0
Dec 5 11:49:33 pxeserver dhcpd: DHCPOFFER on 10.0.21.212 to 00:04:76:51:2e:d8 via eth0
Dec 5 11:49:36 pxeserver dhcpd: DHCPREQUEST for 10.0.21.212 (10.0.21.210) from 00:04:76:51:2e:d8 via eth0
Dec 5 11:49:36 pxeserver dhcpd: DHCPACK on 10.0.21.212 to 00:04:76:51:2e:d8 via eth0
Dec 5 11:49:36 pxeserver in.tftpd[6567]: RRQ from 10.0.21.212 filename linux-install/pxelinux.0
Dec 5 11:49:36 pxeserver in.tftpd[6567]: tftp: client does not accept options


If it does not work, either disable the firewall (system-config-firewall) on pxeserver or allow port 69 to be accessible to any hosts accessing the tftp server.
If you get an error, please have a look here to fix it.

You will have a prompt to boot either on Fedora10 or on your local installation.

Friday, July 23, 2010

RHCE Sample Question

Morning Session – 2 and half hours

Phase 1 – 8 Questions

Q1. Login Problem (Compulsory)

Q2. Configure network settings to specification so that you can ping 192.168.1.254 (Compulsory)

Q3. dig server1.example.com should work properly (Compulsory)

Q4. Successfully login to init 5 as root (Compulsory)

Q5. Resize a 200 MB LVM to a 100 MB LVM without losing data

Q6. User neo should be able to create 30K file but not 70K file (quotas)

Q7. Create 100 MB partition and mount it as /mnt/new. Should work across reboot (Compulsory)

Q8. Showmount –e should show the /export directory as available.

Phase 2 – Boot Troubleshooting

Examiner will insert a CD which will perform a very basic installation in text mode. The examiner will then remove the CD and then ask you to reboot. Once you reboot, you will get a kernel panic error. Once you set this right, your system will not boot because it cannot see the LABEL root. You will need to use resuce mode, find the device that has the /etc/fstab file and then modify it in such a way that fstab contains the line LABEL=/ instead of LABEL=root

If the system boots without any problems into runlevel 3, then 20 marks.
If the system boots into maintenance mode, then 10 marks
If the system does not boot at all, then 0 marks



Afternoon Session – 3 Hours
Q1. Install RHEL3 according to the following requirement:-

/boot - 128 MB
/ - 256 MB
/home - 512 MB
/usr - 2048 MB
/var - 512 MB
swap - 1.5 – 2 times the amount of RAM as 
specified in /proc/meminfo
Remaining space should be given to a RAID 0 set and a directory /data should be mounted on it.
Q2. Connect to http://somesite/cgi-bin/form.php and fill in your details

Q3. Install the dialog rpm

Q4. Create a directory called sysadmin. Create a group called sysadmin. Change the 
Group ownership of the sysadmin directory to sysadmin group. Create a user called
Jane and the secondary group should be sysadmin. Create a user called John and 
Secondary group should be sysadmin. Create a user called eric who should not be a 
Member of other groups and he should not get an interactive shell

Q5. Create a file in the sysadmin directory by logging in as jane. Check if john is able to 
Access the file

Q6. Enable IP Forwarding on your system

Q7. Implement a web server by copying a .html from the NFS server into your Document 
Root
Q8. Configure sendmail in such a way that it is reachable from remote machines on its IP
And also local host
Q9. Configure FTP in such a way that cracker.org (192.168.1.0/255.255.255.0) machines 
cannot connect but example.com machines can.
Q10. Configure SSH in such a way that cracker.org machines cannot connect but
Example.com machines can.

Q11. Create a samba share called X on your system. User jane should have access to it

Q12. Bind your system to the NIS domain RHCE. Try to login as user guestX

Q13. Configure automount in such a way that server1.example.com:/rhome/nisuserX is 
Automatically mounted on your home directory. The user should be able to login
Successfully

Q14. Configure a printer queue which will forward print jobs to the shared print queue on
Server1.example.com

Q15. Configure POP3 on your system such that user jane is able to receive mails. Disable
POP3 for cracker.org machines

Q16. Configure Squid to share internet connection on port 8080 with example.com 
Machines
Q17. Configure SSL for SSH on your system. Create a certificate using which your 
System will SSH to station249.example.com

Q18. Configure your web server to host multiple sites on same IP

Q19. Configure imaps in such a way that john gets authenticated and allowed to use
Imaps. Cracker.org machines should not get authenticated

Q20. Create a mail alias for example.com as something.com




**********************Trouble Shooting***********************
1. login as root. Your root password should be redhat. (COMPULSARY)

2. You should be able to ping server1.cracekr.com

3. You should be able to dig server1.example.com (COMPULSARY)

4. You should get GUI login in the next reboot (Xwindows problem) (COMPULSARY)

5. When you type showmount -e localhost /export is seen as exported. (COMPULSARY)

6. when user neo type dd if=/dev/zero of=somefile bs=1024 count=30 he succeed.

when he type dd if=/dev/zero of=somefile bs=1024 count=70 he fails.

7. Resize your logical volume myvol to 300Mb. A + or - 10Mb variation is allowed.

8. Create a new partion of 100Mb size and mount it permanently under /mnt/new. (COMPULSARY)

9 And 10 kernel panic. Problems in /etc/fstab and /boot/grub/grub.conf

************************RHCT**************************

1. Fll the enrollment form.

2. Install a dialog rpm. RPM lies in /var/ftp/pub

3. Installation requirement

/home - 512 /boot - 128

/var - 512 / - 256

/usr - 2048 swap - 1.5 to 2 times of memory seen

in proc filesystem. All the remainig space will be allocated to raid 0 and mount it on /data.

4. Add a group named sysadmin. Add 3 users john, jane, and eric out of which eric should not have
a login window. john and jane are members of secondary group sysadmin.

5. Create a directory sysadmin under /data. The members of sysadmin should be able to create files
in sysadmin. The files created in sysadmin should have group ownership as sysadmin.

6. Enable ip forwarding.

7. Export /data only to example.com domain

8. Upgrade with appropriate kernel. New kernel lies in /var/ftp/pub/updates.

9. Printer configuration through IPP(cups). The print que is stationx. and server is
server1.example.com. You can check it under site http://server1.example.com:631/printers/stationx/

10. In the server nisuserx has his home directory in /rhome/stationx/nisuserx.
In your system nisuserx should get his home directory in /rhome/nisuserx. All other nisusers should be able to login but others can't get their home directory.

11. User jane sets a cronjob to print hello to any output device at
1.30AM
********************************RHCE**********************************
1. Enable ssh only to user john. or enable ssh only to example.com

2. configure an ftp server only to example.com

3. Configure a pop3 server only to example.com so that user eric should get his mail.

4. Setup an SMTP server such that you can receive mail from any network.

5. Setup a samba server. The workgroup is example. A share named data is shared and it should be browsable and should not be writable. The valid user is john.
6. Setup a site named stationx.example.com. The html file lies in /var/ftp/pub/html/htmlfile.
Use ftp to download the html file.

7. Setup a proxy server on port 8080 only to example.com

8. Configure imaps in such a way that john gets authenticated and allowed to use
Imaps. Cracker.org machines should not get authenticated.

9. Setup a site named wwwx.exmaple.com where x is your station number. Document root is
/www/date. Html file lies in /var/ftp/pub/www/wwwfie. User john should be able to host site on it.

10. Create a mail alias for example.com as something.com





Section 1
**********
Troubleshooting (45 minutes)
----------------------------
1) Login to the system as root with password "redhat"
2) ping to ip 202.88.219.129
3) mount the exported directory /var/ftp/pub of 192.168.100.79 on to the directory /mnt/cdrom/ refer file "/root/network.txt" for network configuration
4) The system should boot in run level 5 with graphical login screen
5) resize lvm to have 50mb more space
6) mount the the remote share to /mnt/ (iptables)
7) share the directory /data with rw permission to all (portmap)
NOTE Re-Installation of the system is not allowed in section 1 (rescue disk will be provided)

Section 2
***********
Installation and RHCT (2 hours)
--------------------------------
1)Install with the following specification
/boot 100Mb
/home 5Gb
/opt 5Gb
swap 500Mb
/ 1000mb
remaining /data as raid partition
with Hostname "exam" and root password "redhat"
Network installation is to be done
ip of local system 192.168.100.20
ftp server 192.168.100.79 /var/ftp/pub/
anonymous login

2) Configure your machine to get dynamic ip
3) Install dialog rpm
4) Create a user "mark" who does not have an interactive shell
5) Create a user "green" who also belongs to group "mark"
6) Create a user who belongs group "mark" only
7) Configure your machine as dns client
DNS server 192.168.100.79
DOMAINNAME example.com
8) Configure an NIS client
NIS server 192.168.100.79
NISDOMAINNAME example.com
9) Configure your machine to mount the home directory of user "nisuser" at boot time
server 192.168.100.79
home directory of user "nisuser" 192.168.100.79:/home/nisuser
10) Create a directory "share" in / with rwx permission to all users in group "mark"
Files created in this directory should have read permission to all
But users cannot delete files created by others
11) Configure a cron job to create a file "logout" in /root
with the content "Time up" at 06:00 am everyday
12) Configure a local printer with queue name "prqu"
13) install the kernel rpm and boot with the new kernel(ftp server and location of kernel rpm will be given)

RHCE PART
14)configure your machine as ftp server with access restricted to the domain cracker.org
15)configure your machine as an ssh server with access only from cracker.org
16)configure your machine as samba server to share the directory /data with rw permission to all members of example.com domain. members of cracker.org should not be allowed to access the share
17)set up your machine as mail server.mails to root should be delivered to user mark
18)set up your machine as httpd server server name tux.example.com (index.html for this wil be provided at ftp site)

Advanced conf
---------------------
19)enable imap with ssl support
20)configure a virtul host virtual.example.com (index.html will be provided at ftp site)
21)configure squid
17) Configure your machine to have a default runlevel of 3

Sample Model Question

RHCE QUESTION SUGGESTIONS ( EL3)
Two Parts:-
Trouble Shooting and Maintenance – morning session – duration 2.5 hrs
RHCT and RHCE both combined – afternoon session - duration 3 hrs.
Trouble Shooting and Maintenance :- (Two Phases)
=>Phase One – 8 questions
=>Phase Two – 2 questions
Phase One:-
Login Problem –
Username: root
Password: redhat
The candidate should able to login with username and password as given above(COMPULSORY)
Your system should able to ping with the given IP (server)
NFS. showmount command should show the exported directory.
(COMPULSORY)
LVM (resizing the logical volume)
Quota (user limit given)
Creating and mounting a new partition (COMPULSORY)
DIG should execute properly, giving you the answer, authority and query section of a given IP (server).
Changing the run level to 5. User should able to login in GUI mode.
The Compulsory Questions should be completed in one hour of maximum. Failing to do this will disqualify the candidate from continuing the exam.
The candidate should report to the examiner as soon as he feels he had completed.
Examiner will give the confirmation that he had completed the compulsory question successfully. He can continue with the remaining questions.
Phase Two :-
The candidate can report to the examiner after completing the phase one questions. However he can not get the confirmation for the successful completion of remaining (except Compulsory) questions. The examiner will give you a CD which will put your system onto a small installation after typing phase two in the installation screen.
After the installation the candidate will be in grub screen asking for OS. When you enter into the OS, Kernel Panic error will occur. The following problems are the components of Phase Two.
Boot Problem (Arguments May be edited in /boot/grub/grub.conf).
fstab Problem ( /etc/fstab file may be edited).
After completing the Trouble Shooting and Maintenance Session the candidate can go for a break.
Note: one can not go back to Phase One after entering Phase Two.
Only for the Compulsory questions one can get confirmation.
Failing to score 80% will result in losing the certification, but one can go thro’ the other sections of the exam.
RHCT
Enrolling your name and email id in the given address.
Installation of any rpm.
Installation of EL3 with given partion specification along with raid .
Group Administration.
Kernel Updation.
Network Printer Configuration.
IP Forwarding.
Crontab Execution
NIS (The candidate should bind his machine to server and should able to see the available users in the server)
Autofs (The candidate should able to login with specified username From Server)
RHCE
Denying the SSH Service to specified machines.
Denying the FTP Service to specified machines.
Configuring the POP3 sever and also denying this service from other machines
specified.
Setting the given user to receive all mails which are directed to a group.
Configuring Mail Server.
Configuring Samba.
NFS (The candidate should export successfully the specified file/directory to the specified network )
Configuring Apache.
The above 8 question is enough for the candidate to achieve the RHCE Certification, if completed successfully. However the following Extra 3 questions will also be a choice for him to score more. Only the best two will be taken into consideration from the following.
Extra
Squid (Candidate should configure his machine as Squid Proxy and should share the internet only to the specified network )
Mail Certification.
Extending your Web Server to have another Website.
Througout the exam, the questions will be based on two networks one in ‘0’ network that is candidate’s home network and other is ‘1’ network that is Cracker’s network . Both the networks will have Servers. ( Ex: server1.example.com , cracker1.example.com)