Home Of The McMuffin

Archive for July, 2009

Why have we given up on Freedom?

“They may take our lives, but they will never take our freedom!” screamed William Wallace in the blockbuster movie Braveheart.  This was the moment in the movie when William Wallace was rallying his Scottish countrymen against an insurmountable task of defeating the oppressive British Army and the words nicely summed up what was important in life to him and his countrymen.

I wonder, in these times where we seem to no longer either stand for or up for anything:  “Would the movie Braveheart or any of the other epic movies about man’s struggle for freedom from tyranny be as successful”?  Based on the attitudes and unrequested opinions of the media and the people I see and hear from every day I would answer this question with a resounding “no”.

Here are some examples of the vanishing of our freedoms or our beliefs in freedom that I have observed and have to wonder just how we got to this point.

First of all, does no one realize just what nationalized health care will do to our freedom to choose medical care that is best for ourselves and our families?  Instead of insurance companies competing with each other to provide the largest variety of medical options at the lowest costs, we are going to be given a one size fits all medical plan.  In this plan a bureaucrat appointed by some political figure will decide for the doctors what medical treatments they can offer you for any of your particular ailments.   Expensive medical procedures will never be approved by the bureaucracy and therefore much of the American innovation in health care will slowly die away as profits from innovative new drugs and procedures decline.  On top of that, your choice about when and where you can have a medical procedure that is approved performed will be non-existent.  In other socialized countries, you may have to be on a waiting list for months just to get in for the most basic medical procedures.   Has anyone even thought of the fact, that you could be sitting on a list for months to get a procedure behind 50 other people that don’t work and contribute no money into this health care system?

Why are we ignorantly standing by while our president down plays or ignores everything that our country has done to promote freedom in this world?  The United States in the past 50-100 years has done more to promote humanitarian justice, and personal freedom throughout the world than any other entity in the in history.  People of many countries live in freedom now because  the United States stood up against dictators on the principle that freedom is an ideal worth fighting for.  Now our President is sending pokes and hugs from his Facebook page to every murderous dictator in the world and saying he’s sorry for the years of grief we gave them for treating human life with no respect.

Traditionally the left in our country have been the ones that stand against censorship of things such as pornography and explicit lyrics in music.  However, they are now the same ones that are pushing for laws to watch everything we do in our daily lives from our phone calls to our Internet usage.

And… What about our right to work hard and prosper?  Isn’t that the basis for what freedom means?  Those that work hard should reap the rewards while those who sit around, smokin’ their shit and playing video games all day should not attain the wealth that the rest of us have worked for.  Well, that’s all changing, in the eyes of the left, prosperity is an evil that must be done away with.  The theory behind it is that all people no matter what class, education etc should have the same level of wealth and be able to lead the same lifestyle.  Basically, those of us that do earn enough should make sure that we pay for the others to live as comfortably as we do.  Is this freedom?  Answer… No.

I could go on and on about the changes we are undergoing that will take away the freedoms that have made us the best, strongest, most innovational country in the world.   But I’d love to hear what you think first and maybe continue this from there.

Share and Enjoy:
  • Digg
  • Twitter
  • RSS
  • Facebook
  • del.icio.us
  • email
  • StumbleUpon
  • Reddit

Shrinking a Linux VMware image disk size

VMware workstation, Infrustructure and other VWware tools have capabilities built in for resizing your disk when running a Windows VM.  However, there is no such automated support for changing especially reducing the size of your VM disk for Linux VMs.  I have recently been able to accomplish shrinking a Linux VMware disk from 80GB to 10 using the process outlined below.  I have not found a similar process documented online thus far.

Please note, that I have tested this process only twice and in no way do I standby the results.  Please make sure when doing any changes to your system that you always make backup copies!!!  If you find this useful or have alternative methods for accomplishing such changes please post them or correct me where I may have missed a step in this documentation.

Preparation for disk changes

Gracefully shutdown your real source VMware image. Copy your existing VMware image folder, to another folder.  Open the image in VMware workstation and remove all of the snapshot files.  This new copy will now be referred to as your source image/disk.

Using the VMware Workstation or similar application defragment your source virtual disk.

Download a copy of SystemRescueCD ISO. (This is a CD bootable Gentoo Linux distro with many recovery applications)

RESIZE LINUX PARTITIONS

This step does not resize VMware virtual disks, that part is further down.

You may need to first shrink the partitions on your source disk so they are the size that you want them to be iny our final VMware image. Before using the process below you must copy your existing VMware image directory to a new backup copy directory and remove any snapshots.  This will be your new source image.

Get and save current file system info from each of these commands:  df, “df -B 4k”, “df -h”, “fdisk -l”, “fdisk -s /dev/sda1″ (or equivalent root partition).

    • Shutdown the system and boot using CD ISO file: SystemRescueCD  (Knoppix also will work).
    • After shutdown use VMware Workstation and edit the source image so that the CD/DVD is added at power on.

    • Also ensure that the CD/DVD is configured to use a bootable Linux CD ISO such as SystemRescueCD or Knoppix

    • Start the VMware image. (This part is tricky as you have to be very fast): As soon as you see the black and white VMware screen click the screen with your mouse and immediately hit escape to break out into the Bios.  The VMware window only flashes up for about one second so if you don’t get it you may need to try again, although then using <ctrl+alt+ins> and then <escape> afterwards may also work.

    Once your bootable Linux is started

      • ensure that the partitions that you are going to adjust are not mounted.
      • fsck -n /dev/<partition>  (Copy output to your notes)

      • tune2fs -O ^has_journal /dev/<partition>  (Removes the journal from the partition)

      • e2fsck -f /dev/<partition>  (Copy output to your notes)

      • resize2fs /dev/<partition> 6000M   (!!!! Take note of block size and number of blocks!!!)

      • fdisk /dev/<root disk partition> {i.e. /dev/sda} (delete our partition and creates a new smaller partition)
        • type m to get a list of commands
        • d  (to delete a partition)
        • partition number: X (sda1 =1, sda2=2 ….)
        • n (for new)
        • P (for real partition)
        • partition number: X
        • first cylinder:  (value for partition we saved from fdisk -l output earlier)
        • last cylinder:  (Can specify size in KB, calculated: <amount of blocks from resize2fs output> * <size of a block (4k)> * 1.03    (answer will look like: +3164160K)
        • w (write partition table)
        • Add the ext3 journal systems back to the partition using tune2fs -j /partition/name

      COPY LINUX DISKS TO NEW VMware INSTANCE TO RESIZE DISKS (whole disk)

      NEW DESTINATION IMAGE

      • Create a new Linux VMware image in Workstation that has the disk size that you wish to end up with.

      • Edit the CD/DVD so it uses a bootable Linux ISO image to boot from (SystemRescueCD or Knoppix)

      • Boot the new image

      • Use ifconfig to set an IP, the only requirement here is that it be in the same subnet that you will have your source VMware connected to while doing the backups.

      • Assuming your destination disk is /dev/sda  run the following command to listen for and copy the backup data to your drive:

      • Set netcat listener with binding to dd. nc -l -p 10001 | dd of=/dev/sda bs=4k

      OLD SOURCE IMAGE

      • Gracefully shutdown your source VMware image

      • Using Workstation defragment your virtual drive

      • Configure the image to use the CD/DVD at power on

      • Configure the CD/DVD to mount a bootable Linux ISO  (SystemRescueCD or Knoppix)

      • Boot the system using the CD (This can be tricky.  Have to quickly click on the bios screen and hit escape.  If missed try <ctrl+shift+ins> then escape.  If not then restart again and be faster)

      • Once booted, set the interface IP address to be in the same subnet as the destination image.  (test with ping)

      • Assuming your source drive is /dev/sda, start the backup to destination using the following command

      • dd if=/dev/sda bs=4k conv=sync,noerror | nc <dst-ip-address> 10001 (This starts DD bit-by-bit copy process and pipes the bits from standard out to netcat over to a maching at <dst-ip-address> which is running a netcat listener.

      Notes:  If you can’t get network between the two, you can use a USB drive by creating a new dir i.e. /mnt/ext and mounting it to /dev/sdb1 in most cases.

      Share and Enjoy:
      • Digg
      • Twitter
      • RSS
      • Facebook
      • del.icio.us
      • email
      • StumbleUpon
      • Reddit