Category Archives: Linux System Administration

Notes from administering and working with Linux based servers.

View ‘dd’ progress

When reading/writing a disk image using Linux tool ‘dd’ launch as follows:
dd if=/dev/sdb of=filename.img & pid=$!
this will run ‘dd’ in the background.

To see the progress:
kill -USR1 $pid
(it will not kill the dd)

Notes:

  1. If you are doing it as a non-root user you’ll need to prefix those commands with sudo
  2. If you do that do ‘sudo ls‘ first, otherwise the ‘sudo dd‘ will fail waiting on the password which it’ll never get as its backgrounded.

Thanks to Cian.

Exporting physical Linux hard disk to a Virtual Machine

Shutdown and remove the hard disk, then connect to a separate PC with VirtualBox (virtualbox-ose) installed.

  • Take a ‘dd’ copy of the hard disk, eg: dd if=/dev/sdb of=filename.img
    (warning this may take a while and requires enough free disk space to hold a copy of the entire hard disk being cloned)
  • After the image has been successfully created, convert it to an image suitable for VMWare or VirtualBox using the command:
    vboxmanage convertfromraw filename.img -format VMDK filename.vmdk
  • This can be imported into VirtualBox by creating a new (Linux/Other Linux) Virtual Machine and “Use existing hard drive”. Click the browse button to go to the Virtual Media Manager, click ‘Add’ and select the VMDK file created in the previous step.

The virtual machine should now be ready to run in VirtualBox.
To import into VMWare, create a new virtual machine and virtual hard disk. Overwrite the new Virtual Hard disk by copying the VMDK file created earlier, into its place.

Asterisk-oh323, GnuGK with VPoint-HD

A warning to all: audio does not work full-duplex when calling from a VPoint (VCON Emblaze) H323 client -> GNUGK -> Asterisk-oh323 -> SIP client. Tested with versions 8 and 10.

However audio works perfectly in the other direction.

The solution would appear to be to use OOH323. However the audio is again half duplex in the scenario where SIP clients are calling H323 clients.
Therefore calls originating from Asterisk to H323 clients use the ‘OH323’ module, and calls from GNUGK into Asterisk use the ‘OOH323’ module.

Checkinstall – easy way to build RPM and Deb packages

Thanks to the kind people in #asterisk (irc.freenode.net) I found: Checkinstall

This is a very quick and easy was to make your own RPM and Deb packages. When compiling your package, instead of running “make install” run: “checkinstall”

To build for most distributions, the configure script should be executed with the following options:
./configure –prefix=/usr –sysconfdir=/etc
so that executables, libraries and configuration files are installed to the expected locations.