Studying for the Redhat Certified Engineer (RHCE) Exam |
mdadm --detail /dev/md0 |
In my case this show the array was degraded and disk 0 was showing removed. I used Spinrite to check the viability of the disk and it was ok. I then used this command to put the disk partition (sda2) back into the array (md0)
mdadm /dev/md0 -a /dev/sda2 |
The system started rebuilding and all was good.
Because disk 0 had failed I didn't thing the system would boot after I powered it off. I had build the system with its boot partition on disk 0 and used the space on the other drives as swap. What I didn't know was, Linux will create a RAID-1 (Mirror) from more then two disks.
Grub does not boot from the mirror. Because mirrors are copies of a partition and not stripped partitions all the data is on any one of the mirrors. Grub can then be pointed to any one of the mirrored partitions (sda1, sda2...) for its data.
After doing this it was time to build a new practice system.
BUILD-4
System Name
build4.linuxfanboy.com in the CST time zone
Partions
/boot 100MB RAID-1 (hda1, hdb1, hdc1)
/ 50000MB RAID-5 (hda2, hdb2, hdc2)
/home 50000MB RAID-5 (hda3, hdb3, hdc3)
Swap 1024MB
Network
IP 192.168.10.123 GW 192.168.10.1 SNM 255.255.255.0
DAY 13
This is D-Life. (Inside joke for fellow workers.) I'm becoming very discuraged because of happenings at work.I thought I knew a lot about Linux. And I do, but being remember the details of all the main needed commands is hard. Today I worked on the "What needs to be Studied" list. I think a mnemonic or song to remember all the could make this job easyer. Something like... Bad boys rape our young girls but Virolet gives willingly. This is the one for resistor codes.
DAY 14
Sorry for the long delay in posts. My system at home has some troubles and I spent time getting it going again. This has not been intirely without value. I have learn much about the practical side of RAID system in Linux. I recomend you build a Raid-5 system and tourture it yourself.Today I am again working on the "What needs to be Studied" list. I'm hopping to expand and orginize these pages soon and build a set of more formal lessions to study for the exam. I'm sure I will do it again after taking the test.
DAY 15
The days or flying and I'm not getting that much closer to being ready for the exam. Time to put it in high gear. My son Nathan provided me with these exersises. I will recreate them and provide the disk images for you. You will only need the VMware player. You can download it here http://www.vmware.com/download/player/
As soon as I can build the Image files there will be here.
RAID
This exersize will build a RAID-5 with three disks and then remove and rebuild one of them.
CentOS 4.4 i386 install with raid and testing of raid recovery There are some differences between version of Redhat / Fedora Linux. The bigest one found was putting back an existing disk into the array. Some use the -a option and others use the --re-add option. When one works the other does not return an error. CentOS 4.4 and mdadm 1.6.0-3: |
GRUB
Boot from first cd/dvd or rescue cd
If using the first cd/dvd, type linux rescue at the boot: prompt
You can let it automatically mount your partitions, but they don't unmount manually
if you do. So it is technically better to hand mount each partition.
If you do it manually be sure to bind /dev, /proc, and /sys from the rescue
environment to your chroot environment. I also think the automatic method forgets
some of these, so you still may to do them manually.
Example:
mount /dev /mnt/sysimage/dev -o bind
mount /proc /mnt/sysimage/proc -o bind
mount /sys /mnt/sysimage/sys -o bind
Run chroot /mnt/sysimage to turn your normal environment into your working environment.
Once you have done chroot you need to reinstall grub.
>From /sbin/grub-install:
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >>$log_file
root $1
setup $force_lba --stage2=$grubdir/stage2 --prefix=$grub_prefix $2
quit
Example with /boot as part of /:
/sbin/grub --device-map=/boot/grub/device.map
root (hd0,0)
setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
quit
root could really be called boot. root is the command to tell it what partition to
find the grub files on.
With setup the prefix doesn't apply to the stage2 option. It wants an absolute path
to where it can find the stage2 file. The prefix is more of where can it expect to
find the grub files relative to the partition you told it with root.
Example with /boot as it's own partition:
/sbin/grub --device-map=/boot/grub/device.map
root (hd0,0)
setup --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
quit
Note the /grub instead of /boot/grub on the prefix option. That is because /grub is
the path it will find the grub directory at if it is using /boot as / for that stage
of the boot process.
(hd0) in the example above is the hard drive you are installing grub on to. Grub
goes into it's master boot record. If you are using a raid array you can install it
to each hard drive by just repeating the root and setup commands. Use (hd1,0) and
(hd1) instead of (hd0,0) and (hd0), and so on.
Example output from grub:
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install --stage2=/boot/grub/stage2 /boot/grub/stage1 (hd0) (hd0)1+16p
(hd0,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.
FIXING INITRD Modules
Adding missing modules to initrd:
rm -f /boot/initrd-2.6.20-1.2320.fc5.img
mkinitrd --preload=xor --preload=raid456 /boot/initrd-2.6.20-1.2320.fc5.img
2.6.20-1.2320.fc5
Manually changing initrd:
mkdir /root/initrd-tmp
cd /root/initrd-tmp
cp -a /boot/initrd-2.6.20-1.2320.fc5.img ..
mv ../initrd-2.6.20-1.2320.fc5.img ../initrd-2.6.20-1.2320.fc5.img.gz
gunzip ../initrd-2.6.20-1.2320.fc5.img.gz
cpio -i --make-directories < ../initrd-2.6.20-1.2320.fc5.img
vi init
find . -depth | cpio -o > ../initrd-2.6.20-1.2320.fc5.img
cd ..
rm -rf initrd-tmp
gzip -9 initrd-2.6.20-1.2320.fc5.img
mv initrd-2.6.20-1.2320.fc5.img.gz initrd-2.6.20-1.2320.fc5.img
mv initrd-2.6.20-1.2320.fc5.img /boot
grub>
TIPS from people who have a RHCE
"They will asked to upgrade kernel by rpm, remember to use rpm -ivh. Don't want to use -Uvh because then it won't add a new kernel and keep the old one. It will overwrite the old kernel. ""You will be asked to configure squid on the server. And all you have to do with that is edit one file and add a few lines. "
"Samba, mail and security were the other areas you may want to focus on. "
"They give you a choice when setting up security on the server. You can either use TCP Wrappers or iptables. You will be asked to configure wrappers for Samba and Apache. For IPTables just setup the defaults and edit the /etc/sysconfig/iptables file and add your own rules."
USEFUL LINKS
http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/index.htmlhttp://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/Course_Catalog/index.html
https://www.redhat.com/training/rhce/examprep.html
https://www.redhat.com/training/rhce/rhce_faq.html
What needs to be Studied
This section outlines what needs to be studied and can be used as a quick guide to the commands to preform them.- Installation preparation - Creating an NFS server with install files
- System Installation -
- Kickstart Installations
- RAID Disks - Do this at install time. - mdadm
- Logical Volumes - Do this at install time. - vgcreate - lvcreate -
- X windows configuration - system-config-xfree86
- User Accounts - system-config-users
- Package management - rpm
- Network Configuration -
system-config-network or /etc/system/network-config/ifcfg-eth?
- Boot Process - RC and init scripts
- Samba - /etc/smb/smb.conf
- Apache - /etc/apache/config/apache.conf
- Squid Proxy - /etc/squid/squid.conf
- FTP server
- Sendmail - /etc/sendmail.conf
- BIND (DNS) -
- DHCP - /etc/dhcp.conf
- Printers - printtool, printconf-gui
- NIS
- LDAP
- PAM authentication - /etc/pam.d/login
- tcp_wrappers - /etc/hosts.allow /etc/hosts.deny
- xinetd - /etc/xintd - chkconfig --list
- syslog
- NTP
- upgrade the kernel -
- troubleshooting - /var/log/messages - dmsg
Invent a mnemonic to remember this stuff. Something like, my mother thoughtfully made