Create a Disk Image With dd Command

Situation: I want to re-use an external drive which already contains some data. So I will create a disk image on an external drive in case I need to copy that image back to the drive in the future. Solution: Normally, I just run dd to create an file.img when the disk is small, e.g. SD card. However, the drive capacity is 512GB. So a better option is to compress the image....

March 19, 2022 · 2 min · 246 words · kenno

mkfs.xfs: cannot open /dev/sda1: Device or resource busy

I’m trying to create an XFS filestem on a used disk, and got into a problem. Here is the error message: # mkfs.xfs /dev/sda1 mkfs.xfs: cannot open /dev/sda1: Device or resource busy So, let’s see if I can fix it. (Spoiler alert: I think I can, even though it’s not yet done at the time of this writing.) Let’s check the partitions of /dev/sda: # parted /dev/sda print Model: ATA ST1000LM014-1EJ1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 512GB 512GB ntfs 1 So, there is a partition (/dev/sda1) with 512GB in size, and its filesystem is ntfs....

March 13, 2022 · 4 min · 703 words · kenno

Using xclip to copy terminal content to clipboard

It’s quite annoying when I know the command I can use to copy the content on a terminal to clipboard. I know, I can run man xclip, but I think it’s still easier for me to visit this page and see how to do it. For example, I want to copy the content of my ssh keypair, ed2559.pub, to clipboard, and here how it can be done: ➜ xclip -sel clip < ~/....

March 4, 2022 · 1 min · 142 words · kenno

LVM - How to Activate or Deactivate a Volume Group

Well, I hardly need to activate or deactivate LVM volume groups. But when I do, I also hardly remember the command required to do that. So hopefully, I can refer to this post should I need to perform one of these tasks in the future. Since a volume group is activated by default when it is created, let’s start with a command to deactivate it. # vgchange -a n example_volume_group Like wise, to activate a volume group, use the following command:...

February 3, 2022 · 1 min · 114 words · kenno

FreeIPA reset failed locked out admin account

This is a short note on how to unlock admin account for FreeIPA. # kinit admin kinit: Client’s credentials have been revoked while getting initial credentials When too many incorrect password attempts are made, the admin account is locked out. To unlock it, perform the following on the FreeIPA server: # ldapmodify -x -D "cn=directory manager" -W Enter LDAP Password: dn: uid=admin,cn=users,cn=accounts,dc=example,dc=com changetype: modify delete: krbLoginFailedCount To process the modification enter Control-D....

February 3, 2022 · 1 min · 94 words · kenno

Freeipa Unable to Communicate With Cms 403

A new post, a new problem, and a solution. Earlier today I worked on a task involving SSSD, System Security Services Daemon, a system service to access remote directories and authentication mechanisms. It got both excited and a little worried at the same times, since it’s been a long while since I had do anything with SSSD. Fast forward to the evening, I realized I had a FreeIPA server set up a long time ago right after passing the Red Hat Certified Specialist in Identity Management exam (EX362)....

February 2, 2022 · 1 min · 201 words · kenno

Foreman: Create a new product & repository for AlmaLinux

A few days ago I started to re-surrect my Foreman(/katello) server and wanted to use it to pull content from remote repository for AlmaLinux. This involves updating Foreman with a new product and related AlmaLinux repository. I wrote a similar post on creating product & repository using hammer before for EPEL 8. However, it’s been a long while and things could change with the current version of Foreman server. # rpm -qa | egrep -i '^foreman-[0-9]|^katello-[0-9]|^pulp-server-[0-9]' katello-4....

January 30, 2022 · 4 min · 669 words · kenno

Resizing KVM qcow2 Image

I’m quite sure I’d resized qcow2 images before. However, when I needed to resize an image today for my VM at home, I totally forgot about it. Well, this means it’s a good excuse for me to just write down a few commands to help me in the future. If you try to follow a long, two things you wanna keep in in mind: do it at your own risk, and always backup your data before you make change to it....

December 25, 2021 · 5 min · 902 words · kenno

bash: append_path: command not found

I have a few Raspberry Pi at home, they’re used for specific purposes such as Kodi media player, Pi-hole server, and a backup DNS/DHCP server. Recently, I need to turn on the backup DNS/DHCP server, which is one of the Raspberry Pi devices running Arch Linux. When I logged into to the server, I saw a message complaining that bash: append_path: command not found. It’s been so long since this little server, so I can’t remember what happened last time....

December 9, 2021 · 3 min · 596 words · kenno

Set default window's dimensions for Alacritty

I haven’t really posted anything new recently as I’ve just had a big transision in my career. I may or may not write about this in the future, as I don’t think it’s that relevant to you. Anyway, I’ve been having this trouble with window size of Alacritty being too small on launched.First what is Alacritty? It’s an terminal emulator written in Rust. It also makes use of GPU-acceleration, which should improve some performance in theory....

November 17, 2021 · 1 min · 201 words · kenno