Wednesday, September 30, 2009

L0phtcrack Provides Industrial Strength Password Auditing

Long, random and frequently changed passwords can help keep your corporate resources secure. Short, guessable ones that never change can not.

That's why it's important for network administrators to be able to audit the user passwords in use on their networks to ensure that they are hard to crack, regularly changed, and never re-used. One tool to help with that is L0phtcrack.

You may well be familiar with tools such as Ophcrack and John the Ripper, which allow administrators to see if a password on a given machine is easily crackable, but few have been designed to allow a network administrator to audit a large number of machines on a network automatically.

Fortunately, L0phtcrack—a very old password auditing tool originally developed by a hacker collective and eventually bought by Symantec—is back on the market and addresses just that problem.

Symantec withdrew the tool in 2005, but recently the company sold L0phtcrack back to the original developers, who have now released L0phtcrack 6 as a commercial product.

L0phtcrack attempts to crack LM and NTLM password hashes from Windows machines, MD5 and DES-encoded password files from  UNIX/Linux machines, and LM and NTLM challenge responses from SMB authentication sessions.

To make it easy for administrators, L0phtcrack can get these directly from other machines on the network remotely. To do this, Linux machines must be running an SSH service and have an administrator level auditing account set up, and Windows machines need to be running the appropriate L0phtcrack remote agent software (either 32-bit or 64-bit) which encrypts the hash data and sends it back to the system running L0phtcrack.

L0phtcrack can also accept hash files acquired in other ways: for example SAM files copied from Windows machines that have been booted into an alternative operating system from a live CD, or acquired using a locally run utility like PWDump, or a remotely run utility like fgdump .

This may be practical in small organizations, but unfeasible where hundred or even thousands of machines need auditing. It can also audit passwords on the machine on which it is running.

Where the network topology is appropriate, L0phtcrack can also sniff network traffic to capture password hashes from SMB authentication sessions.

Audits can be started manually, or can be scheduled to take place on a regular basis. Once L0phtcrack is in possession of groups of password hashes, it subjects them to a number of attacks. After checking that the password is not the same as the username, it carries out:
  • Dictionary attack: a straight forward attack which goes through a word list to find a match. This is very quick and finds simple passwords such as "monkey" or "password". L0phtcrack comes with a reasonable word list, but more comprehensive ones can also be used.
  • Hybrid attack: This is a more sophisticated dictionary attack, carrying out common letter and symbol substitutions such  as 3 for E and $ for S. It can also add symbols or numbers to either the beginning or end of words. This can be useful because many users who are told to make passwords using letters and numbers simply add a digit or two to the end of a guessable word. A hybrid attack would find passwords such as "pa$$word", "h3lp" or "monkey1".
  • Pre-computed attack: this attack makes use of rainbow tables, or sets of pre-computed hashes, for a huge number of passwords. L0phtcrack comes with a utility for generating rainbow tables, which is a lengthy process, or you can download suitable tables from Free Rainbow Tables . Once you have the tables stored on your system hashes can be looked up and if they are present in the rainbow tables each password can be recovered in a few minutes or seconds.
  • Brute force attack: this tries every combination of various sets of characters methodically until a password is found. Passwords made up of letters and numbers could take about a day to crack, while more complex ones with special characters such as #, * and } could take months.

Remediating Problem Passwords

"What we have done is tried to look at what network administrators would want to do if they discover that passwords are easily crackable or have been reused on many different machines," says Chris Wysopal, one of the creators of L0phtcrack.

Once a machine or a group of machines has been audited in L0phtcrack the administrator is presented with a report, and information including the security rating and age of various passwords.

This enables the administrator to very quickly select groups of accounts such as those with weak passwords, ones with passwords that have not been changed within a certain time, or ones which L0phtcrack was able to crack quickly, and either disable those accounts or force the user to change the password at the next login.

L0phtcrack is available in three versions: Pro, Administrator and Consultant. The Pro version is limited to 500 accounts, and does not include rainbow table support.

The Administrator version adds rainbow tables and audit scheduling, and support for an unlimited number of user accounts. The consultant version also allows for unlimited client installation for one year. Pricing is currently $295 for the Pro version, $595 for the Administrator version, and $1195 for the Consultant version.

Is it worth it? The software is certainly fast, and much easier to use than a command line program like John the Ripper.

It also provides far more cracking options than either John or Ophcrack, and its management functions (such as reporting and account disabling) could prove valuable in some organizations.

The main drawback for many potential buyers is that, like John and Ophcrack, the software comes from an unconventional group of coders rather than a large, established security company.

But Wysopal insists that that should not put off potential purchasers. "L0phtcrack has been around for many years and has got a very good reputation. The fact that it comes from us and not Symantec should really not be a problem."

Tuesday, September 29, 2009

How to: Build a Wireless Bridge Using DD-WRT, Part I

Over at Wi-Fi Planet’s monthly Ask the Wi-Fi Guru column, we receive a large helping of reader questions. Over time, some common themes have emerged—problems with wireless signal strength, securing connections, and anything related to the iPhone, for example.

But, even given the intensity of interest in these topics, the single most popular subjects amongst those seeking wireless networking help from Wi-Fi Planet are wireless bridging and wireless repeating.

We published an introductory tutorial on setting up a wireless bridge using the free, open source DD-WRT way back in 2006—which, in Internet years, may as well be 1906. And yet, most of that tutorial is still relevant today and thousands of readers still flock to it every month.

Given the hunger among our readers for more information about DD-WRT and how to create wireless bridges and repeaters with it, we’ve put together this new tutorial series. Consider it “Building a Wireless Bridge, Volume II: Full Throttle.”

Bridge to somewhere

In the real world, a bridge connects two land masses, often separated by water. In wireless networking, a bridge is used to connect two local area networks (or LAN’s) separated by, well, air.

You can think of a wireless router as the center of a single LAN. Every device connected to a single router—whether connected physically by Ethernet cable or wirelessly—is part of the same LAN.

Now suppose you have a device that is not part of the LAN, but you want it to be. The problem is that you don’t have an easy way to connect it.

For example, you might have a printer or a gaming console, such as the Xbox or Wii, which only has a cabled Ethernet connection. If the device is far away or on another floor from your wireless router, running a cable could be complicated.

The solution is a wireless bridge. Using a second wireless router installed with DD-WRT, the router will connect to your primary router and share the network with any connected Ethernet devices (most routers have four built-in Ethernet ports, but you can add one or more external switches with four, eight, or more ports each to expand even further).

In a wireless bridge setup, the devices connected to your secondary router will be part of the same LAN as your primary router, as if every device were connected to your primary router. This means that all machines in the LAN can see each other so that a computer can access a printer or two computers can share files, for example.

Now suppose a different scenario—you want to set up one or more machines with shared Internet access, but you want to “borrow” that Internet access from a primary router, which is elsewhere. In other words, you don’t want to join the primary router’s LAN, you just want to piggyback on its Internet access for a separate LAN.

The solution is a wireless client, which is also a configuration mode in DD-WRT. The principle behind a wireless client is much the same as a wireless bridge, but the wireless client mode creates a second LAN around your secondary router.

This allows you to create separate LANs and firewall traffic from each differently, but devices in one LAN may not be able to see devices in the other.

Most home and small business networks will find the wireless bridge mode more useful than wireless client mode, although for simply extending an Internet connection either mode will work.

The important thing to remember when using either wireless bridge or wireless client modes is that your secondary router is not broadcasting a wireless signal.

In other words, it is receiving a wireless signal from your primary router and sharing that with wired devices. You cannot connect to your secondary router with a Wi-Fi-enabled machine, such as a laptop, printer, or iPod touch.

Repeater repeater

Thanks to DD-WRT, it is possible to create a wireless client or a bridge which also broadcasts a wireless signal. This is called a repeater, and DD-WRT supports two kinds—a wireless repeater and a repeater bridge.

Both modes function like their earlier counterparts. In repeater bridge mode, the secondary router creates a wireless bridge to the primary router, meaning it shares the same LAN.

But in addition to connecting wired devices, it re-broadcasts a wireless signal using a “virtual” radio, allowing both wireless and wired devices to join the primary router’s LAN.

In contrast, wireless repeater mode is akin to wireless client mode, creating a new LAN around the secondary router.

The advantage of repeater mode is obvious: you can effectively extend the range of your primary router’s wireless signal.

But there is also a disadvantage: wireless devices connected to your secondary router will lose half the bandwidth of your LAN.

This means that their network speeds will be slower especially for internal networking, such as file-sharing or streaming media.

Slower wireless speeds from the repeater are a result of how the secondary router must operate: it needs to receive a signal from the primary router and then re-broadcast that signal locally.

But the router has only one radio and so can only do one of these things at a time.

In practice it switches between modes rapidly so that it appears both are happening at once, but in fact by operating in “half-duplex” mode like this, the maximum signal speed is halved. (We will look at one solution in the next installment of this series.)

My ideal operating system

Over the weekend I was running my usual route and doing my usual thinking…about Linux. A strange thought crossed my mind as my music-listening-device (not an iPod thank you very much) jumped from one genre of music to another: What would my ideal operating system consist of?

While running, a lot of possibilities crossed my brain: Which kernel, which desktop, which multi-media system, which printing system…the possibilities went on and on. But one issue that I struggled with was the idea that I wanted to have SOMETHING from the Windows operating system within my “ideal OS.”

With that in mind I sat out to create an OS that included something from all of the MAJOR operating systems. Of course this is just fiction - we all know getting pieces of these OSes to work together just simply won’t ever be done.

Still, you get to see my take on the ideal operating system. Why don’t you chime in and let us know what YOUR ideal operating system would look like.

Kernel: Linux. I have to go this route simply because it’s the only kernel of the major players that can be customized. And, in order for this to be an IDEAL operating system, you can bet this kernel would have to be customized. Naturally the idea here would be to avoid bloat.


HAL: NetBSD. The NetBSD Hardware Abstraction Layer is one of the cleanest, and most portable HALs around.


Network subsystem: Linux. For me this was an obvious choice because of the huge flexibility Linux networking has to offer. And besides, Linux was designed to be online.


Printing subsystem: I have to give this one to Windows. The primary reason for this, and it relates to another category Windows owns, is that so many printers are now all-in-one devices.

Yes Linux can use these devices, but generally speaking, they can only use the printing system. If I have an all-in-one, I want to be able to use all of the features in my hardware. This was a tough one because with the CUPS system you can easily set up a printer server using Linux.


I do not agree with the author at this at all. This is not a Windows lead here at all. What if these manufacturers did not create drivers for Windows like Linux's case?


I thought he would compare the printing subsystem itself not the drivers. CUPS for example is feature-rich one if compared to Windows'.


USB system: This one goes to OS X. For many the USB system just works. But the OS X take on USB is the cleanest and most user-friendly available.

Not quite sure but I am sure that Linux has USB 3.0 before any others.

Hardware recognition: Windows 7. There is very little doubt that Windows offers some of the best hardware recognition out there. And it should, most hardware vendors aren’t smart enough to create os-neutral hardware so they create it for one operating system.

Again I do not agree with him. My experience and most of us do install Windows and afterwards install at least 2 or 3 hardware drivers which means Windows does not detect them automatically. It was very very rare that I have never used drivers available with the hardware.


On the contrary, Linux has never over loaded me with external hardware drivers especially Network and SCSI ones. I do not recall during my past 8 years of working with several hardware vendors with dozens of SCSI/Network controllers that I needed to have external driver. While Windows has never supported any of these SCSI/Network cards out of the box.

Desktop: Remember, this is MY ideal operating system. So I am going with the combination of Enlightenment E17 and Compiz (the one used for Elive+Compiz). It’s a lightweight, fast, user-friendly desktop that has enough eye candy to not only keep up with the Jones’, but (in most cases) blow them away.

Yes I agree with him; E17 is very light and lightening fast. I just would like to add that many people do claim that Windows is a better desktop than Linux. This is true bullshit. It is just a matter of being used to this Windows box no more.


If we are going to compare apple-to-apple then Linux will win with an order of magnitude. Just yourself a chance and try Ubuntu or any other Linux distro and you will realize what I mean. I have been using both for the pas several years at home and at work on my desktop and at the data centre and really productivity with Linux is supperceding Windows one.

Multi-Media system (and subsystems): OS X. I will preface this by saying I am not a fan of the iPod. But that doesn’t take away from the fact that OS X does have an outstanding system for multi-media. It’s a rare occasion you can throw a media file at this OS and not have it played.

VLC on Linux/Windows/MacOSX can do this. I use it to play RMVB files too.


Package management: Without a doubt this one goes to Ubuntu (or any OS that is based on apt/apt-get). The Synaptic application is one of the finest software installation management tools available. It’s simple, reliable, and very user friendly. But I would add, in my “dream os,” that all software vendors would bring their titles to the repositories for my ideal operating system.

Yes 100% and Windows really really sucks at this part.

Security: OpenBSD. Without a doubt, OpenBSD has the best security of any operating system that is actually connected to a network. With only two remote attack vulnerabilities found in the last decade, how can you argue with this choice?

Sunday, September 27, 2009

Installation & Configuration Of Intrusion Detection With Snort, ACIDBASE, MySQL, And Apache2 On Ubuntu 9.04 Using SPM

This tutorial describes how to install and configure Snort intrusion detection system (IDS), ACIDBASE (Basic Analysis and Security Engine), MySQL, and Apache2 on Ubuntu 9.04 using packages from Ubuntu’s Synaptic Package Manager.

Snort will assist you in monitoring your network and alert you about possible threats. Snort will output its log files to a MySQL database which ACIDBASE will use to display in a graphical interface in web browser.

1. System Preparations & Software Installations

1.1 Installation

Download 32bit or 64bit version of Desktop Ubuntu 9.04 from http://www.ubuntu.com/getubuntu/download.

1.2 Network & System Configuration

Connect you computer to the network. Although number of different network configurations will allow system to work, the preferred network configuration would be as follows:
  • Located in DMZ (De-Militarized Zone)
  • Static IP address with NAT hiding its IP behind Firewall
  • Connected to the monitoring port on the switch.
Create new administrator called , with password .

1.3 Software Installation

The first thing to do after installation completes is to it install all updates recommended by Ubuntu. To access updates proceed to System > Administration > Update Manager. Enter your password and select Check. Select Install Updates.
From the Desktop go to System > Administration > Synaptic Package Manager. Enter your password and select Search.
Search for the following packages and install them:
  • Acidbase with all affected packages
  • Snort-MySQL with all affected packages
  • MySql-server-5.0 with all affected packages
  • Libpcap0.8-dev
  • libmysqlclient15-dev
  • MySql-client-5.0
  • Bison
  • Flex
  • Apache2
  • Libapache2-mod-php5
  • Php5-gd
  • Php5-mysql
  • Libphp-adodb
  • Php-pear
  • SSH

2. Gain Root Access

From the Desktop go to Applications > Accessories > Terminal and type:

$ sudo -i
$ Then your password.

3. Configure Snort

Configuration file snort.conf needs to be modified to suit individual needs.
Open /etc/snort/snort.conf with text editor (nano, vi, vim, etc.).

# vim /etc/snort/snort.conf

Change var HOME_NET any to var HOME_NET 192.168.1.0/24 (your home network may differ from 192.168.1.0).

In case you have more than one network to monitor you should enter them as follows var HOME_NET [192.168.1.0/24,10.10.1.0/24].

Change var EXTERNAL_NET any to var EXTERNAL_NET !$HOME_NET (this is stating everything except HOME_NET is external).




Change var RULE_PATH ../rules to var RULE_PATH /etc/snort/rules.

Scroll down the list to the section with # output database: log, mysql, user=, remove the # from in front of this line. Example: output database: log, mysql, user= password= dbname=snort host=localhost (see above when new user was created).

Make note of the username, password, and dbname. You will need this information when we set up the MySQL db.

Save and quit.

4. Setup the snort and archive MySQL databases
4.1 MySQL setup


Log into the MySQL server.
# mysql -u root -p
Sometimes there is no password set so just hit enter.
If you get a failed logon, try the above command again and enter YOUR_PASSWORD.
If there is no password you need to create a password for the root account.
Note: Once you are in MySQL the # is now a mysql>
mysql> create user @localhost;
mysql> SET PASSWORD FOR r@localhost=PASSWORD(‘’);
mysql> SET PASSWORD FOR root@localhost=PASSWORD(‘);


4.2 Create Snort database

mysql> create database snort;
mysql> grant INSERT,SELECT on root.* to snort@localhost;
mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to @localhost;
mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort;


4.3 Create Archive database

mysql> create database archive;
mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on archive.* to @localhost;
mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on archive.* to archive;
mysql> exit


4.4 Create Tables in Snort and Archive databases

We will use the snort schema for the layout of snort and archive databases.
# cd /usr/share/doc/snort-mysql
# zcat create_mysql.gz | mysql –u –h localhost –p snort
# zcat create_mysql.gz | mysql –u –h localhost –p archive


4.5 Confirm creation of databases and existence of newly created tables

Logon to MySQL and check for databases we just created and tables inside of those databases. If everything was created successful you will see four (4) databases (mysql, test, snort and archive) in mysql databases and approximately 16 tables in each of the databases.
# mysql -u root –p
mysql> show databases;
mysql> use snort;
mysql> show tables;
mysql> use archive;
mysql> show tables;
mysql> exit

4.6 Test Snort

In the terminal type:
# snort -c /etc/snort/snort.conf
If everything went well you should see an ascii pig.
To end the test hit ctrl + c.

5. Apache2 Configuration

Apache2 has already been installed on the computer.
Create a file called test.php in /var/www/ with your favorite text editor.

# vim /var/www/test.php

Write in it:

Save and close this file.
Edit /etc/php5/apache2/php.ini file.

# vim /etc/php5/apache2/php.ini

Add the following under "Dynamic Extensions".
extension=mysql.so
extension=gd.so

Restart Apache2.

# /etc/init.d/apache2 restart

Get the IP address of the machine you are working on.

# ifconfig -a

Open a web browser and go to http://YOUR.IP.ADDRESS/test.php.
If everything went well, you will have PHP information displayed.

6. Moving and setting up Folders

Move ADOdb into the /var/www directory.

# mv /usr/share/php/adodb /var/www/

Make a directory called web in www and move ACIDBASE.

# mkdir /var/www/web
# mv /usr/share/acidbase /var/www/web/

Temporarily enable writing to the acidbase folder for setup.

# chmod 777 /var/www/web/acidbase

Rename existing base_conf.php file to base_conf.old.

# cd /var/www/web/acidbase
# mv base_conf.php base_conf.old

Install pear extensions for graphs to work in ACIDBASE.

# pear install Image_Color

7. ACIDBASE Setup for Snort and Archive Databases

7.1 Setup Snort database via web browser

Open a web browser and navigate to http://YOUR.IP.ADDRESS/web/acidbase/setup. Click to continue on the first page.

Step 1 of 5: Enter the path to ADODB.
This is /var/www/adodb.

Step 2 of 5:
Main Database type = MySQL, Database name = snort, Database Host = localhost, Database username = , Database Password = , Archive Database type = MySQL, Database name = archive, Database Host = localhost, Database username = , Database Password =
Step 3 of 5: If you want to use authentication enter a username and password here (user: , password: ). Step 4 of 5: Click on Create BASE AG.
Step 5 of 5: Once step 4 is done at the bottom click on Now continue to step 5.
Bookmark this page.

7.2 Create folder for ACIDBASE Archive database

In order for archive database to work an archive folder needs to be created within ACIDBASE folder.

# mkdir /var/www/web/acidbase/archive
# cd /var/www/web/acidbase
# cp –R * /var/www/web/acidbase/archive
# chmod 777 /var/www/web/acidbase/archive

Rename existing base_conf.php file to base_conf.old.

# cd /var/www/web/acidbase/archive
# mv base_conf.php base_conf.old

7.3 Setup Archive database via web browser

Open a web browser and navigate to http://YOUR.IP.ADDRESS/web/acidbase/archive/setup.
Click continue on the first page.

Step 1 of 5: Enter the path to ADODB.
This is /var/www/adodb.

Step 2 of 5:
Archive Database type = MySQL, Database name = archive, Database Host = localhost, Database username = , Database Password =

Step 3 of 5:
If you want to use authentication enter a username and password here (user: , password: ).

Step 4 of 5:
Click on Create BASE AG.

Step 5 of 5:
Once step 4 is done at the bottom click on Now continue to step 5.

8. Start Snort and check services status

To start Snort in the terminal type:

# snort -c /etc/snort/snort.conf -i eth0 -D

This starts snort using eth0 interface in a daemon mode.
To make sure it is running you can check with the following command:

# ps aux | grep snort

If it's running you will see an entry similar to snort -c /etc/snort/snort.conf -i eth0 -D.
Make sure that all necessary services are running with the following command:

# /etc/init.d/mysql status
# /etc/init.d/apache2 status
# /etc/init.d/snort status

If they are running you will see output .
If necessary run

# /etc/init.d/ restart

command for each of the services that need a restart.

Friday, September 25, 2009

Jobs Sites


http://www.itbusinessedge.com/slideshows/show.aspx?c=88163

Job Serve

One of the best recruitment sites

JOBS in EGYPT

Jobs in Egypt Egyptian Employment Recruitment Find Job in Egypt, Egypt Jobs Career Egypt Egypt Work Egyptians Careers Post Jobs Resumes Job Seekers Employers Companies Recruiters
www.jobsinegypt.com/Job/ind...

Jobs In Egypt, the free recruitment board

Jobs in Egypt: The absolutely free recruitment site. Job seeker: Post you CV for free. Employer: post new Jobs and browse CV's for free. No hidden charge
www.jobs-in-egypt.net

Egypt Jobs in Egypt Job Search.

Jobs.com - Egypt Jobs - powered by Monster ... Looking to hire employees? Post a job and recruit the most qualified candidates today.
www.egypt.jobs.com

Jobs in Egypt, Cairo | Egypt Job Search | Bayt.com

Find jobs in Egypt, Cairo, and Alexandria. Search for jobs in Cairo at Bayt.com, the Middle East's #1 job site. List of online jobs in Egypt.
www.bayt.com/job/jobs-in-egypt

Jobs in Egypt: Career and Employment Opportunities in Egypt and Dubai

Career and employment opportunities in Egypt, Dubai, Iraq, Saudi Arabia, Kuwait, Sharm, Jobs in Egypt, recruitment, career and employment opportunities in Cairo, Hurghada, Lebanon ...
jobsinegypt.el-shella.com

Job 4 All - Jobs in Egypt - Work in Egypt - Egyptian Recruitment ...

Job4all helps jobseekers to find the best jobs in Egypt, Job4all will provide both seekers and recruiters with a professional and easy-to-use online service.
job4all-eg.com

Job In Egypt

Last Vacancies HR Specialists (+2 years) - ãÓÆæá ãÈíÚÇÊ ÞØÇÚ ÇáãØÇÚã æÇáÓæÈÑ ãÇÑßÊ
jobinegypt.com

Find Job or Careers in Egypt وظيفه في مصر- Mowazaf

Searching for job in Egypt or careers in Egypt, Mowazaf will assist you to achieve your goal
mowazaf.com

Employment sites in Egypt > Jobs in Egypt

International directory of top selected Egyptian employment and job sites. Starting point to search for jobs in Egypt and throughout the world.
www.4icj.com/eg

Welcome to JobAlert Web Site

At JOBALERT Recruitment & HR Consulting, we understand that finding and placing top quality and professional staff members with our clients is integral ...

مجموعة إدارة الموارد البشرية
رقم الموقع 6296 - الزيارات 567 - التقييم : 0 - الأصوات : 0
مختص في علوم إدارة وتنمية الموارد البشرية وتوفير فرص العمل




» وظائف في دبي و دول الخليج
رقم الموقع 6061 - الزيارات 1800 - التقييم : 66 - الأصوات : 26
وظائف في دبي و دول الخليج ,أكثر من 40000 وظيفة في دبي و دول الخليج بدون تسجيل




» شركة أنترناشيونال كونتركت لتوظيف العمالة المصرية بالخارج
رقم الموقع 5931 - الزيارات 551 - التقييم : 2 - الأصوات : 2
شركة أنترناشيونال كونتركت لتوظيف العمالة المصرية بالخارج ,نحن شركة توظيف مصرية مهمتنا أيجاد فرص العمل للراغبين في العمل بالدول العربية الشقيقة




» www.mihneti.com
رقم الموقع 5728 - الزيارات 208 - التقييم : 0 - الأصوات : 0
Mihneti.com is a leading recruiting portal specializing in providing an online interaction environment to connect employers and employees. The prevalence of online recruitment shows that there is little competitive edge in having a job site unless it offers a fast, candidate-friendly and engaging job hunting experience. Our goal is to make finding your next job a simple yet effective, enjoyable




» JobsEyes
رقم الموقع 3988 - الزيارات 300 - التقييم : 2 - الأصوات : 2
JobsEyes




» شركة معلوماتي
رقم الموقع 3891 - الزيارات 941 - التقييم : 15 - الأصوات : 9
شركة متخصصة في التوظيف والتدريب وتطوير الذات




» Moroccan Recruitment Agency
رقم الموقع 3840 - الزيارات 231 - التقييم : 0 - الأصوات : 0
HR Connect is a Moroccan Recruitment, Employment, Staffing, Manpower, placement & Job Agency based in Casablanca- Morocco. Hassan Ait Ali +212 63 73 76 83
وظائف
رقم الموقع 2875 - الزيارات 1425 - التقييم : 1 - الأصوات : 1
موقع وظائف الشرق الاوسط




» وظائف في مصر مجانيه
رقم الموقع 2735 - الزيارات 3443 - التقييم : 129 - الأصوات : 30
موقع متخصص في الوظائف المصريه يقدم وظائف مصريه يوميه حقيقيه مجانيه للباحثين عن عمل والموظفين والشركات والباحثين عن موظفين ومراكز التدريب التسجيل مجانا
VICService
رقم الموقع 774 - الزيارات 572 - التقييم : 0 - الأصوات : 0
موقع يقدم وظائف للافراد والشركات






http://groups.google.com/group/yallawork




أود أن أوصي بإضافة موقع 
www.almehan.com 


Almehan.com هو محرك للبحث عن وظيفة في السعودية(عربي) .في بحث واحد بسيط، يعطي الباحثين عن العمل مجموعة كبيرة من الوظائف التي مصدرها مواقع الانترنت المختلفة، دون الحاجة إلى زيارة كل موقع على حدى. 

Have a look at this too:

100 طريقة لكسب قلوب الناس


بقلم : د. محمد العريفي

كل صاحب هم يتفنن في صيد ما يريد ..
عاشق المال يتفنن في جمعه وتنميته .. ويحرص على تعلم مهارات التجارة والربح ..
القنوات الفضائية تتفنن في اصطياد الناس بتنويع البرامج واختيار الأساليب المتجددة ..
 وتدريب مقدمي البرامج على مهارات تجذب الناس لمتابعتها ..
وقل مثل ذلك في وسائل الإعلام المقروءة .. والمسموعة ..
ومثله مروجو البضائع المختلفة سواء كانت حلالاً أم حراماً ..
كلهم يحرصون على إتقان المهارات التي تفيدهم في مجالهم الذي يحبونه ..
وكسب القلوب فن من الفنون له طرقه وأساليبه ..

هب أنك دخلت مجلساً فيه أربعون رجلاً..
فمررت بالناس تصافحهم ..
فالأول مددت يدك إليه مسلماً فناولك طرف يده .. وقال ببرود : أهلاً .. أهلاً ..
والثاني كان مشغولاً بحديث جانبي .. ففاجأته بالسلام .. فرد ببرود أيضاً وصافحك دون أن ينظر إليك ..
والثالث كان يتحدث بهاتفه .. فمد يده إليك دون أن يتلفظ بكلمة ترحيب .. أو يبدي لك أي اهتمام ..
أما الرابع .. فلما رآك مقبلاً قام مستعداً للسلام .. فلما التقت عينك بعينه ابتسم وأظهر البشاشة بلقياك ..
وصافحك بحرارة .. واحتفى بقدومك .. وأنت لا تعرفه ولا يعرفك !!
ثم أكملت سلامك على الناس .. وجلست ..

  بالله عليك ! ألا تشعر أن قلبك ينجذب نحو ذلك الشخص ؟

بلى .. ينجذب إليه .. وأنت لا تعرفه .. ولا تدري عن اسمه .. ولا تعلم وظيفته ولا مركزه .. ومع ذلك استطاع أن يسلب قلبك ..
 لا بماله .. ولا بمنصبه .. ولا بحسبه ونسبه .. وإنما بمهارات تعامله ..
إذن القلوب لا تكسب بالقوة ولا بالمال ولا بالجمال ولا بالوظيفة .. وإنما تكسب بأقل من ذلك وأسهل ..
 ومع ذلك فقليل من يستطيع كسبها ..
أذكر أن أحد طلابي في الكلية أصيب بمرض نفسي .. كان نوعاً صعباً من الاكتئاب ..
كان والده ضابطاً يشغل منصباً عالياً .. جاء مراراً إلى الكلية وقابلني وتعاونّا على علاج ابنه ..
كنت أذهب إلى بيتهم أحياناً فأراه قصراً منيفاً .. وأرى مجلس الأب مليئاً بالضيوف .. لا تكاد تجد فيه مكاناً فارغاً ...
كنت أعجب من محبة الناس لهذا الرجل وإقبالهم عليه..
مضت سنوات وتقاعد الأب من منصبه ..
فذهبت إليه زائراً .. دخلت القصر .. ثم دلفت إلى المجلس وفيه أكثر من خمسين كرسياً ..
فلم أر في المجلس إلا الرجل يتابع برنامجاً في التلفاز .. وخادماً يخدمه بالقهوة والشاي .. جلست معه قليلاً ..
فلما خرجت جعلت أتذكر حاله لما كان في وظيفته .. وحاله الآن .. ما الذي كان يجمع الناس فيما مضى ؟
ما الذي كان يجعلهم يلتمون عليه مؤانسين متحببين ؟!
أدركت عندها أن الرجل لم يكسب الناس بأخلاقه ولطفه وحسن تعامله .. وإنما كسبهم بمنصبه ووجاهته وسعة علاقاته ..
فلما زال المنصب زالت معه المحبة ..


فخذ من صاحبنا درساً .. وتعامل مع الناس بمهارات تجعلهم يحبونك لشخصك ..
يحبون أحاديثك وابتسامتك ورفقك وحسن معشرك .. يحبون تغاضيك عن أخطائهم ..
 ووقوفك معهم في مصائبهم ..
 لا تجعل قلوبهم معلقة بكرسيك وجيبك !!

الذي يوفر لأولاده وزوجته المال والطعام والشراب لم يكسب قلوبهم .. وإنما كسب بطونهم ...
والذي يغدق على أهله الأموال .. مع سوء التعامل .. لم يكسب قلوبهم .. إنما كسب جيوبهم ..
لذلك لا تستغرب إذا وجدت شاباً تقع له مشكلة فيشكوها إلى صديق أو إمام مسجد أو مدرس .. ويترك أباه ..
لأن الأب لم يكسب قلبه .. ولم يحطم الأسوار بينهما .. بينما كسب هذا القلب مدرسا و صديق .. وربما كسبه عدو حاقد !!
وأمر آخر مهم ..

ألا تلاحظ معي أن بعض الناس إذا دخل مجلساً مزدحماً ... وجعل يتلفت باحثاً عن مكان يجلس فيه ..
 رأيت الجالسين يتسابقون عليه كل يناديه ليجلس بجانبه !.. لماذا؟
  
هل دعيت يوماً إلى عشاء ... وكان بنظام ( البوفيه المفتوح ) .. بحيث إن كل شخص يأخذ طعامه في طبق ويجلس على إحدى الطاولات الدائرية .. ألم تر بعض الناس ما إن يملأ طبقه بالطعام حتى يتهافت عدد من الناس يشيرون إليه بوجود مكان فارغ .. ليجلس معهم ..
بينما آخر يملأ طبقه بالطعام .. ويتلفت ولا أحد يناديه أو يقبل عليه .. حتى تسوقه قدماه إلى إحدى الطاولات ..
لماذا حرص الناس على الأول دون الثاني ..
ألا تشعر أن بعض الناس تقبل عليه القلوب أينما كان .. وكأن في يده مغناطيس يجذبها به جذباً !!
عجباً ! كيف استطاع هؤلاء جميعا كسب الناس ؟!
إنها طرق ذكية يستطيع بها الشخص أن يصيد بها القلوب...

  قدرتنا على أسر قلوب الآخرين .. وكسب محبتهم الصادقة .. تمنحنا جانباً كبيراً من المتعة بالحياة
  _______________
من كتاب "استمتع بحياتك"
د. محمد العريفي

How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (CentOS 5.3)

This guide explains how to set up software RAID1 on an already running CentOS 5.3 system. The GRUB bootloader will be configured in such a way that the system will still be able to boot if one of the hard drives fails (no matter which one).

I do not issue any guarantee that this will work for you!

1 Preliminary Note
In this tutorial I'm using a CentOS 5.3 system with two hard drives, /dev/sda and /dev/sdb which are identical in size. /dev/sdb is currently unused, and /dev/sda has the following partitions:
  • /dev/sda1: /boot partition, ext3;
  • /dev/sda2: swap;
  • /dev/sda3: / partition, ext3
In the end I want to have the following situation:
  • /dev/md0 (made up of /dev/sda1 and /dev/sdb1): /boot partition, ext3;
  • /dev/md1 (made up of /dev/sda2 and /dev/sdb2): swap;
  • /dev/md2 (made up of /dev/sda3 and /dev/sdb3): / partition, ext3
This is the current situation:

[root@server1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             9.1G  1.1G  7.6G  12% /
/dev/sda1             190M   12M  169M   7% /boot
tmpfs                 252M     0  252M   0% /dev/shm


[root@server1 ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26          90      522112+  82  Linux swap / Solaris
/dev/sda3              91        1305     9759487+  83  Linux

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
[root@server1 ~]#

2 Installing mdadm

The most important tool for setting up RAID is mdadm. Let's install it like this:

# yum install mkinitrd mdadm

Afterwards, we load a few kernel modules (to avoid a reboot):

# modprobe linear
# modprobe multipath
# modprobe raid0
# modprobe raid1
# modprobe raid5
# modprobe raid6
# modprobe raid10

Now run
# cat /proc/mdstat

The output should look as follows:
[root@server1 ~]# cat /proc/mdstat


Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices:


[root@server1 ~]#

3 Preparing /dev/sdb

To create a RAID1 array on our already running system, we must prepare the /dev/sdb hard drive for RAID1, then copy the contents of our /dev/sda hard drive to it, and finally add /dev/sda to the RAID1 array.

First, we copy the partition table from /dev/sda to /dev/sdb so that both disks have exactly the same layout:
sfdisk -d /dev/sda | sfdisk /dev/sdb

The output should be as follows:

[root@server1 ~]# sfdisk -d /dev/sda | sfdisk /dev/sdb


Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 1305 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type


Old situation:
No partitions found


New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1   *        63    401624     401562  83  Linux
/dev/sdb2        401625   1445849    1044225  82  Linux swap / Solaris
/dev/sdb3       1445850  20964824   19518975  83  Linux
/dev/sdb4             0         -          0   0  Empty


Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1


(See fdisk(8).)


[root@server1 ~]#

The command fdisk -l should now show that both HDDs have the same layout:

[root@server1 ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26          90      522112+  82  Linux swap / Solaris
/dev/sda3              91        1305     9759487+  83  Linux

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          25      200781   83  Linux
/dev/sdb2              26          90      522112+  82  Linux swap / Solaris
/dev/sdb3              91        1305     9759487+  83  Linux


[root@server1 ~]#

Next we must change the partition type of our three partitions on /dev/sdb to Linux raid autodetect:

[root@server1 ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:


1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)


Command (m for help):
 <-- m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help):
 <-- t
Partition number (1-4): <-- 1
Hex code (type L to list codes): <-- L

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       bf  Solaris
 1  FAT12           24  NEC DOS         81  Minix / old Lin c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          82  Linux swap / So c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c7  Syrinx
 5  Extended        41  PPC PReP Boot   85  Linux extended  da  Non-FS data
 6  FAT16           42  SFS             86  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
Hex code (type L to list codes):
 <-- fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help):
 <-- t
Partition number (1-4): <-- 2
Hex code (type L to list codes): <-- fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help):
 <-- t
Partition number (1-4): <-- 3
Hex code (type L to list codes): <-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help):
 <-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[root@server1 ~]#


To make sure that there are no remains from previous RAID installations on /dev/sdb, we run the following commands:

# mdadm --zero-superblock /dev/sdb1
# mdadm --zero-superblock /dev/sdb2
# mdadm --zero-superblock /dev/sdb3

If there are no remains from previous RAID installations, each of the above commands will throw an error like this one (which is nothing to worry about):

[root@server1 ~]# mdadm --zero-superblock /dev/sdb1
mdadm: Unrecognised md component device - /dev/sdb1


[root@server1 ~]#
Otherwise the commands will not display anything at all.


4 Creating Our RAID Arrays

Now let's create our RAID arrays /dev/md0, /dev/md1, and /dev/md2. /dev/sdb1 will be added to /dev/md0, /dev/sdb2 to /dev/md1, and /dev/sdb3 to /dev/md2. /dev/sda1, /dev/sda2, and /dev/sda3 can't be added right now (because the system is currently running on them), therefore we use the placeholder missing in the following three commands:

# mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1
# mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb2
# mdadm --create /dev/md2 --level=1 --raid-disks=2 missing /dev/sdb3

The command cat /proc/mdstat should now show that you have three degraded RAID arrays ([_U] or [U_] means that an array is degraded while [UU] means that the array is ok):

[root@server1 ~]# cat /proc/mdstat


Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sdb3[1]
      9759360 blocks [2/1] [_U]

md1 : active raid1 sdb2[1]
      522048 blocks [2/1] [_U]

md0 : active raid1 sdb1[1]
      200704 blocks [2/1] [_U]

unused devices: 


[root@server1 ~]#

Next we create filesystems on our RAID arrays (ext3 on /dev/md0 and /dev/md2 and swap on /dev/md1):

# mkfs.ext3 /dev/md0
# mkswap /dev/md1
# mkfs.ext3 /dev/md2

Next we create /etc/mdadm.conf as follows:

# mdadm --examine --scan > /etc/mdadm.conf

Display the contents of the file:

# cat /etc/mdadm.conf

In the file you should now see details about our three (degraded) RAID arrays:

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=78d582f0:940fabb5:f1c1092a:04a55452
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=8db8f7e1:f2a64674:d22afece:4a539aa7
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=1baf282d:17c58efd:a8de6947:b0af9792

5 Adjusting The System To RAID1

Now let's mount /dev/md0 and /dev/md2 (we don't need to mount the swap array /dev/md1):

# mkdir /mnt/md0
# mkdir /mnt/md2
# mount /dev/md0 /mnt/md0
# mount /dev/md2 /mnt/md2

You should now find both arrays in the output of mount

[root@server1 ~]# mount


/dev/sda3 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/md0 on /mnt/md0 type ext3 (rw)
/dev/md2 on /mnt/md2 type ext3 (rw)


[root@server1 ~]#

Next we modify /etc/fstab. Replace LABEL=/boot with /dev/md0, LABEL=SWAP-sda2 with /dev/md1, and LABEL=/ with /dev/md2 so that the file looks as follows:

vi /etc/fstab
/dev/md2                 /                       ext3    defaults        1 1
/dev/md0             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/md1         swap                    swap    defaults        0 0
Next replace /dev/sda1 with /dev/md0 and /dev/sda3 with /dev/md2 in /etc/mtab:
vi /etc/mtab
/dev/md2 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/md0 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
Now up to the GRUB boot loader. Open /boot/grub/menu.lst and add fallback=1 right after default=0:
vi /boot/grub/menu.lst
[...]
default=0
fallback=1
[...]
This makes that if the first kernel (counting starts with 0, so the first kernel is 0) fails to boot, kernel #2 will be booted.
In the same file, go to the bottom where you should find some kernel stanzas. Copy the first of them and paste the stanza before the first existing stanza; replace root=LABEL=/ with root=/dev/md2 and root (hd0,0) with root (hd1,0):
[...]
title CentOS (2.6.18-128.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/md2
        initrd /initrd-2.6.18-128.el5.img

title CentOS (2.6.18-128.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/
        initrd /initrd-2.6.18-128.el5.img
The whole file should look something like this:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
fallback=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/md2
        initrd /initrd-2.6.18-128.el5.img

title CentOS (2.6.18-128.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/
        initrd /initrd-2.6.18-128.el5.img
root (hd1,0) refers to /dev/sdb which is already part of our RAID arrays. We will reboot the system in a few moments; the system will then try to boot from our (still degraded) RAID arrays; if it fails, it will boot from /dev/sda (-> fallback 1).
Next we adjust our ramdisk to the new situation:
mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img_orig
mkinitrd /boot/initrd-`uname -r`.img `uname -r`
Now we copy the contents of /dev/sda1 and /dev/sda3 to /dev/md0 and /dev/md2 (which are mounted on /mnt/md0 and /mnt/md2):
cp -dpRx / /mnt/md2
cd /boot
cp -dpRx . /mnt/md0

6 Preparing GRUB (Part 1)

Afterwards we must install the GRUB bootloader on the second hard drive /dev/sdb:
grub
On the GRUB shell, type in the following commands:
root (hd0,0)
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub>
setup (hd0)
grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.

grub>
root (hd1,0)
grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0xfd

grub>
setup (hd1)
grub> setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... yes
 Checking if "/grub/stage2" exists... yes
 Checking if "/grub/e2fs_stage1_5" exists... yes
 Running "embed /grub/e2fs_stage1_5 (hd1)"...  15 sectors are embedded.
succeeded
 Running "install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.

grub>
quit
Now, back on the normal shell, we reboot the system and hope that it boots ok from our RAID arrays:
reboot


7 Preparing /dev/sda

If all goes well, you should now find /dev/md0 and /dev/md2 in the output of
df -h
[root@server1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md2              9.2G  1.1G  7.7G  12% /
/dev/md0              190M   14M  167M   8% /boot
tmpfs                 252M     0  252M   0% /dev/shm
[root@server1 ~]#
The output of
cat /proc/mdstat
should be as follows:
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1]
      200704 blocks [2/1] [_U]

md1 : active raid1 sdb2[1]
      522048 blocks [2/1] [_U]

md2 : active raid1 sdb3[1]
      9759360 blocks [2/1] [_U]

unused devices: 
[root@server1 ~]#

Now we must change the partition types of our three partitions on /dev/sda to Linux raid autodetect as well:
fdisk /dev/sda
[root@server1 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):
 <-- t
Partition number (1-4): <-- 1
Hex code (type L to list codes): <-- fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): 
<-- t
Partition number (1-4): <-- 2
Hex code (type L to list codes): <-- fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help):
 <-- t
Partition number (1-4): <-- 3
Hex code (type L to list codes): <-- fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help):
 <-- w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@server1 ~]#

Now we can add /dev/sda1, /dev/sda2, and /dev/sda3 to the respective RAID arrays:
mdadm --add /dev/md0 /dev/sda1
mdadm --add /dev/md1 /dev/sda2
mdadm --add /dev/md2 /dev/sda3
Now take a look at
cat /proc/mdstat
... and you should see that the RAID arrays are being synchronized:
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
      200704 blocks [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      522048 blocks [2/2] [UU]

md2 : active raid1 sda3[2] sdb3[1]
      9759360 blocks [2/1] [_U]
      [====>................]  recovery = 22.8% (2232576/9759360) finish=2.4min speed=50816K/sec

unused devices: 
[root@server1 ~]#

(You can run
watch cat /proc/mdstat
to get an ongoing output of the process. To leave watch, press CTRL+C.)
Wait until the synchronization has finished (the output should then look like this:
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0] sdb1[1]
      200704 blocks [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
      522048 blocks [2/2] [UU]

md2 : active raid1 sda3[0] sdb3[1]
      9759360 blocks [2/2] [UU]

unused devices: 
[root@server1 ~]#

).
Then adjust /etc/mdadm.conf to the new situation:
mdadm --examine --scan > /etc/mdadm.conf
/etc/mdadm.conf should now look something like this:
cat /etc/mdadm.conf
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=78d582f0:940fabb5:f1c1092a:04a55452
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=8db8f7e1:f2a64674:d22afece:4a539aa7
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=1baf282d:17c58efd:a8de6947:b0af9792

8 Preparing GRUB (Part 2)

We are almost done now. Now we must modify /boot/grub/menu.lst again. Right now it is configured to boot from /dev/sdb (hd1,0). Of course, we still want the system to be able to boot in case /dev/sdb fails. Therefore we copy the first kernel stanza (which contains hd1), paste it below and replace hd1 with hd0. Furthermore we comment out all other kernel stanzas so that it looks as follows:
vi /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
fallback=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/md2
        initrd /initrd-2.6.18-128.el5.img

title CentOS (2.6.18-128.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/md2
        initrd /initrd-2.6.18-128.el5.img

#title CentOS (2.6.18-128.el5)
#       root (hd0,0)
#       kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/
#       initrd /initrd-2.6.18-128.el5.img
Afterwards, update your ramdisk:
mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img_orig2
mkinitrd /boot/initrd-`uname -r`.img `uname -r`
... and reboot the system:
reboot
It should boot without problems.
That's it - you've successfully set up software RAID1 on your running CentOS 5.3 system!


9 Testing

Now let's simulate a hard drive failure. It doesn't matter if you select /dev/sda or /dev/sdb here. In this example I assume that /dev/sdb has failed.
To simulate the hard drive failure, you can either shut down the system and remove /dev/sdb from the system, or you (soft-)remove it like this:
mdadm --manage /dev/md0 --fail /dev/sdb1
mdadm --manage /dev/md1 --fail /dev/sdb2
mdadm --manage /dev/md2 --fail /dev/sdb3
mdadm --manage /dev/md0 --remove /dev/sdb1
mdadm --manage /dev/md1 --remove /dev/sdb2
mdadm --manage /dev/md2 --remove /dev/sdb3
Shut down the system:
shutdown -h now
Then put in a new /dev/sdb drive (if you simulate a failure of /dev/sda, you should now put /dev/sdb in /dev/sda's place and connect the new HDD as /dev/sdb!) and boot the system. It should still start without problems.
Now run
cat /proc/mdstat
and you should see that we have a degraded array:
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda1[0]
      200704 blocks [2/1] [U_]

md1 : active raid1 sda2[0]
      522048 blocks [2/1] [U_]

md2 : active raid1 sda3[0]
      9759360 blocks [2/1] [U_]

unused devices: 
[root@server1 ~]#

The output of
fdisk -l
should look as follows:
[root@server1 ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          25      200781   fd  Linux raid autodetect
/dev/sda2              26          90      522112+  fd  Linux raid autodetect
/dev/sda3              91        1305     9759487+  fd  Linux raid autodetect

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/md2: 9993 MB, 9993584640 bytes
2 heads, 4 sectors/track, 2439840 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md1: 534 MB, 534577152 bytes
2 heads, 4 sectors/track, 130512 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md0: 205 MB, 205520896 bytes
2 heads, 4 sectors/track, 50176 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table
[root@server1 ~]#

Now we copy the partition table of /dev/sda to /dev/sdb:

# sfdisk -d /dev/sda | sfdisk /dev/sdb

(If you get an error, you can try the --force option:)

# sfdisk -d /dev/sda | sfdisk --force /dev/sdb

[root@server1 ~]# sfdisk -d /dev/sda | sfdisk /dev/sdb


Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 1305 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition table type


Old situation:
No partitions found


New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1   *        63    401624     401562  fd  Linux raid autodetect
/dev/sdb2        401625   1445849    1044225  fd  Linux raid autodetect
/dev/sdb3       1445850  20964824   19518975  fd  Linux raid autodetect
/dev/sdb4             0         -          0   0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)


[root@server1 ~]#

Afterwards we remove any remains of a previous RAID array from /dev/sdb...

# mdadm --zero-superblock /dev/sdb1
# mdadm --zero-superblock /dev/sdb2
# mdadm --zero-superblock /dev/sdb3
... and add /dev/sdb to the RAID array:
# mdadm -a /dev/md0 /dev/sdb1
# mdadm -a /dev/md1 /dev/sdb2
# mdadm -a /dev/md2 /dev/sdb3

Now take a look at
cat /proc/mdstat
[root@server1 ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      200704 blocks [2/2] [UU]

md1 : active raid1 sdb2[1] sda2[0]
      522048 blocks [2/2] [UU]

md2 : active raid1 sdb3[2] sda3[0]
      9759360 blocks [2/1] [U_]
      [=======>.............]  recovery = 39.4% (3846400/9759360) finish=1.7min speed=55890K/sec

unused devices: 


[root@server1 ~]#

Wait until the synchronization has finished:

[root@server1 ~]# cat /proc/mdstat


Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      200704 blocks [2/2] [UU]

md1 : active raid1 sdb2[1] sda2[0]
      522048 blocks [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
      9759360 blocks [2/2] [UU]

unused devices: 
[root@server1 ~]#


Then run

# grub

and install the bootloader on both HDDs:

root (hd0,0)
setup (hd0)
root (hd1,0)
setup (hd1)
quit

That's it. You've just replaced a failed hard drive in your RAID1 array.

10 Links