Thought I should write something tech for a change! 😉
It is golden week here and all are away on break. So instead of forcing a staff member to come back, I thought I would take care of some stuff myself.
My problems started when a client who has a large advertising cluster, was running their main statistics database (for click fraud detection) on a Dell 1950 with only 1 SAS 15K drive.
I had suggested that this node, not being redundant like the tomcat servers be individually redundant, so DRAC card, redundant power and RAID.
Anyway, some new blades, Dell 1955’s arrived for the cluster and I thought, well, lets save the client some money, image the old 1950 DB server and load it onto a new 1955 server?
I thought this would be simple with Acronis.
No it wasn’t.
It turns out that a 3.5 Inch 73GB SAS drive is not the same size as a 2.5 Inch 73GB SAS drive. So I could not write my system image to the blades raid 1 array of 2 x 15K 73GB SAS drives.
Shite! If I reinstall the DB server it is not worth my time. Cheaper to buy the upgrade parts for the 1950.
Then I thought, well, I have LVM, I should be able to do this, after all I have used LVM before many times on large storage arrays.
So my goal was this, I needed a system image that was a couple hundred megs smaller than it was now, so it will go into the 1955’s ok.
This is where I added in VMWARE to the mix and made this an easy task. The steps are below:
- Image the 1950 server to some ACRONIS TIB files somewhere. I used FTP
- Image the TIB file to a new VPS made with a 73GB virtual disk
- Create and attach a new 65GB virtual disk to the virtual machine
- Image the MBR and /boot partitions using acronis onto the new 65GB virtual disk
- Boot virtual machine with a rescue/live CD
- Load FDISK for /dev/sdb and create a new LVM (Type 8e) partition in the remaining space on the 65GB virtual drive
- Enter LVM with the “lvm” command
- Activate all Volume Groups with the command “vgchange -a y”
- EXIT out of LVM and then run this command to resize the EXT3 file system, “resize2fs /dev/VolGroup/LogVol00 40G”, you may have to run “e2fschk -f /dev/VolGroup00/LogVol00” first too
- Enter LVM again with the “lvm” command
- Now we can reduce the Logical Volume that had the recently shrunk EXT3 file system on it with this command, “lvreduce LogVol00 -L 45G”
- Because we are making a new custom boot image and we have already imaged over the /boot partition and MBR, we now want our old 73GB virtual drive to not have any of the same markings as our embryonic new 65GB virtual drive. To do this we need to change the Volume Group and Logical Volume names to something new:
- lvrename VolGroup00 LogVol00 LogVol10
- lvrename VolGroup00 LogVol01 LogVol11
- lvchange LogVol10 -a n
- lvchange LogVol11 -a n
- vgchange VolGroup00 VolGroup10
- Now we can create the new Logical Volumes and Volume Groups on the 65GB virtual disk in preparation for cloning our now 40GB EXT3 file system
- Make a new Physical Volume first wit, “pvcreate /dev/sdb2”
- vgcreate VolGroup00 /dev/sdb2
- lvcreate VolGroup00 /dev/sdb2 -n LogVol01 -L 2G
- lvcreate VolGroup00 /dev/sdb2 -n LogVol00 -L 50G
- Now we need to make our new LVM’s online and visible to the system so we run the command vgchange again, “vgchange -a y”
- Back at the command prompt we need to now setup our new SWAP partition, so we issue the command, “mkswap /dev/VolGroup00/LogVol01”
- Now we can clone our old 40GB EXT3 partion that we shrunk to our new LVM which is larger than 40GB, but smaller than 65GB, so it will image onto the PE1955 2.5 SAS drive array
- We use an old favourite for this, “dd if=/dev/VolGroup10/LogVol10 of=/dev/VolGroup00/LogVol00”
- Once done, shutdown the VPS, boot up in Acronis and image the new 65GB virtual drive and then load it onto the PE1955 server. DONE!
I did all of this in single user mode so as to minimise the need for KUDZU to rescan and change all hardware. I can do this because of the hardware commonality in the 9th generation Dell servers.
Also once done, the new LVM will be smaller than the full capacity of the 73GB SAS 2.5 SAS drive. This is easily fixed while online. by making a new partition /dev/sda3 of LVM type (8e), making it into a Physical Volume, adding it to VolGroup00 and then extending the LogVol00 logical volume with the newly added extents. Once that is done, go back to the command prompt and use the ext2online command to finally expand your EXT3 partition to use all the space on the LVM.