Technology Tales

Adventures in consumer and enterprise technology

TOPIC: NULL DEVICE

Incorporating tmux in a terminal workflow

11th March 2025

As part of a recent workstation upgrade and subsequent AI explorations to see what runs on a GPU, I got to use tmux to display two panes within a terminal session on Linux Mint, each with output from a different system monitoring command; one of these was top for monitoring system processes in a more in-depth way. Some of that need has passed, yet I retain tmux and even set to open in a new terminal session by adding the following code to my .bashrc file:

if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
    tmux new
fi

This tests if tmux is installed and that this is not running in an existing tmux session before opening a new tmux session. You can also attach to an existing session or use a new default session if you like. That changes the second line of the above code to this:

tmux attach -t default || tmux new -s default

Wanting to have everything fresh in a new session, I decided against that. While I have gone away from using tmux panes for the moment, there is a cheat sheet that could have uses if I do, and another post elsewhere describes resizing the panes too, which came in very useful for that early dalliance while system monitoring.

Wiping of hard drives with Linux

2nd December 2013

More than a decade of computer upgrades can leave obsolete kit in your hands, while legislation on electronic waste disposal might leave you wondering how to get rid of it. Thankfully, I discovered that my local council refuse site, only a few miles away, accepts such items for recycling. It saw me several times last summer disposing of obsolete and non-working gadgets that had stayed with me too long. Some were as bulky as computer monitors and printers, while others were relatively small.

Disposing of non-working, obsolete equipment is an easy choice, but it's harder when a device still works and might be useful. Computer motherboards still include PS/2, floppy and IDE ports, making decisions trickier. My Gigabyte Z87-HD3 mainboard has one PS/2 port (compared to two on older boards), limited IDE sockets and surprisingly, a floppy drive socket, unexpected for anyone who considers these technologies outdated. PC technology isn't abandoning backwards compatibility yet, as this mainboard supports an Intel Core i5-4670K CPU and 24 GB of RAM.

Despite the IDE port, I wasn't tempted to use my leftover 10 GB and 20 GB hard drives that I've had for over a decade. Ten years ago, that capacity would have been respectable if not for our growing need for data storage due to photography, video and music. Beyond size limitations, these drives' speed can't compare with today's standards, which became obvious when I replaced a similarly aged Samsung 160 HD with a Samsung SSD.

This line of thought led me to recycle the drives, so I considered wiping them. Linux offers a good tool for this: the dd command. It can overwrite disk data to make information virtually irretrievable. Linux also has several dummy devices that supply junk data for overwriting. These work like /dev/null, which suppresses command output. The first is /dev/zero, which supplies octal zeros, which I used. For those wanting more randomness in overwriting, there's also /dev/random and /dev/urandom.

To overwrite data on a disk with zeroes while having feedback on progress, the following command achieves the required result:

sudo dd if=/dev/zero | pv | sudo dd of=/dev/sdd bs=16M

The operation needs root privileges. The if parameter of dd specifies the input data, which is sent to pv that displays a progress bar not provided by dd alone. The output then goes to another dd command with the target disk specified by the of parameter. The bs parameter in the second dd command sets the block size for writing. Note that pv isn't installed by default. On Debian, Ubuntu or Linux Mint systems, install it with this command:

sudo apt-get install pv

The pv sandwich is also invaluable when using dd to copy partitions between different physical or virtual disks. Without it, you might wonder what's happening during silent operations, which is particularly concerning when retrying failed operations that take a long time to complete.

  • The content, images, and materials on this website are protected by copyright law and may not be reproduced, distributed, transmitted, displayed, or published in any form without the prior written permission of the copyright holder. All trademarks, logos, and brand names mentioned on this website are the property of their respective owners. Unauthorised use or duplication of these materials may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties.

  • All comments on this website are moderated and should contribute meaningfully to the discussion. We welcome diverse viewpoints expressed respectfully, but reserve the right to remove any comments containing hate speech, profanity, personal attacks, spam, promotional content or other inappropriate material without notice. Please note that comment moderation may take up to 24 hours, and that repeatedly violating these guidelines may result in being banned from future participation.

  • By submitting a comment, you grant us the right to publish and edit it as needed, whilst retaining your ownership of the content. Your email address will never be published or shared, though it is required for moderation purposes.