A chronological documentation test project, nothing serious, really!

10 Jul 2013 Mount VMware virtual disk VMDK-file in a physical linux machine

This example has been used on a machine with VMware Workstation 9 installed locally.
To mount a VMDK-file you can use the VMware command vmware-mount like this

$ sudo vmware-mount /path/to/vmdk/file/name-of-vmdk-file.vmdk 1 /path/to/mount/point
In the example above we have mounted partition 1 in the VMDK-file from the disk /path/to/vmdk/file/name-of-vmdk-file.vmdk
The files are now accessible from the mount point /path/to/mount/point.

This has been tested in Ubuntu Linux 12.04 LTS.
This command is also available in the Windows version of VMware Workstation.

Tags: , , , ,

Posted by

09 Jul 2013 Add new harddisk to linux without reboot

This is a short post on how you can add a new SATA og SCSI harddisk in your running/live linux machine without a reboot.
The BIOS of the machine is not aware of new hardware being added, but you can ask the disk controllers to rescan and become aware of new harddisks.

This is how you force a rescan of the SCSI controller in your linux machine
$ sudo echo "- - -" > /sys/class/scsi_host/host3/scan
I used host3 because the disk was connected to that controller, but you should replace it with the controller you use.

To see the result of the rescan you can issue the dmesg command
$ sudo dmesg
[ 3117.041231] ata3: hard resetting link
[ 3117.371445] ata3: SATA link down (SStatus 0 SControl 300)
[ 3117.371464] ata3: EH complete
[ 3128.224802] ata4: exception Emask 0x10 SAct 0x0 SErr 0x4050000 action 0xf
[ 3128.224809] ata4: SError: { PHYRdyChg CommWake DevExch }
[ 3128.224818] ata4: hard resetting link
[ 3129.100450] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 3129.108545] ata4.00: ATA-8: ST31500341AS, HP23, max UDMA/100
[ 3129.108550] ata4.00: 2930277168 sectors, multi 0: LBA48 NCQ (depth 0/32)
[ 3129.140500] ata4.00: configured for UDMA/100
[ 3129.151034] ata4: EH complete
[ 3129.151159] scsi 3:0:0:0: Direct-Access ATA ST31500341AS HP23 PQ: 0 ANSI: 5
[ 3129.151491] sd 3:0:0:0: Attached scsi generic sg1 type 0
[ 3129.151568] sd 3:0:0:0: [sdb] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
[ 3129.151895] sd 3:0:0:0: [sdb] Write Protect is off
[ 3129.151900] sd 3:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 3129.152052] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3129.176718] sdb: sdb1
[ 3129.178535] sd 3:0:0:0: [sdb] Attached SCSI disk
[ 3571.306535] ata4: hard resetting link
[ 3571.781238] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 3571.821270] ata4.00: configured for UDMA/100
[ 3571.831850] ata4: EH complete
[ 3756.103000] ata4: hard resetting link
[ 3756.574619] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 3756.614674] ata4.00: configured for UDMA/100
[ 3756.625209] ata4: EH complete

This example has been tested on Ubuntu 12.04, but should work on any other linux flavour available.
This post was highly inspired by that also describes how you remove devices etc withour reboot. This is a great way to add new harddisk to a virtualized linux server that cannot be rebooted.

Tags: , , , ,

Posted by

07 Jul 2013 Another way to randomize filenames

This post describes an easier way to randomize filenames using the command openssl compared to my previous post named Randomize filenames.

for filename in *.JPG
mv "$filename" $(echo "$filename" | openssl rand -hex 3).JPG

After running this script the filenames can look something like this


The rand option creates a random value from $filename.

Tags: , ,

Posted by

04 Jul 2013 Install free VMware 5.1 Hypervisor on HP Z600

This is just some short notes on how you can manage to install the free VMware 5.1 Hypervisor on a HP Z600 Workstation.
I assume you have already downloaded the installer from

As always when you would like to utilize virtualization in your CPU you have to enable the following BIOS settings

  • Advanced Chipset settings > Intel VT-D > Enabled (Allows passthrough of hardware to a VM)


  • Update your BIOS to the latest version
  • Disable “Max CPUID Value Limit” option in BIOS

Without making this change in BIOS the installer would stop with the Purple Screen Of Death (PSOD) and the error message “can’t detect the last level cache”.

If you have a old BIOS that does not support booting from a GPT partition then you need to change this at the beginning of the installation.

Press Shift+O during and type in space and


The boot option will now look like

runweasel formatwithmbr

You should now be able to install ESXi 5.1 on you HP Z600.
This might work on other HP models as well.

Tags: , , , ,

Posted by

04 Jul 2013 Transfer files fast between servers using netcat and tar

This is a short post on how you can transfer files unsecured but fast between linux servers. I prefer to use netcat (nc) to transfer large amounts of data between servers when I know the connection between them are secure, ie on my private LAN.

The sender server should run the following command

$ tar cf - folder | netcat 9000

and the receiveing server should listen with with this command

$ netcat -l -p 9000 | tar x

Tags: , ,

Posted by