Debian Sysadmin Tech

Software RAID1 On Running Debian Stretch LVM + GRUB2

I needed to setup a software RAID1 on a Debian Stretch server where I had no KVM access, so I had to make do with just SSH and rescue access.

I was following this tutorial for How To Set Up Software RAID1 On A Running LVM System (Incl. GRUB2 Configuration) (Debian Squeeze) but ran into some problems. Not sure if it was the version of Debian being different or something else from the hosting pre-installed Debian.

saving /etc/mtab edit

When attempting to save the edit to /etc/mtab I was getting the error:

error writing /etc/mtab invalid argument

So, I ended up using sed:

sed -e "s/dev\/sda1/dev\/md0/" -i /etc/mtab

Doing a cat /etc/mtab showed the correct change but I doubt this made much of a difference and could probably have skipped this step. Not sure but it didn’t hurt.

creating /etc/grub.d/09_swraid1_setup

I added a few lines from /boot/grub/grub.cfg menuentry stanzas in the ### BEGIN /etc/grub.d/10_linux ### that looked to me were missing from the provided menuentry example.

Again, not sure if it made a difference but it worked.

pvmove Insufficient free space

When attempting to do the step:

pvmove -i 2 /dev/sda5 /dev/md1

I was getting the error:

Insufficient free space: X extents needed, but only Y available

As I ended up partially breaking the filesystem a couple of time, trying to solve this, I ended up just requesting a clean install and restarting the tutorial after the step:

sfdisk -d /dev/sda | sfdisk --force /dev/sdb

Booting into live rescue and following How to Shrink an LVM Volume Safely.

The idea on my case was to make ‘/dev/YOUR-VOLUME-GROUP/root’ 1GB smaller.

As my drive had Tb, I had to use the following to determine the GB:

pvs --units g

After that I rebooted back into the system and continued the tutorial and the pvmove problem was gone.

Other issues from live rescue on this particular hosting service:

The version of e2fsprogs and resize2fs was old and I was getting the error “has unsupported feature(s): metadata_csum” or “Filesystem has unsupported read-only feature(s) while trying to open”

I had to upgrade to ‘e2fsprogs-1.43.1’

When attempting to do:


The server in live rescue wasn’t able to resolve DNS, so I had to use curl to hack something:

curl -o e2fsprogs-1.43.1.tar.gz

This showed me one of the download server domains from SourceForge and I pinged that domain to get the IP and used –resolve to be able to reach it, like this:

curl -o e2fsprogs-1.43.1.tar.gz --resolve --resolve

After that I was able to install it:

tar xzf e2fsprogs-1.43.1.tar.gz
cd e2fsprogs-1.43.1
make install

And had to use ./e2fsprogs/e2fsprogs and ./resize/resize2fs as my commands.

Issues that I ignored

  • the ‘mount’ command was still displaying /dev/sda1 before the reboot
  • ‘update-grub’ was returning a few ‘grub-install: warning: Couldn’t find physical volume `(null)’.’ errors
  • the final ‘update-initramfs -u’ required me to do ‘update-initramfs -t -u’

Intel Mac Tech

Mac Mini 2018 graphics Intel UHD 630 and 4K Monitor

The Mac Mini 2018 comes with Intel UHD 630 graphics without a possibility to upgrade unless you use an external eGPU.

I was a bit worried about how it would perform with a 4K monitor scaled at 2560×1440. I use 27 inches 4K monitors and they need to be scaled to 2560×1440 as MacOS default resolution from a 4K monitor (3840×2160) is 1920×1080 and that is way too big for 27 inches.

The problem with scaled resolutions in MacOS is that they degrade performance, as internally the resolution needs to double and then be shrunk down. In my case 2560×1440 is in fact 5120×2880 (5K). As the warning mentions when you scale in System Preferences->Monitors “Using a scaled resolution may affect performance”.

I bought the base configuration Mac Mini in 2020, the 2018 Mac Mini in 2020 comes with 256GB SSD PCIe and the same Intel Quad-Core i3-8100 (graphics UHD 630) and 8GB of RAM.

My plan was to upgrade the RAM myself and save some money and I did to 16GB.

When I initially tried the Mac Mini with 8GB of RAM and scaled resolution there was some noticeable slowness (visual lag and stuttering) in the UI, most noticeable to me when scrolling and on entering/exiting Mission Control. I was getting a bit frustrated/worried but the strange thing is that the graphics history in Activity Monitor didn’t report large spikes in usage during those actions.

After upgrading to 16GB of RAM it felt much smoother. Probably not as smooth as running default scale but for me it has been working fine.

Mac Monitors Tech

Cheaper high resolution external ISP Monitor for Mac (retina like)

For a long time that I wanted to have a “retina” screen on my desktop but as I work from multiple locations (and needed to buy more than one monitor) I wanted a solution that was not expensive and where I could plug and play from a Macbook or Mac Mini.

I knew I needed to go 4K or 5K to get the crisp text and high resolution images but the cheaper monitors use TN or VA panels and those suck in terms of color accuracy, viewing angles and general brightness. So, I knew I had to go with ISP (or OLED but currently OLED monitors are rare and very expensive).

After multiple searches I decided that the LG 27UK850-W (ISP 27 inches 4K) monitor would be a good solution. It had good color accuracy (with some configuration), little distortion from different angles and USB-C that allowed for single cable setup with a MacBook (charge+image+passthrough for USB hub).

Still, this was not cheap and when I finally decided to buy a second monitor for another location, I went with the LG 27UL550-W (ISP 27 inches 4K). The panel is vey similar. The 550 loses some peak brightness, it also loses USB-C + the USB hub and it has “uglier” bezels but I don’t notice any difference in image quality from one to the other and it cost me almost 3 times less (in a promo).

I think that the LG 27UL550-W is a great value for money if you want a 4K display for productivity work.

Mac Tech

MacOS password prompt for Keychain access twice

I did a migration of Keychain items between Macs and MacOS was prompting me to type the password twice to authorise access.

To avoid this Apple suggest changing the password of the Keychain “login” (the problematic) and setting it back to the same password. This did fix it for me but the option to change password was greyed out on Keychain Access.

greyed out option to change Keychain password

So, I had to create a new Keychain (no matter the name this will be temporary), then setting this new keychain as the default and now I was able to change the password on the “login” keychain.

Then, I just set the “login” keychain back as the default and deleted the temporary one (references+files option on delete).

Mac Tech

Migrate Apple Keychain to a new Mac

I needed to migrate some passwords from Apple Keychain to a new Mac. In particular iTerm2 password manager, Coda/Transmit + Cyberduck passwords.

After doing a replace to ~/Library/Keychains/login.keychain-db with the old login.keychain-db file that destroyed my Apple ID. I found the solution on

What I ended up doing was copying the old login.keychain-db to ~/Library/Keychains/ but with a different name, eg: login2.keychain-db

Then entering the app Keychain Access and under File->Add Keychain selecting the copied file, eg: login2.keychain-db

Then I had all my old Keychain on my new Mac but I wanted to clean up.

So, I changed the password from my old Keychain by selecting it on the sidebar going to Edit->Change Password for Keychain “login2” (not sure if going to Edit is necessary but I have crossed something online that said it was). Then type the old password and leave the new password fields blank, press CMD and click to save. Mac will complain the passwords should not be blank but after insisting it worked.

Why I am removing the password, because to copy an item from the old Keychain to the new it is necessary to type the password one time for each item and I had many.

After I selected the passwords and made copy from the old Keychain and paste on the new. Still, necessary to confirm but clicking ok and leaving the password blank was easier.

Finally, I deleted the old (login2) by right-clicking (cmd+click) on the sidebar. I choose the ‘references + files’ option.

I did run into an issues where MacOS was prompting me twice for passwords to authorise access but I was able to solve it by doing this.