Monday, December 05, 2005
RHCE: Success!
Saturday, December 03, 2005
RHCE: I took the exam on 12/02/2005
Note: As is common knowledge, no discussion of the exam or contents can occur after taking the exam by participants. Please refer to the website at http://redhat.com/training for any questions you may have. There is a detailed exam prep page that will outline all of the requirements.
Sunday, November 27, 2005
RHCE: Run-time RAID Configuration
Here is an excerpt:
Creating an Array
Create (mdadm --create) mode is used to create a new array. In this example I use mdadm to create a RAID-0 at /dev/md0 made up of /dev/sdb1 and /dev/sdc1:
# mdadm --create --verbose /dev/md0 --level=0
--raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: chunk size defaults to 64K
mdadm: array /dev/md0 started. The --level option specifies which type of RAID to create in the same way that raidtools uses the raid-level configuration line. Valid choices are 0,1,4 and 5 for RAID-0, RAID-1, RAID-4, RAID-5 respectively. Linear (--level=linear) is also a valid choice for linear mode. The --raid-devices option works the same as the nr-raid-disks option when using /etc/raidtab and raidtools.
In general, mdadm commands take the format:
mdadm [mode] [options] Each of mdadm's options also has a short form that is less descriptive but shorter to type. For example, the following command uses the short form of each option but is identical to the example I showed above.
# mdadm -Cv /dev/md0 -l0 -n2 -c128 /dev/sdb1 /dev/sdc1
Saturday, November 12, 2005
RHCE: Installing RPMs from an NFS share
1. Verify that the NFS share is available and mount on the local filesystem, if not already mounted.
mount -t nfs /local/install/point /nfs/server
2. If using the command line, simple use the RPM command to install the application:
rpm -Uvh /path/to/share/application.rpm
3. If using the package manager, use the following command from the command line:
system-config-packages --tree=/path/to/nfs/share &
You will now be able to select the applications that you would like to add or remove.
RHCE: Logical Volume Manager
When using LVM, it may be difficult to remember all of the commands that are possible and necessary to create a Logical Volume. An easy way to get a list of all of the related commands is to enter the lvm console by typing 'lvm' on the command line. Once in the LVM console, type 'help' and all of the available commands will be listed with a short description.
CAUTION: using the logical volume manager can and probably will destroy data. Verify that you have created backups of all of your data before trying the samples below.
Using the Logical Volume Manager
1. Partition the physical hard disks that will be used as part of the Logical Volume(s)
Use 'fdisk' as appropriate. Remember to set the system type as 'Linux LVM', which is type '8e'.
2. Create physical volume(s)
From within the lvm console, use pvcreate on each partition that will participate in the logical volume group.
pvcreate 'physical partition'
Sample:
lvm> pvcreate /dev/hdd1
Incorrect metadata area header checksum
Physical volume "/dev/hdd1" successfully created
3. Create a volume group
Using the vgcreate command, create a volume group which consists of the physical volumes created previously.
vgcreate 'volume group name' 'physical volume' ['physical volume'] ...
Sample:
lvm> vgcreate test1 /dev/hdd1 /dev/hdd2
Incorrect metadata area header checksum
Volume group "test1" successfully created
Verification of the volume group creation can be done with the vgdisplay command:
lvm> vgdisplay
--- Volume group ---
VG Name test1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 93.15 GB
PE Size 4.00 MB
Total PE 23846
Alloc PE / Size 0 / 0
Free PE / Size 23846 / 93.15 GB
VG UUID znEYOy-n4oJ-zmXq-QARI-cRvD-YmY5-Gq6qpd
4. Create a logical volume in an existing Logical Volume Group
Using the lvcreate command, create a logical volume:
lvcreate [-L 'size'] [-n 'logical volume name'] 'logical volume group'
Sample:
lvcreate -L 200M -n vol1 test1
Incorrect metadata area header checksum
Logical volume "vol1" created
Verify that the logical volume is as desired with the lvdisplay command:
lvm> lvdisplay
Incorrect metadata area header checksum
--- Logical volume ---
LV Name /dev/test1/vol1
VG Name test1
LV UUID HPqCiY-58NT-X1ae-5vk3-1hLw-f2no-AYe52O
LV Write Access read/write
LV Status available
# open 0
LV Size 200.00 MB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0
5. Format the logical volume with the filesystem desired (ext3 shown)
[root@primary ~]# mke2fs -j /dev/test1/vol1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
51200 inodes, 204800 blocks
10240 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
25 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
6. In good Red Hat form, create a label for the filesystem with the e2label command
[root@primary ~]# e2label /dev/test1/vol1 test1
7. Create an entry in the /etc/fstab file for this logical volume so that it will be mounted on subsequent boots. Use a meaningful mount point:
LABEL=test1 /test1 ext3 defaults 0 0
These steps have covered how to create a logical volume and use it. You can also expand an existing logical volume and perform other maintenance tasks. The only other task covered here will be expanding an existing logical volume.
Expand a logical volume
1. Add desired disk space to your volume group, if necessary
a. use fdisk to create a new partition of type '8e'
b. use pvcreate to initialize the new partition as a physical volume
[root@primary ~]# pvcreate /dev/hdd3
Physical volume "/dev/hdd3" successfully created
c. use vgextend to add the physical volume to the volume group
[root@primary ~]# vgextend test1 /dev/hdd3
Incorrect metadata area header checksum
Incorrect metadata area header checksum
Volume group "test1" successfully extended
CAUTION: The next step will remove all data from the partitions in question. Verify that you have backups.
d. use lvextend to expand the logical volume to the desired size
[root@primary ~]# lvextend -L 300M /dev/test1/vol1
Incorrect metadata area header checksum
Extending logical volume vol1 to 300.00 MB
Logical volume vol1 successfully resized
e. re-format your logical volume, relabel it, and remount it
umount 'logical volume'
mke2fs -j 'logical volume'
e2label 'path to volume' 'label'
mount 'path to volume in /etc/fstab'
Trouble Shooting
1. 'physical partition' not identified as an existing physical volume
lvm> vgcreate 'volume group' 'physical partition' 'physical partition'
Incorrect metadata area header checksum
Incorrect metadata area header checksum
No physical volume label read from 'physical partition'
Unable to add physical volume 'physical partition' to volume group 'volume group'.
To correct this problem, use lvm to create a physical volume on each partition with the pvcreate command:
lvm> pvcreate 'physical partition'
Incorrect metadata area header checksum
Physical volume "physical partition" successfully created
Create the volume group with the vgcreate command.
Sunday, October 23, 2005
RHCE: Networking and Network Configuration
The first requirement is that your machine must have a means of communicating with other machines through hardware. This requirement is typically met through a network interface card (NIC) at the host level and a switch or router at the local area network (LAN) level. These devices are connected through ethernet cables or another suitable medium (which may also include wireless devices). This requirement is also referred to as the Physical Layer in the OSI Reference Model.
The next requirement is that each network interface must be configured properly. Each interface must be configured with an IP address, netmask, and gateway. These simple parameters allow the interface to communicate with other interfaces on the network. Each interface may be configured through the GUI tools which are provided by Red Hat, by editing configuration files with a text editor, or they can be manually configured from the command line. I will review the command line and text file configurations only. This requirement covers layers 2 and 3 of the OSI Reference Model.
Another requirement that must be met if communication with the network outside of the immediate network is desired is proper configuration of the /etc/resolv.conf file with the IP address of a valid DNS server:
The /etc/resolv.conf file, when configured properly, will allow the machine to obtain IP addresses for hosts which are known only by host name. It is critical that you do not allow any spaces before the nameserver directive in this file or it will not function. This file is configured automatically when using DHCP and manually when using a static IP.
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
There is a configuration file for each interface in the following directory:
/etc/sysconfig/network-scriptsThese files serve as parameter files for the network startup script which is:
/etc/rc.d/rc5.d/S10networkWhen the network service is started, either manually or on system boot, the network startup script reads the configuration file to determine whether or not the interface should be configured to start and how to configure the interface. If the interface is configured to obtain an IP address via DHCP then it will broadcast for a DHCP server and set the IP address, netmask, default gateway, /etc/resolv.conf file, and possibly the hostname for the machine, depending on how the system is configured. If the interface is configured to use a static IP address then most of the above settings will be configured through the configuration file in:
/etc/sysconfig/network-scriptsThe hostname and /etc/resolv.conf file must be configured manually. An example of this file properly configured with a static IP address is as follows:
Most of the file is self-explanatory and fulfills the requirements listed above with regard to the interface configuration. If the interface is configured to use DHCP, the file will resemble the following:
[root@primary network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
HWADDR=00:E0:81:22:CC:8B
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
TYPE=Ethernet
This simple file will cause the interface to obtain an IP address, netmask, and gateway on startup and configure the /etc/resolv.conf file with the nameserver used by the DHCP server. This is a very common configuration and makes network management very robust.
[root@primary ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
The last part of this article illustrate how to configure an interface manually on the command line. I will merely list the steps required to configure the same interface that is listed in the configuration file above with the same parameters:
You can now verify your settings with:
ifconfig eth0 192.168.1.10
route add default gw 192.168.1.1
ifconfig eth0 up
To manually obtain an IP address via DHCP, use the dhclient utility. If no interface is specified then the utility will attempt to obtain a DHCP address for each non-multicast address on the system. An example of using this utility is as follows:
ifconfig devicename
netstat -r
This command will configure the eth0 interface with an IP address, netmask, default gateway, and setup /etc/resolv.conf with the proper nameserver directives.
dhclient eth0
Through this article I explained what is required to network a Red Hat Enterprise Linux system. I also explained how to configure an interface so that the machine it is on will be able to communicate with other machines and devices on a network. The configuration can be done manually on the command line, through editting text files, and with the GUI tools provided by Red Hat with the operating system. The ability to configure Linux to interact with other systems is an essential skill, as a computer without the ability to network is useless.
Saturday, October 22, 2005
RHEL: RAID Performance
root@primary ~]# hdparm -tT /dev/md1It's not often that you can get this kind of performance out of an IDE drive, so I'm pretty happy with my purchases. I did test them with Knoppix in a non-RAID configuration and was able to get 62 MB/sec, so this is nearly 30 MB/sec better!
/dev/md1:
Timing cached reads: 956 MB in 2.00 seconds = 477.36 MB/sec
Timing buffered disk reads: 264 MB in 3.01 seconds = 87.72 MB/sec
[root@primary ~]# hdparm -tT /dev/md3
/dev/md3:
Timing cached reads: 948 MB in 2.00 seconds = 473.60 MB/sec
Timing buffered disk reads: 270 MB in 3.01 seconds = 89.68 MB/sec
Wednesday, October 19, 2005
RHCE: Exam Prep
Tonight I'll be reviewing the RHCE exam prep guide.
Tuesday, September 06, 2005
Perl: Great scripting language...
I am taking a short break from my studies for the RHCE because I received an un-solicited request for an interview from a large company in Seattle. I will keep you all updated.
Wednesday, August 24, 2005
NFS: Windows client?
RHCE: The Road to Certification
Starting out!
RHCE Exam Prep Guide
RHCE Networking and Configuration
RHCE: The Road to Certification
Sunday, August 14, 2005
NX: Remote X-Server Session
For anyone who has used VNC for remote GUI control of their systems, NX is far superior!
Wednesday, August 10, 2005
Speakeasy
Tuesday, August 02, 2005
Responsible Disclosure: Ciscogate
Open Standards: HTML and web technologies
Other reasons to not use Internet Explorer:
1. Privacy
2. Security
3. Diversity
4. Competition is better for innovation (not patents -- contrary to popular belief)
Sunday, July 31, 2005
Linux Computing: Thin Clients
Friday, July 29, 2005
Black Hat USA 2005
Saturday, July 16, 2005
Network Monitoring: Storage of capture data
tcpdump -s 1515 -C 20 -w content.lpc
I next created a Ruby script that would open the pcap file and write the data that I wanted to store to a CSV file that I would then bulk load into the MySQL database. This part worked very well and very quickly. I found that when I inserted the data into an InnoDB table, while only storing the source IP, destination IP and port, and the time of the packet, that 20 capture files would take up 1GB of space. Not only that, but it turned out to be over 1.3 million packets. This amount of data is really testing my SQL skills, as I try to create intelligent queries that will allow me to aggregate the data on specific parameters.
Anyone have any better solutions?
Securing the mother-in-law's computer.
My mother-in-law is running Microsoft Windows 98 and has been using it for nearly 7 years. She knows how to get around and sees no reason to upgrade to Windows XP or Linux. As security people, I believe that we need to advise people to use systems that are as secure as possible...especially since Microsoft does not, and cannot, maintain the security of it's Operating Systems. The real answer here is to use an Operating System that is more secure so that the users do not have to understand so much about how the technology works to be secure on-line.