Mapping RAW Disks (RDM) in ESXi 4.0, 4.1, 5.0, 5.1

When you need have raw drive to a VM in ESXi without passing the whole controller to the VM, you’ll need RDM (Raw Device Mapping).
Here is the jist, in a SSH session with ESXi server:
vmkfstools -z /vmfs/devices/disks/<diskname> /vmfs/volumes/<datastorename>/<vmfolder>/<vmname>.vmdk

More details
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530

Windows 7 Doesn’t remember folder view settings

Finally a fix for Windows 7 and the lack of remembering individual folder view settings!

http://www.geekscribes.net/blog/2011/06/05/solved-windows-doesnt-remember-folder-view-settings/

Linux Mint on Software RAID5 (MDADM)

  1. Load Mint Live DVD
  2. Setup RAID5 Array. Use gparted (or any paritition tool) to make /boot and root (/) and swap partitions on each drive. Then use mdadm to make RAID1 /boot, RAID5 root (/) and format swap partitions. (I don’t recommending RAID’ing swap spaces, or don’t make swap partitions at all, use a file based swap once the system is running)
  3. Run Installer – Do advance partition layout. Map /boot, /, and swaps (if swap partitions were made). Set boot loader to RAID1′s MD (It always fails for me. But we’ll fix it later)
  4. When installer is done, don’t leave live session. Open terminal. run the following
    • mount /dev/md1 /mnt (md1 is my root mdadm array)
    • mount /dev/md0 /mnt/boot (md0 is my raid1 boot mdadm array)
    • for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done (Mount all special folders so we can run commands in a chroot environment. Taken from here)
    • chroot /mnt
    • apt-get install mdadm
    • grub-install /dev/sda;grub-install /dev/sdb;grub-install /dev/sdc (This is installing grub on each drive, so if drive fails we can boot off another. do this for all drvies)
    • update-grub
    • exit
  5. reboot into os

Windows 7 SMB 2.0 Client doesn’t find new files until reboot

At work we had an issue where two Windows 7 Home Pre clients would not show newly created files on mapped network drive. Normal refresh wouldn’t cut it, but unmount and remount or a pc reboot would. After little of googling I found I wasn’t alone.

http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/947489ae-dc86-45f0-ad5e-463a62e1d59f

Even though this topic’s setup was a windows server and here at my office we use Samba 3.6.3 with SMB2.0 enabled. But the symptoms were very similar.  The finger was pointed at the new caching abilities in the SMB2.0 client. The solution was to disable DirectoryCacheLifetime on the client via a registry entry.  Here is Microsoft link for description of DirectoryCacheLifetime http://technet.microsoft.com/en-us/library/ff686200(WS.10).aspx

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters]
“DirectoryCacheLifetime”=dword:00000000

In my experience it seems that only Windows 7 Home Pre clients are effected, our Windows 7 Pro clients have no issues. I applied the registry entry to the Windows 7 Pro machines as well with no side effects.

Convert FLAC to AAC with ffmpeg

Little windows batch script I made to convert 1 flac at a time to AAC (m4a)
C:\ffmpeg.exe -i %1 -c aac -ab 256k -strict experimental "%~d1%~p1%~n1.m4a"
grab ffmpeg.exe from http://ffmpeg.org/download.html

 

Finding hardware info on linux

  • How to find motherboard make and model
    • dmidecode -t baseboard
  • How to find CPU details
    • dmidecode -t processor
    • cat /proc/cpuinfo
  • Memory
    • free –  will show current memory ussage including total amount of memory installed
    • dmidecode -t memory –  for more detail on each dimm
    • decode-dimms – http://www.richud.com/wiki/Ubuntu_See_Live_RAM_Timings_Decode_DIMMS

Linux – Remove all empty folders

So yeah, Got a lot of empty folders? Want to get rid of them? run this in a folder with empty subfolders!

find -depth -type d -empty -exec rmdir {} \;

DD over SSH

I wanted to copy my pfsense disk without taking down the machine. (Moving from 3.5″  to 2.5″ disk for increased power savings)  So I’m using DD and piping it over SSH to my file server. No progress bar but my drive is small.

dd if=/dev/sda | ssh root@freenas "dd of=/backup/pfsense.img"

found out adding ‘bs=4k’ or larger made transfer go little faster

dd if=/dev/sda bs=32k | ssh root@freenas "dd of=/backup/pfsense.img"

I topped out around 200mbit, with my router CPU maxed out. Must be SSH’s encryption overhead.

Credit – http://karlherrick.com/dev/2008/09/12/dd-backups-over-ssh/
DD Man Page – http://linux.die.net/man/1/dd

Multi-Tasking with crappy applications (MS Word)

Some applications while processing a request can ‘freeze’ or lag the UI of the OS. But most are single threaded applications and I sit on a powerful multi-core desktop. My example Mail Merge in Microsoft Word.  My work around so I can keep working in other applications on my desktop is to make multiple user accounts. So when I want to run a MS Word mail merge I first switch to ‘Jason2’ account and start the long mail merge process, and switch back to my main account to continue working with no UI Lag from the OS.

Silly Windows.

ZFS Notes

Things not to forget
  • ZFS  can be CPU and Memory intensive.
  • ZFS raidz1, raidz2, etc requires a lot of CPU time. My low power dual core maxes out on 8xraidz2. I upgraded from AMD 270u to AMD X4 960T and my write performance tripled
  • pool = zfs collection of vdevs
  • vdev = collection of disk drive(s), single, n-way mirror, raidz, raidz2, raidz3
  • raidz = similar to raid5
  • Striping happens automatically between vdevs (Use multiple vdevs to increase throughput and I/O)
  • Can not add additional disk(s) to a raidz vdev. But can add addition vdevs to a pool.
  • Can not remove vdevs from pools. Only disks from fault tolerant vdevs (mirror/raidz) can be removed and replaced.
  • Use whole disks, not partitions. Easier that way. (… and faster too?)
  • So far, ZFS is smart enough that if you plug the drives in different SATA ports the pool can still be imported. Example, I moved 2 drives off my motherboard controller to a PCIe addon controller without issue.
  • zpool status
    show the status of all disks in a pool
  • zpool iostat -v 5 [pool name]
    shows I/O’s and bandwidth with a 5 second average on each disk
  • zpool export pool_name / zpool import pool_name
    if needed to move pool to a different machine

Current setup is 2 raidz1 vdevs with 3x3TB drives each. Yielding 12TB