Posts Tagged ‘mirroring’

Linux Howtos – Raid1 Setup On CentOS5

February 26th, 2011

 

Setup Raid1 on Already Installed System

 

 

This Howto covers Raid1 setup on preinstalled Centos 5.5 system. Raid array will have 2 disks.

 

Lets get some info about current partitions:

# 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 13 104391 83 Linux
/dev/sda2 14 1305 10377990 8e Linux LVM

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

 

# cat /etc/fstab

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
/dev/sda1 /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/VolGroup00/LogVol01 swap swap defaults 0 0

 

There were 2 partitions, sda1 with /boot and sda2 with LVM.
LVM partition had / and swap part.

Now we need to start system in rescue mode. Reboot and set in BIOS boot priority. Insert CentOS install cd, save changes in BIOS and reboot again. When it boots up type:


boot: linux rescue

Choose language
Choose keyboard type
Choose NO in network interfaces menu
Choose SKIP mounting current system in rescue screen menu

You entered rescue mode. This mode is also very useful for fixing critical system problems.

Load a few kernel modules (to avoid a reboot):

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

# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices:

Copy partition structure from old system disk to new disk:

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

We need to change partition type to raid for both partitions:

# fdisk /dev/sdb

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): <-- w The partition table has been altered!

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

Create RAID arrays:

# mdadm –create /dev/md0 –level=1 –raid-disks=2 missing /dev/sdb1
mdadm: array /dev/md0 started.

# mdadm –create /dev/md1 –level=1 –raid-disks=2 missing /dev/sdb2
mdadm: array /dev/md1 started.

Create filesystems on these arrays. First for /boot partition:

# mkfs.ext3 -L ‘/boot’ /dev/md0

Then for / and swap in LVM partition:

# lvm pvcreate /dev/md1

# lvm vgcreate RaidArray /dev/md1

# lvm lvcreate –size 1G –name swap RaidArray

# lvm vgdisplay RaidArray

Look for “Free PE / Size” record (in this case it was):
Free PE / Size 2277 / 8.89GB

# lvm lvcreate –size 8.89G –name Root RaidArray

# mkswap /dev/RaidArray/swap

# mkfs.ext3 -L ‘/’ /dev/RaidArray/Root

Copy content of each old partition to equivalent raid partition:

# mkdir /mnt/boot.old
# mount -o ro /dev/sda1 /mnt/boot.old

# mkdir /mnt/boot.new
# mount /dev/md0 /mnt/boot.new

We need to activate LVM:

# lvm vgchange –available y VolGroup00

# mkdir /mnt/root.old
# mount -o ro /dev/VolGroup00/LogVol00 /mnt/root.old

# mkdir /mnt/root.new
# mount /dev/RaidArray/Root /mnt/root.new

Copy content:

# rsync -avXH /mnt/boot.old/* /mnt/boot.new/
# rsync -avXH /mnt/root.old/* /mnt/root.new/

Or if you prefer tar:

# tar -C /mnt/boot.old -cf – . | tar -C /mnt/boot.new -xf -
# tar -C /mnt/root.old -cf – . | tar -C /mnt/root.new -xf -

If you have SELinux create a flag file to request SELinux attributes get relabeled on boot time:

# touch /mnt/root.new/.autorelabel

Setup grub on raid disk:

# grub
root (hd1,0)
setup (hd1)
quit

In /mnt/boot.new/grub/menu.lst instead /dev/VolGroup00/LogVol00 put /dev/RaidArray/Root.

In /mnt/root.new/etc/fstab instead /dev/VolGroup00/LogVol00 put /dev/RaidArray/Root, instead /dev/VolGroup00/LogVol01 put /dev/RaidArray/swap and instead LABEL=/boot put /dev/md0 .

We need to create new initrd:

# umount /mnt/boot.new
# mount /dev/md0 /mnt/root.new/boot
# mount -o bind /proc /mnt/root.new/proc
# mount -o bind /dev /mnt/root.new/dev
# mount -o bind /sys /mnt/root.new/sys
# mount -o bind /selinux /mnt/root.new/selinux

Enter the new system:

# chroot /mnt/root.new

Find the current initrd image:

# ls /boot/*.img

returns something like:
/boot/initrd-2.6.18-128.1.6.el5.img

Create new initrd image:

# mkinitrd -f /boot/initrd-2.6.18-128.1.6.el5.img 2.6.18-128.1.6.el5

Go back to rescue mode from chroot:

# exit

Time to cleanup:

# umount /mnt/root.new/selinux
# umount /mnt/root.new/sys
# umount /mnt/root.new/dev
# umount /mnt/root.new/proc
# umount /mnt/root.new/boot
# umount /mnt/root.new
# umount /mnt/boot.old
# umount /mnt/root.old

Shutdown the system, remove/unplug sda drive or set in bios that primary disk is sdb and power on the machine.

If it boots normally check if the system is on raid:

# mount

You should check if some lines have:
/dev/RaidArray/Root
/dev/RaidArray/swap
/dev/md0

Shutdown the system and reinsert sda drive making it secondary drive in bios.
Startup system in rescue mode as before.
Check:

# fdisk -l

In my case disks were sdb (raid disk) and sda (old, no raid disk).

Since there is no default mdadm.conf file in the installation media it should be created:

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

Activate all discovered RAID devices:

# mdadm –assemble –scan

See the current RAID status:

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1]
104320 blocks [2/1] [U_]

md1 : active raid1 sdb2[1]
10377920 blocks [2/1] [U_]

unused devices:

Convert partitions on old no-raid device so it can be paired with raid device:

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

Check if new partitions are in Linux raid type:

# 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 13 104391 fd Linux raid autodetect
/dev/sda2 14 1305 10377990 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

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 fd Linux raid autodetect
/dev/sdb2 14 1305 10377990 fd Linux raid autodetect

Add new partitions to raid device:

# mdadm /dev/md0 -a /dev/sda1
# mdadm /dev/md1 -a /dev/sda2

You can check the sync progress:

# cat /proc/mdstat

Personalities : [raid0] [raid1] [raid6] [raid5] [raid4]
md1 : active raid1 sdb2[2] sda2[0]
10377990 blocks [2/1] [U_]
[>………………..] recovery = 0.2% (25497/10377990) finish=8.7min speed=23744K/sec

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

unused devices:

Install grub on new raid disk:

# grub
root (hd0,0)
setup (hd0)
quit

To avoid error message when checking fdisk -l (Disk /dev/sdX doesn’t contain a valid partition table) you should do:

# fdisk /dev/sda
Command (m for help): w
The partition table has been altered!

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

# fdisk /dev/sdb
Command (m for help): w
The partition table has been altered!

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

You now have functional raid1 system made of 2 disks.

 

Resources:

http://wiki.centos.org/HowTos/CentOS5ConvertToRAID

http://howtoforge.net/software-raid1-grub-boot-fedora-8

http://tldp.org/HOWTO/LVM-HOWTO/createlv.html

Magic of Flirting Explained: The Origin And The HowTo’s – Part 2

March 30th, 2010

 

The Flirting Triangle


Flirting Glance

 

When we look at people we’re unfamiliar with such as in a business situation, our eyes make a zig-zag motion — we look from eye to eye and across the bridge of the nose.

With friends, the look drops below eye level and moves into a triangle shape — we look from eye to eye and down to include the nose and mouth.

Once flirting begins, the triangle gets larger — it widens at the bottom to include parts of the body. The more intense the flirting, the more intensely we look from eye to eye — and the more time we spend looking at their mouth.

It can be highly seductive when someone’s watching your mouth while you’re talking to them. It could be they’re fantasizing what it would be like to kiss you. A word of caution — don’t be overly overt in this method or you’ll only succeed at relaying a subliminal message of being a sexual predator to a female.

 

 

Read My Lips

 

Like a lioness presenting herself to a mate, women will arch their backs and show off their hips to indicate fertility. Though I hate the stereotype of a giggly, doe-eyed blonde, women laugh and open their eyes wide not because they’re ditzy, but because it conveys an image of surrender and youth. While both men and women will make prolonged eye contact with people they’re interested in, a woman might also lick her lips, helping to bring visual attention to the mouth. If someone is staring at your lips he may be thinking of how to kiss them.

Though a man might not pound his chest like Tarzan while in a crowd, it’s only because of social constraints. He’s still trying to put forth his strong jaw, an indicator of high testosterone levels, and spread his arms and chest to look muscular and strong. Yet he doesn’t want to look too strong or threatening, so he laughs and smiles frequently. Confident and powerful enough to protect his brood; nice enough not to harm the doe.

 

 

Mirroring – Monkey See, Monkey Do

 

This is what separates a competent flirt from an expert — nothing will bond you more effectively than mirroring someone’s behavior. Together, both sexes take part in mirroring, tending to sit or stand in similar positions, or pick up a drink at the same time. When one person leans in, another will do the same if it likes what it’s seeing. The theory behind this is that people are drawn to others who are like them. We like people who are like us. If someone is doing what we’re doing, we feel they’re on the same level and mood as we are. You should only mirror positive body language, ie. if person picks its nose, put the mirror down. Also, try not to imitate the person. Point is just to capture the meaning and do things the way that is natural to you.

 


Flirting Open

 

Pointing

 

We also tend to point or gesture toward our object of desire. This means feet, hands, or the entire body will subconsciously be pointed toward him or her, opening up a line of physical—and hopefully verbal—communication.

If you have your eye on someone across the room, point your body in their direction — even if you don’t make eye contact, they may take the hint.

 

 

The Eyebrow Flash

 

When we first see someone we’re attracted to our eyebrows rise and fall, and they’ll do the same if they’re equally attracted. Watch closely and carefully, because it only lasts about a fifth of a second.

It’s an unconscious gesture replicated by every culture on the planet. Some experts claim it’s the most instantly recognized non-verbal sign of greeting we humans use.

 

 

Blinking

 

If someone likes what they see, their pupil size increases, as does their blink rate.

Being the expert flirt you are, up the odds in your favor by increasing the blink rate of the person you’re talking to by blinking more yourself. If the person likes you, they’ll unconsciously try to match your blink rate to keep in sync with you, in turn making you both feel more attracted to one another.

 


Flirting Street

 



1  2  3