Canada  united states of america usa  linkedinfacebook   Call Us Today: 866.646.6461

Steps to convert a physical disk to a virtual one on a linux system:

Install qemu-utils:

apt-get install qemu-utils

Assuming the physical disk is plugged in and it is /dev/sda, the command is as following:

qemu-img convert -O vdi /dev/sda /full/path/output.vdi

The output.vdi can then be attached as a drive to VirtualBox

journald is systemd's logging service. It is a utility for querying and displaying logs from journald. The logs for this service are stored in /var/log/journal/, which can accumulate quickly. If you have a system that you need to clean up quickly, getting rid of old journals is one way. There are 2 ways to do it: 

By limiting the size of the journal:

journalctl --vacuum-size=200M

Or going by the number of days:

journalctl --vacuum-time=5d

Under normal circumstances, you should not have to touch these directories, as they rotate and space is freed on it's own.

In order to setup the Tomato Firmware router as an access point, the following steps have to be completed. This is a setup for a home environment. If you are setting this up for a workplace, the IP address range should be something other than (as it is too common). Same goes for the Subnet, it should be something other than, if you need more than 254 IPs.

Changing the domain name and hostname in Zentyal server (LDAP) will erase all users and user info (for email) once the Samba has been provisioned. Neverthless, the change can be done by going to System > General.

linux icon 19With the bigger disks that are no longer supported by MBR there's a constant need to convert to GPT.

We have done this using a live disk, however, it is always important to create system backups. The disk was 6TB, with 2 smaller live partitions. Without converting to GPT we could not take advantage of the entire disk capacity. Assuming that the disk is /dev/sdb (the first 2 partitions are /dev/sdb1 and /dev/sdb2). Below instructions are not for a bootable disk, rather a secondary partition.

linux icon 19On occasion you may get a nasty error like this (BadCRC generally means bad sectors):

[4530467.649165] ata2.00: exception Emask 0x10 SAct 0x60000000 SErr 0x280100 action 0x6 frozen
[4530467.649608] ata2.00: irq_stat 0x08000000, interface fatal error
[4530467.650043] ata2: SError: { UnrecovData 10B8B BadCRC }

But the problem is mapping the drive ata2 to an actual disk drive device. This can be achieved by running this command:

linux icon 19This is how you can find out which IP is assigned to a computer using dnsmasq. Unless you've specified a different log for dnsmasq, the output will go into syslog (/var/log/syslog).

A quick way to isolate the requests, is by running this command:

cat /var/log/syslog | grep "DHCPACK"

This will produce a list of IPs assigned, with a MAC address and hostnames:

linux iconThis is a nice little command to search and replace one type of content with another. It recursively parses through directories and files.

Be very careful when running this command, because it can do a lot of damage

Below is an example of replacing all "http" with "https" inside a directory /var/www:

postfix-emailSometimes we have emails going to a particular address, which cannot be stopped. There are many reasons, but most common is an invalid address, which pollutes the mail queue with invalid entries. The simplest way to solve this is by adding a DISCARD directive for postfix. 

If you don't have it already, add this line in

header_checks = regexp:/etc/postfix/header_checks

Last updated Mar 11, 2023