Virtual RJ

Entries categorized as ‘Linux’

Connecting USB HD in ESX for back-up

January 7, 2009 · 1 Comment

As the new year begun some servers were due to be moved to another place more permanent burial place. Our ‘expensive’ SAN storage space is too small to keep the old servers on it so it was time to move them to a USB harddisk. But I had no idea how I could attach it to the ESX. Well for those of you who want to know for the future here is how I did it.

Well first of all I hooked the USB drive onto the ESX server (HP Proliant DL380g5). When I logged onto the console the first thing I did was execute cat /var/log/messages. This gave me following lines:

kernel: Initializing USB Mass Storage driver...
kernel: usb.c: registered new driver usb-storage
kernel: scsi3 : SCSI emulation for USB Mass Storage devices
kernel: Vendor: WD Model: 10EAVS External Rev: 1.05
kernel: Type: Direct-Access ANSI SCSI revision: 02

And a couple of lines further:

kernel: VMWARE: Unique Device attached as scsi disk sdc at scsi3, channel 0, id 0, lun 0
kernel: Attached scsi disk sdc at scsi3, channel 0, id 0, lun 0
kernel: SCSI device sdc: 1953525168 512-byte hdwr sectors (1000205 MB)
kernel: sdc: sdc1
kernel: USB Mass Storage support registered.

From this information I concluded that the USB drive was recognised and was emulated as SCSI, hence the sdc. My harddrive already contained a NTFS partition, but ESX doesn’t have the NTFS drivers. Thats why it will mount the partition using FAT32. This would pose a problem because FAT32 doesn’t support files bigger as 4Gb and my vmdk’s are much bigger. So I decided to format the disk with EXT2 so I could move the files.

I first deleted all the existing partitions with fdisk and after that I created a new primary partition with partition type Linux. After formatting it with the command mke2fs /dev/sdc1 I had a working Linux partition. If you by any chance would want to have an EXT3 disk you could use mke2fs -j /dev/sdc1.

So now I got a working disk and a working partition. First I needed a mount point before I could actually mount the USB drive. So I made a directory in /mnt called ‘usb’ with mkdir /mnt/usb and I executed the following command:

mount /dev/sdc1 /mnt/usb

Now I could access the disk at /mnt/usb and copy all the old VM’s from /vmfs/volumes/[datastorename]. If you want to copy entire directory’s make sure you use the '-R' parameter with cp.

Categories: ESX 3.5 · HP · Linux · VMWare
Tagged: , , , , , , ,

Virtualizing Red Had Enterprise Linux 2 (and all the troubles I had with it)

January 6, 2009 · 1 Comment

For some time I wanted to virtualize the only non-Windows server we had. It was a Red Hat Enterprise Linux 2 server serving some old legacy application. This server had to be preserved en kept running for archiving purposes. So instead of letting it run consuming power and hope it wouldn’t fail (+-7 year old hardware?) we wanted it to be virtual. This way we weren’t reliable on old hardware and we had a flexible way of turning it on whenever we needed it.

With great enthusiasm I went to the datacenter with the VMWare converter CD and I performed a quick and smooth virtualization of the machine. However when I started the machine I got kernel panics and notifications of partitions that couldn’t be found.

Well after quite some time (it wasn’t the highest priority) and a lot of searching I finally found a blogpost called Virtualize a Linux Server with VmWare Converter 3.0.1. “This is exactly what I am looking for!” was my first thought. Well although the article is really clear (well done Manlio Frizzi) it helped me only a bit further.

So my first steps were those that Manlio Frizzi described on his blog. Virtualized the system to my ESX environment. After i’ve done that I downloaded the rescue iso of Fedora Core 3 (FC2 wasn’t available) and mounted this in the virtual cd-rom drive. After selecting “Rescue installed system” from the bootscreen it started loading the BusLogic driver. Then I selected English as my language and US as my keyboard lay-out.

(more…)

Categories: Converter · ESX 3.5 · Linux · VMWare
Tagged: , , , , , , , ,