Montag, 27. Juni 2011

VMware ESX vSphere resize disk

Every now and then I need to resize (usually extend/enlarge) a disk attached to a Virtual Machine. I have tried several methods to do this over the years (including combinations of VMware Converter, third party partition manager apps, diskpart etc) but none have been as efficient as the method I discovered during recent VMware training for my VCP4 exam.

One of the new features of vSphere is the ability to resize disks without having to shut down the Virtual Machine. This was previously impossible in VI3. This greatly speeds up the resizing process which can be executed in a couple of stages:
1) Use the vSphere Client to edit the settings of the Virtual Machine in question. Select the hard disk and modify it's provisioned size as appropriate. Click OK to apply these changes - resizing the .vmdk file.
2) Verify that the .vmdk has been resized by opening the Management Console -> Disk Management to find the unallocated space on the disk that resides in the .vmdk (distinguished by the black colour in the legend at the bottom.) In this case you can see I have increased the size by 5GB.

Right click on the disk (in this case 'Disk 0') and select properties. On the Volumes tab make a note of the unallocated space, in my case it is 5122MB.

If you are using Windows Server 2003 or earlier versions of Windows (Note: Windows Server 2008 now allows you to resize a disk through Disk Management in the Computer Management Console/Server Manager even if this disk is the Boot/Page File disk) download Dell's EXTPART and extract it on the server that contains the disk you want to resize. Navigate to c:\dell\ExtPart (the default extracted location) and run extpart.exe. When prompted enter the the Windows drive letter of the disk on the Virtual Machine e.g. c:. When prompted for the size to extend the partition by enter the number noted down earlier (I used 5122 in this example.) After doing so the disk should be resized. You can check this by opening the Management Console -> Disk Management and verifying the size of the partition.


NB - If you receive the following error:
"Unable to connect to c: or it does not exist"
There are a couple of workarounds that you could try.
1) Close the Management Console (if it is open) and try extpart.exe again.
2) Try restarting the VM in safe mode and then run extpart.exe. This is not ideal but it is still easier than other methods I have tried to resize .vmdk files.

Mittwoch, 22. Juni 2011

How to convert MBps to IOPS or calculate IOPS from MB/s

Most SSDs have two speed ratings for reading as well as for writing. The first rating is the sustained MB/s performance, which is the main marketing most manufacturers use. The second rating is the 4K Random IOPS performance, which gives a much better idea of how the drive will perform in the real world. The sustained MB/s rating is the sequential transfer rate the SSD will maintain continuously, such as over a period of 30 seconds. The 4K Random IOPS on the other hand is how many 4K (4096 byte) operations the drive will handle per second with each block being read or written to a random position.
Usually when a Random 4K IOPS figure is given, it may state that this is at a certain queue depth, such as 4, 16, 32 or 64. With a queue depth of 4, this means that there are 4 separate threads taking place with the drive, each thread independently running its own transfers. With the use of Native Command Queuing (NCQ), the SSD can handle these threads simultaneously to improve the overall throughput compared to running a single thread. While many hard disks use native command queuing to line up read/write operations to minimise seek times between each read/write operation, SSDs can read from and write to multiple NAND cells simultaneously, where as the read/write head in a hard disk can only be in one physical place at any time.
While it is nice to see how many IOPS a drive is capable of, it is also useful to see how this translates into actual throughput or even vice versa. For example, most benchmark tools such as CrystalDiskMark and AS SSD report the random 4K performance in throughput, i.e. MB/s, while the SSD’s specifications usually rates the 4K performance in IOPS.
To see how to translate MBps into IOPS and vice versa, we need to do a little math:
IOPS = (MBps Throughput / KB per IO) * 1024
Or
MBps = (IOPS * KB per IO) / 1024
So let’s say we have an SSD claiming a Random 4K write speed of 20,000 IOPS and it achieves 76.2MB/s in the CrystalDiskMark with the QD32 write test.
To convert the 76.2MB/s to IOPS, we perform the following calculation:
IOPS = (76.2 / 4) * 1024
IOPS = 19.1 * 1024
IOPS = 19,558.4
To see what throughput we need to achieve to match the actual 20,000 IOPS claim, we can perform this calculation in reverse:
MBps = (20,000 * 4) / 1024
MBps = 80,000 / 1024
MBps = 78.125MB/s
Note that each manufacturer uses its own method of coming up with their SSD IOPS ratings. Besides separate IOPS ratings for read and write speeds, a given SSD can behave quite different depending on the type of data being read or written, as well as the duration this transfer takes place. For example, an SSD that achieves 5,000 Random 4K IOPS sustained write over a period of 30 seconds may only achieve 1,000 IOPS sustained write over a period of 5 minutes. For SSDs using the SandForce processor, the compressibility of the data also has an impact, so two benchmark tools may show completely different IOPS readings if one tool sends uncompressible data and the other tool sends highly compressible data and also if one runs the benchmark for longer duration than the other.

Donnerstag, 9. Juni 2011

Unix shell unter Windows

C:\Documents and Settings\takoloko>dir | grep *.jpg

Mit den UnxUtils könnt ihr eine ganze Reihe nützlicher Linux Programme bzw. Befehle in der Windows Command Line verwenden. Beispiele: gawk, grep, less, unrar, wget.
Eine komplette Liste der UnxUtils Befehle findet ihr auf der Homepage.

Installation UnxUtils

  1. Downloaden – Die UnxUtils sind in einer zip-Datei gepackt, die ihr euch bei Sourceforge downloaden könnt. Die Datei heisst UnxUtils.zip (nicht UnxUtilsSrc.zip!).
  2. Entpacken – Als nächstes müsst ihr die Datei in C:\ entpacken.
  3. Pfad anpassen – Um die Befehle in der Command Line nutzen zu können, müsst ihr noch die Pfad Variable anpassen. Rechsklick auf den Arbeitsplatz -> Eigenschaften -> Reiter “Erweitert” -> unten auf “Umgebungsvariablen” -> im unteren Feld die Variable “Pfad” auswählen -> Doppelklick auf die Variable -> am Ende der Zeile ;C:\usr\local\wbin der Pfadvariable hinzufügen.
  4. Fertig

Links:

Autostart Windows 2008 Server [All Users]

%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup

Mittwoch, 8. Juni 2011

Add a new Partition on opensuse 11.4

1. Plan the new filesystem. Where would you like to use the new space? Do

df

to print a summary of free/used space on each of the existing mounted partitions. Do

du

on selected directories to find their size.

For example, I would consider using new hard drive space in one of the following mount points:

/usr/local
/home
/home/share/downloads
/usr/local/mp3s
/usr/local/dos_data

Here is Details.

/usr/local is suposed to survive any upgrade of Linux. It is nice to have it on a separate partition because I can even reformat other partitions without affecting my local contents stored in /usr/local. I surely want it of the type "ext2" or perhaps "reiserfs".

/home contains user data. Surely, it is the data that deserves the most care. It is obviously supposed to survive any upgrade of Linux. Wow, obviously I want it on a separate partition. The type is normally "ext2" or "raiserfs".

/usr/local/mp3s is a non-standard Linux directory. I may keep my MP3 (music) files there. Those tend to be large.

/usr/local/dos_data. Another non-standard directory. If I dual boot, I would consider making an extra partion of the type "DOS FAT32" or similar so as to share files between MS Windows and Linux transparently (both ways). I would configure all the Windows-based programs to use this "drive" as the default location for all user-generated files. I could even have "mp3s", "cds" and other such directories in this location. The serious drawback of this approach--MS Windows may insist on messing up with this partion on re-install.

2. Partition the new hard drive. For example, if my new harddrive is the slave on the second IDE interface (perhaps the "fourth" IDE drive), I could use:

cfdisk /dev/hdd

or the more old-fashioned (and standard) tool:

fdisk /dev/hdd

If your drive is not "hdd" adjust the above command as needed.

hda -- first ide master (whole disk)
hdb -- first ide slave
hdc -- second ide master
hdd -- second ide slave
sda -- first scsi (whole disk)
sdb -- second scsi (whole disk)
...
sdp -- sixteenth scsi (whole disk)

For other disks, consult /usr/src/Linux/Documentation/devices.txt.

Most of the time, Linux partitions to be of the type ext2 ("Linux").

Partitioning can be tricky--if you never have done it, read man fdisk and man cfdisk. It is very easy to delete a partition with all your data. Make sure you know which disk you are working with!

fdisk or cfdisk does not make any changes to the hard drive until I write the new partition layout. So if I make a bad mistake, I can always quit without writing. I write the layout to the drive only when I am completely done.

3. Format each partition. For example, to format the first partition, while checking for bad blocks (-c), I would do:

mkfs -c -t ext2 /dev/hdd1

4. Test the new partitions around. Mount the new partitions manually (the mount directory must exist and be empty). Copy a bunch of files to each partition. View/edit a couple of random files. Delete them all.

5. Copy data. Optional--only if you would like to move data from an old partition to a new partition. Go to the single-user mode (init 1). Mount the new partition manually. Copy the data from the old partition to the new partition. Careful with the old data, you probably don't want to lose it if you made a mistake, so I wouldn't delete it yet--I rename the top level directory appropriately. E.g.,

cp -R /usr/local/ /mnt/hdd1/
mv /usr/local/ /usr/local.old.backup_of_2005-04-21

6. Edit the file /etc/fstab. Modify it to reflect your new filesystem layout. Perhaps, insert the mountpoint for the new partition(s) or modify any old mountpoints as needed. For example, if moving /usr/local to its own partition, I would need to add to add a line like this:

/dev/hdd1 /usr/local ext2 defaults 1 2

7. Reboot and test. The alternative to reboot is to unmount old and mount new mount points. For example:

umount /usr/local
mount -a

but hard reboot may be a more rigorous test of the new layout.

8. Remove old data. After a few days, when I have the confidence everything is really working fine

Montag, 6. Juni 2011

openSuse 11.3

vim /etc/HOSTNAME
vim /etc/hosts

Um den Hostnamen zu ändern

Sonntag, 5. Juni 2011

Häßliches Win7 - winsxs

Hallo der winsxs Ordner unter Windows 7 wächst immer weiter, was kann ich dagegen tun:

DISM.exe /Online /Cleanup-Image /spsuperseded


Danach sollte das Problem behoben sein.