Sunday, November 25, 2012

Disaster Recovery

So when I set up my shiny new Fedora 16 box, I was careful to set up a pair of disks as Raid 1.  Any disk failure and I would be covered, right?  Wrong.  What I neglected to do was put the GRUB2 MBR (Master Boot Record) boot loader on my second disk.  So, even though I had all my data mirrored onto the second disk, if the first disk failed, my system would not boot because the MBR was only on the first disk.  Did I say if the first disk failed, I meant to say when the first disk failed.  And sure enough, it failed.  Unbootable system.  I tried swapping disks around, etc, but no MBR on the second disk so no boot.  Here's what I did to recover.

The scenario - 2 disks, sda and sdb set up in raid 1 mirror.  Only sda has the MBR for grub2.  sda failed, leaving me with a good sdb but the system could not be booted.

First, I got a trusty Knoppix boot DVD.  At first I'd tried to use the Knoppix CD but it only boots at 32 bit and I couldn't chroot to my installed system (on second disk) because it was 64 bit.  Knoppix 7.0.4 only has grub and not grub2 so I need to use the grub2 code that's on my working sdb.  So, Knoppix DVD, available at http://www.knopper.net/knoppix/index-en.html.  I tried messing around creating a boot USB on my Mac using unetbootin, etc but ultimately wasn't able to create anything that booted.  (Had to use my Mac because obviously my Linux box was not working...)

Once I had a working Knoppix DVD, I booted on it (boot parameter "knoppix64") and accessed my working sdb (which Knoppix Linux had brought on as sda since the failed sda was at this point now removed and disk names are done as they are seen).  Since it's a metadisk, in order to mount the disk, I had to do:

mdadm --assemble --auto=yes /dev/md0 /dev/sda2

sda1 is swap.  sda2 is a large LVM partition.  The mdadm --assemble brought up metadevice md0 with member device sda2.  mdadm was kind enough to bring on the array even though it was missing 1/2 of the mirror.  So nice.

Next, to mount the filesystems:

mkdir /media/lvm
mount /dev/vg00/lvslash /media/lvm
mount /dev/vg00/lvboot /media/lvm/boot 
Mounting the LVM devices (use the "pvs", "vgs", and "lvs" commands (no args) to display the contents of the various LVM components.  The original / and /boot are mounted under /media/lvm.

Now at this point I want to run grub2 to get it to re-install the MBR.  But, no amount of messing around with various components or options could get it to run and see things and install the MBR.  I kept complaining that it couldn't find /boot/something/grub2 stage1.  But the file was there at the path it was looking at.  My only guess was that it was trying to find it by reading the filesystem directly and couldn't since the LVM or grub on Knoppix was different.

Regardless, I needed to do a chroot to fake out the system into thinking it was running for real on my disks and not Knoppix.  The chroot was easy enough, but then grub2 would refuse to run because it couldn't find running device info (which is on /dev but not the chroot /dev).  ARGH!  The fix is to remount /dev and /proc from the real system onto the chroot system.  Surprisingly this just works:

mount --bind /dev/ /media/lvm/devmount --bind /proc /media/lvm/proc

That done, I can chroot to the filesystem:

 chroot /media/lvm
and then run grub2 to install the new MBR

grub2-install --recheck /dev/sdagrub2-install /dev/sda 

After this was done, I exited out of the chroot, unmounted filesystems, rebooted on the new MBR, and like magic, I'm good to go, the working disk is fine.  Next up, to get a replacement disk and create the LVM for the mirror and resynchronize across two disks.  And also to put the MBR on the second disk :)


Saturday, October 27, 2012

Need for Speed 2

Upgraded the wireless to a dual N band router.  Is a little faster than before.  See ancient history here http://gaplax.blogspot.com/2012/06/need-for-speed.html

Copying a 5.74G file around:

802.11g - 38 minutes
802.11n - 17 minutes


This router is a little frustrating as when I configure it as an Access Point, I can't get at the router to configure it even though I've told it to allow access to the management interface over any net.  Not a huge loss, but is nice to see the mgmt interface to see who's connected to it.

Saturday, August 4, 2012

LIRC

I've been using XBMC for a little while.  I have a Rosewill remote RHRC-11002.  Had been working fine but then stopped working.

Turns out in the XBMC Lircmap.xml this remote is known as mceusb but somehow LIRC is now reporting that the device is mceusb_hauppauge.

The fix is to edit /usr/share/xbmc/system/Lircmap.xml and change the known device to mceusb_hauppauge:


root@xbmc:/usr/share/xbmc/system# diff -c Lircmap.xml.20120804 Lircmap.xml
*** Lircmap.xml.20120804 2012-03-23 20:25:30.000000000 -0400
--- Lircmap.xml 2012-08-04 05:44:31.617871872 -0400
***************
*** 9,15 ****
 
  
 
!
  Play
  Pause
  Stop
--- 9,15 ----
 
  
 
!
  Play
  Pause
  Stop


Done, and my remote is now working again.

Saturday, July 7, 2012

Weekend temptation, the Internets themselves.

So I currently have the 25Mb Internets at home (beats the 10Mb at work, ahem...).  Verizon now has "Quantum Internet" so I can get 300Mb.  Schweet.  No pricing for 300Mb, but they quote 75Mb as +$10/month.  Very tempting.

According to Verizon:
  If you order 150 Mbps/65 Mbps or 300 Mbps/65 Mbps FiOS Internet, a Verizon technician may need to install a new router and wiring in your home. Please ensure your computer has a10/100/1000 Gigabit Network Interface Card capable of supporting these higher speeds.


Good call on checking to see you have a GigE interface on your computer!

Last time I did a speed test I got ~30Mb.  http://gaplax.blogspot.com/2011/11/fios-speed-test.html


Mass Energy

Annual check in on Mass Energy http://www.massenergy.org/heating-oil

Costs $20/year to join.  They state their prices are $0.20/gallon cheaper than the state average.  For us with annual use of ~700G this works out to about a $140 savings.

Saturday, June 30, 2012

The (Honest) Truth About Dishonesty

Just finished Dan Areily's book "The (Honest Truth About Dishonesty)"

Take home points:

 Simple Model of Rational Crime (dishonesty based on rational analysis of cost/benefit of cheating, benefit of the crime, probability of getting caught, expected punishment) is completely bogus.  Study was set up (solving math problems for $$), subjects did not cheat more when the payout (for cheating) was higher.  It was actually less.   Probability of getting caught?  Study showed roughly the same amount of cheating as when there was NO chance of getting caught.

The more distanced from actual money (tokens vs. actual $), people were more likely to cheat.  People are more likely to steal $1 of pens (office supplies) than an actual $1 bill.  Stealing $1 and then using it to buy a pen is somehow worse than stealing a $1 pen.  Getting people to recite an honor code (thou shalt not steal) makes them less likely to steal.  So does signing *before* they fill out a form (like a tax form).  Filling out after does not have this effect.

The more distanced you are from the act, the more likely you are to cheat.  Golfers cheating by moving the ball are less likely to consider it cheating if they move the ball with their club or feet than by their hands.  This also ties into cheating by stealing $$$ vs. stealing supplies.

Resisting temptation somehow wears down our moral resistance, and after enough resistance we are apt to give up (run out of steam) and give in.

Wearing (known) fake products (sunglasses, bags) makes us more likely to cheat on various tests.

Cheating across cultures and nationalities, pretty much the same.

Being supervised decreases dishonesty.  Even a picture of somebody watching you decreased the likelihood that somebody would cheat on putting the correct change in a box to pay for a snack.

Essay mills - people paying for essay papers?  As of 2010 - a survey of the quality of these papers shows them to be so poor it's immediately apparent to professors that they are complete junk.

People are more likely to cheat in an altruistic situation where they are helping somebody else.

Forces that shape dishonesty:

  • Ability to rationalize the situation
  • Conflicts of interest
  • Being creative
  • One immoral act spawning another
  • Being tired
  • Altruistic benefit
  • Watching others cheating
Forces that have no effect

  • Amount of money to gain
  • Probability of being caught


Forces that decrease dishonesty


  • Pledging honesty
  • Signing something
  • Reminding of the moral code
  • Being supervised

  

All in all, a good read, good studies back up the conclusions.  The book starts out strong, but by the later chapters seems to run out of steam and becomes more anecdotal.

Saturday, June 23, 2012

Coach!

Oh man, I was saddened to learn that the McGurk effect (http://en.wikipedia.org/wiki/McGurk_effect) had nothing to do with Coach McGuirk.  Too bad.

QuackTime Player

Grrrrrr.  Why is it that the QuickTime player can only play MPEG-2 at OSX Lion levels.  It can play MPEG-4 just fine.  What is it about MPEG-2 that they couldn't handle?  VLC has been doing it for years.


This is the sort of crap that drives me bonkers with Apple stuff.  If you stay within the ecosystem, everything is fine, but once you stray out, you realize the ecosystem is actually quiet small and limited.


http://support.apple.com/kb/HT3775?viewlocale=en_US


Below are the video and audio file formats and codecs that QuickTime Player can playback in Mac OS X v10.6.x or OS X Lion:

Video

  • QuickTime Movie (.mov)
  • MPEG-4 (.mp4, .m4v)
  • MPEG-2 (OS X Lion only)
  • MPEG-1
  • 3GPP
  • 3GPP2
  • AVI
  • DV
  • MPEG-2 (OS X Lion only)
  • MPEG-4 (Part 2)
  • H.264
  • H.263
  • H.261
  • Apple ProRes
  • Apple Pixlet
  • Animation
  • Cinepak
  • Component Video
  • DV
  • DVC Pro 50
  • Graphics
  • Motion JPEG (Mac OS X v10.6.x only)
  • Photo JPEG
  • Sorenson Video 2
  • Sorenson Video 3

Friday, June 22, 2012

zipl.us and twitterfeed

Good post at http://iag.me/socialmedia/tools/how-to-update-twitter-and-facebook-with-your-google-posts/ about how to get google+ posts to announce to twitter.  I'd been using plusfeed but that had dropped off the radar a while ago.

Taking out the trash

So I have one of these little Creative Vado digital cameras.  I've been using it for a couple of years now, and I've noticed that recently the recording time seems to be getting less and less.  It's flash based memory so I figured it was something to do with the memory being reused and unusable after time.  I figured it was time to buy a newer one, something that had a bit more record time.

On a whim I decided to poke around the filesystem using the shell to see where the space was being used.  Surprise - the Mac had created a .Trashes folder and was happily squirreling away all the deleted videos.  DOH!  About 7.6G of space.  Double DOH!  Frustrating because this trash doesn't show up in the finder when I just browse the device.  Would be nice if I had the option in the finder to disable keeping trash on certain devices.

I manually did a rm -rf on .Trashes and my record time went from 9 minutes (!) to 2 hours and 11 minutes.  Schweet!

Saturday, June 9, 2012

Need For Speed

Copying a 5GB file around my net.

802.11g - 6 hours
100M ethernet - 11 minutes
GigE ethernet - 2 minutes

Time for a wireless upgrade!

Friday, April 27, 2012

Fringe

David Jones (from Fringe) sounds just like David Attenborough.  That is all.  (Yes, it is a little creepy.)

Saturday, March 31, 2012

Veeam One Free Edition

Veeam One Free Edition is awesome.  Or at least the installer is awesome.  I keeps telling me I have to reboot to complete the install, which I do.  I've done this 5 times.  It's great.  I keep having to reboot and then the installer runs and tells me I have to reboot again.  I wonder what else it does.  I will never know.  Too bad.

VMTurbo Community Edition on the other hand installed as an OVF.  But, apparently it wants to talk to a vCenter server, and not an ESXi host.  Argh!

Saturday, March 24, 2012

Windows 8

Installed Windows 8 Consumer Preview by following the VM setup guidlines at http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2006859.  Complete snooze, everything just worked, no issues (once I had ESXi at the latest level).

Turned on Remote Desktop via http://blogs.technet.com/b/digital_musketeer/archive/2011/09/14/how-to-enable-remote-desktop-on-the-windows-8-ctp.aspx.  Run CMD.exe and SystemPropertiesRemote.exe to turn on.


Tech Gripe

Grrr.  Stupid Sony DCR-HC30.  I had 3 tapes left to convert and now it's decided it can't do DV Out, only DV In.  DOH! DOH! DOH!!

Sunday, March 18, 2012

Patching ESXi

Now that I have a shiny new VM host, decided to try some stuff out.

Windows 8 consumer preview.  Started the install and got a dreaded "Hal_Initialization_Failed".  After googling around and getting nonsense (seriously, it only works as a VM on a windows 8 host?!), found a VMware post (http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2006859) saying to upgrade to the latest level of ESXi.  But I just downloaded it last week!  Evidently they don't rebuild the installer each time so upgrades are in order.  Upgrading is easier said than done.

If you've paid for vSphere, there's a nice management interface for this.  With plain old ESXi hosts, you have to do things the old fashioned way.  I guess that makes sense and they only want the cool tools in their paid product.  It's a big jarring when the trending of software (I'm looking at you Firefox, Chrome, Thunderbird) is to have the app be self aware of new versions and have it update itself.

Here's a post explaining how to do ESXi updates - http://communities.vmware.com/people/vmroyale/blog/2011/09/15/updating-esxi-5--single-use-esxcli-how-to


  • Download VMware vSphere Command-Line interface (CLI).  It's free.
  • Install, and hey, you get ActivePerl.  I already have a perl, but whatever.
  • Next, go to http://www.vmware.com/patchmgr/download.portal and download the latest patch (hint, it's first in the list).
  • Upload it, via vSphere Client, to your favorite datastore.
  • Set your ESXi host to be in maintenance mode (the VMware KB on upgrading tells you how to query the patch to determine if it requires maintenance mode).
  • Use esxcli to see existing system patch levels:  "esxcli --server=[your ESXi host] --username=root software vib list
  • Use esxcli to install the updates: "esxcli --server=[your ESXi host] --username=root software vib update --depot=/vmfs/volumes/[datastore]/[path]/update-from-esxi5.0-5.0_update01.zip"    (your patch file may be newer)
  • Wait 5 minutes until it's done then reboot the host.
Done, worked nicely.  Since the vSphere API is all open source, it should be straightforward to put together software that issues these commands for you to allow you to upgrade from a GUI.  Another project for another day.

 So I continued the Windows 8 install.  No more "Hal_initialization_Failed" error and the install progresses.  Unfortunately I get an error later.  After saying "Preparing" for a little while I get "The computer restarted unexpectedly or encountered an unexpected error.  Windows installation cannot proceed.  To install Windows, click OK to restart the computer, and then restart the installation".  DOH!  Next post on installing Windows 8.

ESXi

Putting together an ESXi box out of some spare parts.

ASROCK Extreme3 Gen3 Motherboard
Core i7 2600 (supports VT-d, newer CPUs 2600K and 2700K do not)

Onboard VGA and nic supported by ESXi 5 right out of the box!

Saturday, March 10, 2012

Future Shock

Worried about our declining resources, and the sorry state of the world?  Then you're really going to need to see this TED talk.

http://www.ted.com/talks/peter_diamandis_abundance_is_our_future.html

Sunday, February 5, 2012

VM on the cheap

Playing around with VMware on some old hardware.

The box, an old P4 collecting dust:
  • Dell Dimension 5400
  • P4 2.26GHz
  • 1.5GB RAM
  • 20GB Disk
10 years old?  My how time flies.  Funny how clock speeds haven't gotten that much faster although density/cores have increased, more work possible per cycle.

It's a 32-bit processor so I'm limited to ESXi 3.5.  Last level to support 32-bit.

VMware


Register, download the .iso, burn to CD, etc.  (Note to self, throw away freecycle those 128MB and 512MB flash drives and just buy a few 4GB ones).

Boot the installer.  First up, it doesn't see my hard drive.  Probably because 20GB is too large and it's refusing to believe it's actually a real disk.  Or maybe it just doesn't like IDE.  Great post here - http://www.vm-help.com/esx/esx3i/ESXi_install_to_IDE_drive/ESXi_install_to_IDE_drive.php.  Got to the install console, edited /usr/lib/vmware/installer/Core/TargetFilter.py, continued installing.  Installed just fine.

Next up, rebooted, ESXi came up but complained about "Failed to load lvmdriver" and the networking was set to 0.0.0.0.  Going into the networking settings on the console gave the option of doing a reset of the driver, but no options to set things.  Turns out my white box network card isn't supported out of the box.  The card uses a Realtek 8169 chip.  To find this out, on the ESXi host console, I did alt-F1 to get the console, typed in "unsupported" (nothing echoes, just type it in) and then you get a login prompt, which lets you do things like lspci to see the devices.

Open source to the rescue, the good guys at http://vm-help.com/esx/esx3i/customize_oem_tgz.php have drivers.  I rebooted the ESXi host with Knoppix, mounted the system partition, then downloaded the mymods-0.1.gz from vm-help.com and saved as 'oem.tgz'.  Rebooted back in to ESXi, reset the network interface, and magic, DHCP started working, and I'm on the net.

I went to the ESXi host via http, logged in, and downloaded the VMware Infrastructure client.  Technically ancient management software, but looks and behaves surprisingly similar to the vSphere/vCenter stuff I'm using at work.

Storage

OK, pretty good, but what about augmenting that 20GB disk space?  I tried iSCSI.  I've set up a Linux iSCSI target before, but I was just lazy and didn't feel like wrestling with my old linux box.  So, I googled around and after discovering that Windows Server 2008 does iSCSI out of the box, but not Windows 7 (WTF?!), settled for the free www.starwindsoftware.com option.

Registered (what, no public e-mail, only corporate?  Hello, 1998 calling.) and downloaded the free version. It installed a bunch of drivers and services and other PC slowing crap that I will probably regret later, but I also have an iSCSI target.  Started the console, activated the free license, and created a test 10GB "device" as an image file and exported it as an iSCSI target.

Back over on ESXi, under the configuration tab, I enabled the iSCSI storage adapter, and defined a new datastore using exported LUN from the iSCSI target.  Schweet, was pretty simple.

VMs

Next up, create a couple of VMs.  I decided to create one on the iSCSI partition, one on the local disk.


First error, on powering on, I get "Admission Check failed for Memory Resource".  Turns out on 1..2 GB systems, the ESXi Hypervisor RAM reservation is too high.  Good page at http://ittechnikt3.wordpress.com/2010/02/16/vmware-esxi-admission-check-failed-for-memory-resource/ on how to change the VIM System Resource Pool advanced setting so that the reservation is no longer 1024MB but 192MB.  Did that and the VM powered on OK.  Installed Ubuntu.

Network


ttcp, from a windows7 box to the VM over gigE I was able to get at most 10MB/sec burst, but sustained things dropped off to about 2MB/sec.  Rebooting the ESXi host to Knoppix and running TTCP, I get about 48MB/sec burst, sustained 43MB/sec.  Unfortunately I can't run ttcp directly on the ESXi host, so it's not apparent if the lack of perf is due to the network driver in ESXi, or virtual server inefficiencies.  Since the guest VM CPU spikes when I do the test, I suspect it's probably the latter, namely that the hardware lacks instructions/support for passing through the network traffic directly and instead has to go through the hypervisor stack.  Old P4.


IO


I installed iozone on both boxes and monitored with iostat.  The local disk VM was about to write about 30MB/s, whereas the iSCSI system wrote about 48MB/s.  The local disk is Ultra DMA ATA 100 (so 100MB/s max bus rated) but the drive is XXXXXX which can only do about XXX MB/s (probably something like 33MB/sec).  The iSCSI system is gigE connected, SATA 6Gb WDC1002FAEX which will do about 126MB/s maximum.  Coincidentally, iSCSI on gigE can do 125MB/s maximum.

Ran another test, with "zcav" just reading.  Local disk got at most 46MB/s iSCSI about 2MB/s.  Yack.  The iozone test was much better (random I/O).  Maybe sequential reads like this have nasty overhead with iSCSI?

Bonnie++ had to say:

Local Disk:  Read about 37MB/sec block input
iSCSI Disk: Read about 20MB/sec block input

Note during the iSCSI disk test, I saw the network use up to about 25 MB/sec.

Friday, February 3, 2012

Time Calculator

Handy Time Calculator if you need to add and subtract hours, minutes, seconds.

Time Calculator

Saturday, January 21, 2012

BodyPump


BodyPump, originally uploaded by nikconwell.

Just wanted to point out actual photographic proof that I was indeed featured on the poster of the recent BodyPump release.

TurboTax Marketing Fail

TurboTax Guides You Like a GPS


Recalculating... Recalculating...  Recalculating...   Whenever possible, make a legal U turn.

Was the Marketing department that hard pressed to find something good to say?  How about some of these better alternatives?


  • TurboTax brews your taxes like an awesome single cup instant coffee maker!
  • TurboTax speeds up your tax return like a pair of high performance running sneakers!
  • TurboTax saves you money like a really super coupon!
  • TurboTax is accurate like a NASA Scientist!