Adding an HDD on Debian and Formatting It with xfs

how to add hdd and format it with xfs on Linux(Debian)

In Linux environments I often have occasion to add an HDD after the fact, so I am writing it down again. (About ten years ago I posted a similar article (adding an HDD with fdisk from the command line (in Japanese))) Environment The Linux used is Debian 12 The format is xfs The HDD to be added is 4TB I assume Linux (Debian) is already running and the HDD to be added is already installed [Read More]

Upgrading Debian 11 bullseye to Debian 12 bookworm

How to upgrade Debian 11 to 12

I have written about Debian upgrades several times, so this update is almost the same work as the previous Upgrading Debian 10 to 11 .

The only difference is a small change to sources.list when adding non-free.
After main in each repository stanza of /etc/apt/sources.list, add non-free non-free-firmware.

#deb cdrom:[Debian GNU/Linux 12 _Bookworm_ - Official Snapshot amd64 LIVE/INSTALL Binary 20230610-08:51]/ bookworm main non-

deb http://ftp.riken.jp/Linux/debian/debian/ bookworm main non-free non-free-firmware
deb-src http://ftp.riken.jp/Linux/debian/debian/ bookworm main non-free non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://ftp.riken.jp/Linux/debian/debian/ bookworm-updates main non-free non-free-firmware
deb-src http://ftp.riken.jp/Linux/debian/debian/ bookworm-updates main non-free non-free-firmware

As an aside, a direct jump from 10 to 12 failed in my case, so when upgrading from an older release it is safer to go in order (10→11→12).

Installing Homebrew on Linux: Debian, Ubuntu, and RedHat

how to install homebrew on Linux

Homebrew has become pretty much the standard on macOS, but these days you can install Homebrew on Linux too. On Debian and RedHat you can manage packages with apt or dnf (yum), but Homebrew makes it easier to install and update programs that are not in those packages and are not published as a repository. For example, tools I use often such as Hugo, Docker’s docker-compose, and lazydocker have to be downloaded from the official site and swapped out every time there is an update, but this can now be simplified to something like brew update hugo, just as on macOS. [Read More]

Fixing Bloated Container Logs in /var/lib/docker/containers

Dealing with bloated Docker logs

An LDAP server running on Docker had reached 100% disk usage, so I looked into it. This LDAP server is close to read-only, so the data should not grow that much, should it? Copy # du -sh /var/lib/docker/* |sort -n 1.2G /var/lib/docker/overlay2 2.1M /var/lib/docker/image 4.0K /var/lib/docker/runtimes 4.0K /var/lib/docker/swarm 4.0K /var/lib/docker/tmp 4.0K /var/lib/docker/trust 4.4M /var/lib/docker/volumes 7.8G /var/lib/docker/containers 20K /var/lib/docker/builder 24K /var/lib/docker/plugins 60K /var/lib/docker/network 108K /var/lib/docker/buildkit /var/lib/docker/containers is clearly the one using a lot of space [Read More]

When a Dell PowerEdge Refuses to Boot from a USB Drive

Can the Dell PowerEdge boot from a USB

I wanted to install Debian on a PowerEdge R410 that I no longer used, so I created a bootable USB disk, but even after setting USB as the highest boot priority in the BIOS it would not boot from the USB, and I spent several hours on it. When I looked for a solution on the internet, the article below was a perfect match The boot solution On the startup screen (while the Dell logo is showing), press F2 to open the BIOS setup screen. In the BIOS settings, change USB Flash Drive Emulation Type from AUTO to Hard Disk. Save the settings and leave the BIOS setup screen (it reboots) On the startup screen (while the Dell logo is showing), press F11 to open the boot media selection. In the boot media selection, the USB flash media appears under the “Hard Disk” entry, so choose to boot from the USB flash media. The installer boots from the USB without trouble. The network is unusable The NIC is recognized, but it cannot connect to the network [Read More]

Moving /var/lib/docker to Another Partition with a Bind Mount

Moving /var/lib/docker and using a bind mount on Debian11

The root partition (/) of the machine I run Docker on was getting tight, so I moved /var/lib/docker These days, when you install Linux without thinking about it, the automatic configuration often gives the root partition (/) something small such as 30GB. When you run Docker, /var/lib/docker grows and grows, so / ended up in a state close to full. So I moved it to /home, which is on a separate partition and has room to spare [Read More]

Cannot Create Files or Directories in the Home Directory on Debian

Permission denied in the home directory, caused by tracker-miner

After logging in to a certain Linux (Debian) machine, I ran into a symptom where I could not create files or directories. Copy $ mkdir test mkdir: ディレクトリ `test' を作成できません: 許可がありません $ touch test touch: 'test' に touch できません: 許可がありません I tried various things Logging in works normally Checked the UID and GID with the id command Checked the attributes of the home directory and its contents Tried changing the shell None of them showed a problem, and when I looked at the error log, there was an error like the one below [Read More]

Upgrading Debian 10 buster to Debian 11 bullseye

How to upgrade Debian 10 to 11

I have written about Debian upgrades several times, but the update procedure differs subtly from version to version, so it ends up being a separate article every time. This time it is the update procedure from Debian10 (buster) to 11 (bullseye). Checking Copy $ cat /etc/debian_version 10.11 Updating packages Copy $ sudo apt update $ sudo apt upgrade $ sudo apt dist-upgrade $ sudo apt autoremove Updating the source list (from buster to bullseye) There are changes, so be careful: it will not go well if you only change sources.list from buster to bullseye the way you used to. [Read More]

Overriding the LDAP Login Shell on Debian and CentOS Clients

override LDAP login shell

There are cases where, on a particular LDAP client machine, you want to use a different shell rather than the one defined on the LDAP server (bash) This is possible by configuring the Linux (Debian/CentOS) client to override the shell Debian11(bullseye) Add the following to /etc/libnss-ldap.conf (look up the path to the shell beforehand) Copy nss_override_attribute_value loginShell /usr/bin/zsh Flush the nscd cache Copy # nscd -i passwd nscd CentOS8 Add the following to /etc/nslcd.conf [Read More]

Hardening a Docker Mail Server on Sakura VPS

Enabling SpamAssassin, ClamAV, Fail2ban, Postgrey and Let's Encrypt in docker-mailserver

This is a follow-up to Building a mail server with Sakura VPS + Docker + Freenom , in which I tighten up the security a little If the server from last time is running under docker, stop it Copy $ docker-compose down Closing imap and submission In the previous article I confirmed that imaps and smtps communication works, so I close imap and submission docker-compose.yml (only the changed parts are shown) [Read More]