Thursday, 3 November 2011
Wednesday, 2 November 2011
Replace HDD in Linux LVM Software RAID
unformatted drive we need to take the following actions to get the LVM SW
RAID up and running again. The OS in question is Citrix XenServer 5.6 so
the commands are specific to that partition layout.
1. Copy the partition table from /dev/sda to /dev/sdb you can use dd
dd if=/dev/sda of=/dev/sdb bs=512 count=1
2. Now set the partition table up on /dev/sda the way it should be for
Linux RAID. This means setting the partition types to 0xfd.
echo -e "\nt\n1\nfd\nt\n3\nfd\nw\nx" | fdisk /dev/sdb
3. Now we need to add the drive to RAID partitions
mdadm -a /dev/md0 /dev/sdb1
mdadm -a /dev/md1 /dev/sdb3
4. Check to see both partitions are rebuilding.
mdadm -D /dev/md0
...at the end of output you should see
Rebuild Status : 6% complete
UUID : 5ab2841a:99cd3850:17d24f1b:97040b83
Events : 0.52
Number Major Minor RaidDevice State
2 8 1 0 spare rebuilding /dev/sda1
1 8 17 1 active sync /dev/sdb1
run the same command for the /dev/md1 partition
mdadm --monitor /dev/md0 -1
(change to /dev/md1 for second partition)
If you get the output below - the array is still rebuilding. If you get no
output, the RAID is in sync.
Nov 2 15:18:20: DegradedArray on /dev/md0
Thursday, 27 October 2011
Exchange Autodiscover URL
certificate name mismatch error.
You have already checked that Outlook Anywhere, the DNS server and the
Outlook profile have the correct configuration and settings. You could be
looking at an Exchange Autodiscover problem.
Open the EMS and type this to check the current Audiscover settings
Get-AutodiscoverVirtualDirectory | fl
You should something similar to this:
Name : Autodiscover (SBS Web Applications)
InternalAuthenticationMethods : {Basic, Ntlm, WindowsIntegrated}
ExternalAuthenticationMethods : {Basic, Ntlm, WindowsIntegrated}
BasicAuthentication : True
DigestAuthentication : False
WindowsAuthentication : True
MetabasePath :
IIS://SERVER.domain.local/W3SVC/3/ROOT/Aut...
Path : C:\Program Files\Microsoft\Exchange
Server\...
Server : SERVER
InternalUrl : https://server.domain.com/Autodiscover/...
ExternalUrl : https://server.domain.com/Autodiscover/...
...
The ExternalUrl and InternalURL should be set to the correct external FQDN
of the server. If this is not correct you can change the settings as
follows:
Set-AutodiscoverVirtualDirectory -identity "Autodiscover (SBS Web
Applications)" -InternalUrl
"https://remote.domain.com/Autodiscover/Autodiscover.xml" -ExternalUrl
"https://remote.domain.com/Autodiscover/Autodiscover.xml"
The server in question is a SBS 2008 running Exchange 2007.
Wednesday, 19 October 2011
Tuesday, 11 October 2011
Monday, 10 October 2011
Sharepoint Repair
following to repair permissions, etc.
C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\<VERSION>\BIN\psconfigui.exe
Tuesday, 4 October 2011
Allow users to manage distribution group
Add-ADPermission -Identity <name of distribution group> -User <name of
user> -AccessRights WriteProperty -Properties "Member"
Friday, 30 September 2011
ADSL Connection Quality
troublesome ADSL connections
Attenuation:
< 20dB : Excellent
30dB - 50dB : Good
> 50dB : Poor and will probably have connectivity problems
Signal to Noise Ratio (SNR)
> 20db - Excellent
8dB - 20dB : Good
< 7dB : Poor and will probably have connectivity problems
ShadowProtect Recovery Notes
Set the following on all volumes
- Allways restore MBR
- Restore 'Original Windows MBR' if boot partition
- Restore 'Disk Signature'
- Resotre 'Disk Hidden Track'
Policy Changes needed:
- IF
- RAID Controller and Firmware is different
- AND/OR
- Disk and Disk Firware is different
- Set recovery policy to 'Sector Alignment'
Ctrl-Shift F10 - Allows access to command shell to do CHKDSK
Allways check Boot Configuration on Tools menu to make sure system is
bootable and drive letters are good.
Friday, 2 September 2011
Install XenServer 5.6 on software RAID 1
A problem I have encountered is that the XenServer 5.6 boot install media
does not recognise a two SATA disk RAID 1 set configured using the Intel
SW RAID BIOS - it sees the two drives separately. The SR RAID set is on a
separate Intel RAID adapter with separate SAS drives.
The first step is to disable the BIOS RAID and configure the two SATA
drives as independent drives (AHCI mode).
Then install XenServer onto the first disk /dev/sda and don't configure any
SRs at this point - once the install completes and server restarts go to
the console screen (ALT-F3) and follow these instructions:
The original source for these instructions is this blog - thanks Todd!
I copied and updated his instructions and numbered them for easier reference.
http://www.toddsmith.org/wordpress/uncategorized/configure-xenserver-50-free-for-software-raid-1/
1. To copy the partition table from /dev/sda to /dev/sdb you can use dd
dd if=/dev/sda of=/dev/sdb bs=512 count=1
2. Now set the partition table up on /dev/sdb the way it should be for
Linux RAID. This means setting the partition types to 0xfd.
I used the following command:
echo -e "\nt\n1\nfd\nt\n3\nfd\nw\nx" | fdisk /dev/sdb
That tells says to fdisk, “tag partition 1 as type 0xfd, tag partition 3 as
type 0xfd”
3. Check to make sure the /dev/md? devices are present
[ -e /dev/md0 ] || mknod /dev/md0 b 9 0
[ -e /dev/md1 ] || mknod /dev/md1 b 9 1
4. Startup the degraded RAID devices
mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1
mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/sdb3
pvcreate /dev/md1
volume_group=`vgscan | grep VG | awk -F \" '{print $2}'`
vgextend $volume_group /dev/md1
>> I have had to replace the next line
pvmove /dev/sda3 /dev/md1
>> with
dd if=/dev/sda3 of=/dev/md1 bs=8M
>> this is because in XenServer 5.6 the /dev/sda3 partition is of type 8e(LVM) rather than 83 - http://daniel-albuschat.blogspot.com/2008/02/converting-lvm-to-normal-partition.html
vgreduce $volume_group /dev/sda3
5. Now we’re ready to copy the filesystem over to the RAID device /dev/md0
mkfs.ext3 /dev/md0
cd / && mount /dev/md0 /mnt && rsync -a --progress --exclude=/sys \
--exclude=/proc --exclude=/dev/shm --exclude=/dev/pts / /mnt
mkdir /mnt/sys
mkdir /mnt/proc
6. Now let’s setup initrd
mkdir /root/initrd && cd /root/initrd
zcat /boot/initrd-`uname -r`.img | cpio -i && \
cp /lib/modules/`uname -r`/kernel/drivers/md/raid1.ko lib
7. Now we have to edit the init file
q="echo Waiting for driver initialization."
sed -r -i "s,^${q}$,\n\necho Loading raid1.ko module\ninsmod
/lib/raid1.ko\n${q}\n,g" init
q="resume /var/swap/swap.001"
sed -r -i "s,^${q}$,${q}\necho Running raidautorun\nraidautorun
/dev/md0\nraidautorun /dev/md1,g" init
r=`grep mkroot /root/initrd/init`
sed -r -i "s|^${r}$|${r/sda1/md0}|g" init
8. Now we’ll copy the initial ramdisk to the /boot on the new RAID
>> This is a key step - replace
find . -print | cpio -o -c | gzip -c > /boot/initrd-`uname -r`.img
>> with
find . -print | cpio -o -c | gzip -c > /mnt/boot/initrd-`uname -r`.img
sed -r -i 's,LABEL=root-\w+ ,/dev/md0 ,g' /mnt/etc/fstab
sed -r -i 's,LABEL=root-\w+ ,/dev/md0 ,g' /etc/fstab
9. And setup the boot loader
sed -r -i 's,root=LABEL=root-\w+ ,root=/dev/md0 ,g'
/mnt/boot/extlinux.conf
sed -r -i 's,root=LABEL=root-\w+ ,root=/dev/md0 ,g' /boot/extlinux.conf
cat /usr/lib/syslinux/mbr.bin > /dev/sdb
cd /mnt
extlinux -i boot/
cp /mnt/boot/extlinux.conf /boot/
cp /mnt/boot/initrd-`uname -r`.img /boot
10. Unmount /dev/md0, sync, and reboot
cd ; umount /mnt || umount /dev/md0
sync
reboot
11. After the server boots up again we tag the partitions as type Linux
raid, then we have to add /dev/sda to the RAID.
echo -e "\nt\n1\nfd\nt\n3\nfd\nw\nx" | fdisk /dev/sda
mdadm -a /dev/md0 /dev/sda1
mdadm -a /dev/md1 /dev/sda3
reboot
12. Allow the serve to boot up and wait for the RAID to rebuild
To check whether the RAID is completed run the following:
mdadm --monitor /dev/md0 -1
If you see "DegradedArray" its still rebuilding. Once completed reboot a couple of times to make sure all is well.
That's it!
----------
You can configure RAID monitoring to send an email as follows:
http://www.review-ninja.com/2009/10/how-to-monitor-raid-devices-on-linux.html
There are a couple of things are beware of with this config.
1. Don't apply any patches as this will probably break the LVM setup.
2. Citrix Licensing policies may require you to install some patches in the
future to renew licenses.