Linode base to LVM conversion

In my last post, I whined that I couldn’t find a how-to on how to convert a Linode virtual machine to an LVM setup. Well, I’ve done it, so I should write this up, no?

I didn’t want the machine to have a swap partition; so there were three things to do:

  1. swapoff while logged on, inside the machine
  2. Edit /etc/fstab to delete the line for the swap drive
  3. Outside the machine in the Linode manager, delete the disk
    • So first I had to power the machine down
    • Then in the Linode virtual machine manager, I had to switch to the Storage tab
    • Now I can click on the swap drive and delete it.
      • I don’t know why, but WordPress is being stupid with lists, which it didn’t used to prior to the most recent “upgrade”. This sublist is supposed to be numbered, damnit. And this particular list item was supposed to be indented even further.

The next thing to do was to shrink the existing disk. I do not know if I could have just done that. I see a resize option in the Linode storage manager. It may be that they have cloud-init wired in, and using the resize button would also have run stuff inside the machine to make everything nice. That’s not the way I went. 🤷

In the Linode manager (at the upper level, where you can see all your virtual machines), there is a three-horizontal-dots menu button. (I don’t know what is the good name for this button. I like the three horizontal lines, stacked, menu buttons because I can call it a hamburger button, and people get the idea of a bun with a patty in between. But I digress.)

I clicked on the three-horizontal-dots menu button, and chose the Rescue mode menu option. This powers down my virtual machine and attaches it as storage to a rescue mode virtual machine (running Fennix). Then in the Linode manager, I used Launch LISH Console to spawn a new web page which is the remote console into the Fennix machine. Although I’m inside the Fennix machine, /dev/sda is still my virtual machine’s main disk. It is not mounted at this time, which is good. So then I ran the command to shrink /dev/sda with resize2fs /dev/sda 9G

So a very real problem with me writing this up is that I don’t have a history command to verify this is what I did. That history was recorded in the Fennix virtual machine which is destroyed after reboot. I’m pretty sure the command was resize2fs /dev/sda 9G but I don’t actually know. When I look stuff up now, it looks like resize2fs applies to the partitions inside a disk device rather than the device itself. But I’m pretty sure I did this.

Then, using the Linode manager, I did shrink the disk. So the next steps were:

  1. Reboot out of rescue mode (wait for everything to boot back up)
  2. Power down the virtual machine (wait for it to shut down)
  3. In the Linode manager of my virtual machine, resize the one-and-only disk to 9 GB
    • The base machine had used about 5 GB of the 25 GB allocated. This leaves another 4 GB free disk space, even prior to moving /var off to another disk.
  4. Then, I added four disks:
    • home
    • tmp
    • var
    • var/mail

Of course, when I added these disks, I had to pick the sizes of what I wanted each to be.

The next part of the puzzle wasn’t obvious either: how does Linode map these newly added disks to the virtual machine? The answer is that by default, it does not.

That’s over in the Configuration tab of the virtual machine manager. (Earlier documentation appears to have called this the Profile tab). Doing an edit of my virtual machine, I could pick the /dev/sdX and assign it to the disk I had created for my purpose.

Okie dokie, time to power up and do the LVM stuff.

Create the physical volumes: pvcreate /dev/sdb /dev/sdc /dev/sdd /dev/sde

Create the volume groups:

vgcreate vg_mail /dev/sdb
vgcreate vg_tmp /dev/sdc
vgcreate vg_home /dev/sdd
vgcreate vg_var /dev/sde

Create the logical volume groups:

lvcreate vg_mail -l 100%FREE -n lv_mail
lvcreate vg_tmp -l 100%FREE -n lv_tmp
lvcreate vg_home -l 100%FREE -n lv_home
lvcreate vg_var -l 100%FREE -n lv_var

So at this point, we have logical volumes, inside of volume groups (which have physical devices assigned). LVM makes this storage available at /dev/mapper

Format the new storage:

mkfs.ext4 /dev/mapper/vg_mail-lv_mail
mkfs.ext4 /dev/mapper/vg_tmp-lv_tmp
mkfs.ext4 /dev/mapper/vg_home-lv_home
mkfs.ext4 /dev/mapper/vg_var-lv_var

Now comes the tougher part, moving the new storage into production.

The process is to shut down the system to Init Level 1 (so that as little as possible is currently running), mount the new storage, copy the files over, rename the old storage out of the way, and then update the /etc/fstab to reflect the new storage mount point.

Inside the running virtual machine, I gave the command init 1

Now I have to use the Linode virtual machine manager Launch LISH Console to get logged into the running machine (Init Level 1 turns off the network).

mkdir /mnt/newvar
mount /dev/mapper/vg_var-lv_var /mnt/newvar/
cp -apx /var/* /mnt/newvar
mv /var /var.old

Okay, the contents of /var are now inside the LVM logical volume. Now to configure the system to mount that logical volume at the file system mount point /var

First, use blkid to identify the universally unique identifier assigned to the LVM volume. Perhaps blkid says your LVM volume is this:

/dev/mapper/vg_var-lv_var: UUID="epstein-didnt-kill-himself-605169120" BLOCK_SIZE="4096" TYPE="ext4"

Then, edit /etc/fstab to have the UUID entry for the mount point:

UUID="epstein-didnt-kill-himself-605169120" /var ext4 defaults 0 1

Do this for the other LVM volumes and then clean up. Before rebooting, you should try mount -a just to make sure there are no errors; because if there are errors mounting things, that’s going to make the reboot suck, badly.

Cleanup was to delete /mnt/newvar and to delete /var.old (and the other LVM mount points processed the same way).

Kind of hating cloud servers right now

How in the world am I supposed to create LVM (Logical Volume Management) disk layouts on a cloud VM with a single big disk? Before I start piling in data, I want to put /var/mail on it’s own partition.

Maybe it’s just that Google is stupid, and the answer is plain as day if I could find it.

Linode is annoying, because the pages I found said (in essence) “Don’t use LVM, use our attached disks at an additional $2 per disk per month.” Well, I could add a disk and then use LVM to configure it. But that means that I’m going to have a 25 GB /boot partiition and then hardly anything else over on the new disk. What it won’t do is keep the system from going comatose if some process starts spamming a log file and fills the disk. That’s stupid. And I’d be paying $2 a month, forever, for the stupidity.

I want to install LVM so that I have the option of adding another disk later, and it would be super easy. I’ve done LVM at work for years now, and it’s great. But at work, I get to install the machine from a boot ISO, and I get to go through every step of the install. Linode creates new virtual machines from images, where the disk is pre-configured. I don’t get to say I want /home on a separate volume (for example).

Every search I’ve done about LVM has two assumptions behind it: 1) there is a newly added virgin disk, or 2) during install, choose to partition the disk the way you want.

Nothing appears to address the situation where I’ve got a 25 GB disk with 20 GB free, and I’d like to move /home and /var and /tmp to /dev/sda1 /dev/sda2 /dev/sda3

I need to do pvcreate, but it errs out because I don’t have a newly added virgin disk.

I doubt this problem is particular to Linode; I suspect Rackspace and Vultr have the same problem – the preconfigured image is what you get; go kick rocks if you want something else.

It is frustrating, becasue I cannot be the first person on the planet to have thought of this or asked this question. But if the answer is obvious, I’m not finding it with Google search.

The Helm email appliance – you were a good product

I really liked my Helm email appliance. It has done well by me.

Unfortunately, the business behind it doesn’t see it’s future getting better, so they are going to call it quits. I have until December 31, 2022 to build a replacement email server. This is turning out to be a larger project that I’d like.

I do appreciate that The Helm company gave me plenty of warning (I got the email more than two weeks ago). I hope the people at the company find something else they can do which brings more success to them. You have my many thanks for your years of solid service.

Amazon disappointment – I’ve removed my Echo (Alexa) devices

There was a recent policy change at Amazon which I hate, and as a result, I have removed the Amazon Echo (Alexa) devices and app from my life. It does mean I’ll be carrying my phone with me more.

A part of the Vision Statement for Amazon is “Our vision is to be earth’s most customer-centric company”. Well, this change in policy belies that; trying to annoy their customers for more money is the new practice. That’s the nice way to put it; predation is the stark reality.

So, what happened?

  1. Amazon Music started inserting audio advertising into my morning music play. This happened four days ago.
  2. Amazon raised their prices on Prime membership, and I opted-out at the beginning of October (about one month ago).

I’ve mentioned before that I hate bullies, and dislike advertising. I also really liked setting up my morning wakeup routine to start the day with inspirational music. This change by Amazon crossed all three lines.

So if my morning wakeup routine is spoiled anyway, what really do I need these devices for?

Other than as voice controlled light switches, they are sometimes a convenient voice controlled timer. I don’t need this – it’s a nicety at best.

The bargain was they would listen in, the app on my phone would do tracking, and Amazon would do (whatever) with that data. I assumed they were monetizing it somehow; that was fine – that was the bargain. But now that they’ve crossed the line and spoiled my morning wakeup routine, I’m out.

Really, the only power consumers have is the power of money; either the boycott or favored trade.

Part of the annoyance is that I purchased the .mp3 files outright. I made my playlists out of only these files. Yes, I wanted the artists to get paid for their work, and thought is was only fair that Amazon also got paid for doing the work to set up the deal, import the files and handle the transactions to the artists. My point is that I paid for these files. Anyone that would wrap my files inside their advertising is a bully / predator.

This morning, the advertisement specifically said “Buy Amazon Music Unlimited and you won’t get advertisements”. Or, I can just completely opt out. Spotify costs the same as Amazon Music Unlimited, they do have Joe Rogan, and they have an API I can use to create my morning playlist programatically.

In that way, Spotify is better: I can write a Python script to classify songs into lists, and pick two from the spirtitual category, one from the energetic category, build today’s list and program Spotify to play that. I could even then put the songs in a FIFO queue (perhaps with some randomization). Much better than anything I could get with Amazon Music.

It’s not lost on me that the Open Source community has a project, Mycroft, which would let me connect to my IoT devices without the data tracking which was the part of the Amazon Echo bargain. I’ve already got one Raspberry Pi. All it really needs is a microphone. Guess what I’ve got on order?

Maybe I don’t even need Spotify. Maybe I can just get Mycroft or Home Assistant to play .mp3 files on various Bluetooth connected devices.

Until I get that set up, I’ll have to use my phone apps for controlling the lights and keeping timers. This is a minor inconvenience at worst. And if eventually I hook Mycroft up to a Home Assistant and a Magic Mirror, the better.

PHP Upgrade for Bitnami Lightsail WordPress

Turns out the way to upgrade is to spin up a new box (or two) and migrate.

Step 1) Spin up a new instance. At the moment I’m using Amazon Lightsail.

Step 2) assign a DNS entry to it. At the moment I’m using Hover. I do have the DNS entries set to a 15 minute time-to-live. Whatever IP address that Lightsail assigned is what I put into Hover.

Step 3) Set the new machine to know it’s new host name.

  1. Of course, the what-used-to-work is different now. The command is now sudo /opt/bitnami/bncert-tool

Step 4) Get logged in to the new instance of WordPress. BTW, the login user name has changed. It used to be bitnami now it is user

Step 5) Update WordPress to the current version, if it’s out of date.

Step 6) Delete the plugins in the base image that won’t be migrating over. BTW, one of the plugins, TaxoPress, apparently had a different name prior to updated and would err out instead of deleting. Do upgrade the ones I’m keeping.

Step 7) I use NS Cloner and NS Cloner Pro to migrate between servers. I like the people there; they did actually help me when I was having an error getting it to run. I was migrating a site with All-in-One Event Calendar by Time.ly and apparently that plugin just does not play nice with database records or something. I am lucky that I bought a licence a long time ago; since then they have had to raise their prices. As a tool, it has been working great, but the price increase was really steep. If I did this for a living, I’d have no qualms about paying the annual license fee.

And then ….

The problem is that I just migrated gerisch.org to davidgerisch.xyz, but I really want the web site on gerisch.org

Okay, so there are two ways out of the problem here.

Alternative 1 is to go to the old gerisch.org and run sudo /opt/bitnami/bncert-tool and change it to something else and then go to davidgerisch.xyz and run sudo /opt/bitnami/bncert-tool and change it to gerisch.org AND THEN do database search and replace to swap out davidgerisch.xyz to be gerisch.org instead – all on the new machine. My experience with these sort of database search and replaces hasn’t been wonderful. There’s also the problem of being logged in to the web site I’m changing the name of; at some point I cut off my own feet while I’m trying to stand on them (DNS -wise).

I went with alternative 2:

  1. In Lightsail, detach the static IP that gerisch.org is pointing to.
  2. In Lightsail, delete machine (old) gerisch.org
  3. In Lightsail, spin up (new) gerisch.org
  4. In Lightsail, attach the static IP for gerisch.org to this new machine.
  5. Run sudo /opt/bitnami/bncert-tool to assign the machine it’s new name gerisch.org
    1. Note that with alternative 2, the Hover domain name registration hasn’t changed. The public IP is on a different box (running an out-of-the-box WordPress install), but from the DNS point of view, this is simpler – nothing has changed. DNS name gerisch.org is still pointing the same IP address it always has.
    2. With alternative 1, I had the problem that the old box “knew” it was gerisch.org, so I had to run bncert-tool to change it to something else. If I didn’t, and I just ran bncert-tool on the new box, trying to claim gerisch.org, the Let’s Encrypt people would complain, correctly, that this domain name is currently in use on a box it can talk to right now, and that box has a different IP address. Am I trying to steal it’s identity?
  6. Do the top steps 4, 5, 6, and 7 again: Update WordPress, plugins, and migrate with NS Cloner Pro.
  7. Delete the running machine davidgerisch.xyz – it was only every going to be a temporary container anyway.
  8. Change all the Hover entries to point to the same IP as gerisch.org

My site is pretty small, so the migration with NS Cloner Pro takes under five minutes. If I had more data and it was going to take longer, I’d probably figure out how to enable FTP so that NS Cloner Pro could use that.

Stock purchases

A little while ago, I bought two stocks: Costco and Micron

I bought Costco (symbol is COST) on 2022-06-28 at $473 per share. Today it is at $520, although it has dropped 3.5% from yesterday. At the beginning of the week, it was $540. Still, I think it is a fundamentally great company.

I bought Micron (symbol is MU) on 2022-07-27 at $60 per share. Today it is at $54.37, so I’m down 10%. Today it is down 6%, although it had a jump up to $58 on Monday.

I thought that the Optane / 3D Crosspoint technology that Micron developed with Intel could be a game changer. Plus, the world’s need for solid state storage is not likely to decrease. My grandfather did very well in the stock market, buying energy companies from the 1960’s on. The world’s need for energy was not going to go down – and it didn’t. Those stocks grew well.

I still think that Micron is a good company. I also like that it is a USA based company.

Today the whole market is down due to an official government report of inflation numbers. The Obama administration didn’t mind lying through their teeth about those numbers, and the Rump administration didn’t change that, so I don’t know that the Biden administration can be considered any better. I do know that a local drive through restaurant had a 6 taco special for $6 before the pandemic; today it is $11. I’ll pass.

I’m not sure if the inflation numbers are going to start a downward trend, or will be a momentary blip.

One of the investing people I listen to thought at the beginning of the year that it was time to add to his small cap positions. Let’s see how that worked out.

And off-topic, he included $300 Billion companies in his list. I’m sorry – $300 Billion is not small capitalization.

SymbolCompany namePrice at the beginning of the yearPrice today
EBEventbrite (SAAS event booking)$17.75$7.68
EBIXEbix (software for insurance agents, and runs an exchange for agents)$31$23.22
HTLDHeartland Express (trucking)$16.75$14.67
HYHyster-Yale Materials Handling Inc (Hyster brand lifts and trucks)$42.50$30.21
INGNInogen (home medical oxygen)$34$27.49
MHHMastech Digital (outsourced analytics and IT staffing)$17.50$15.06
PLABPhotronics (photomasks for semiconductors)$18.50$15.85
SLQTSelectQuote (online insurance marketing)$9.25$1.21
TSETrinseo (plastics and latex binders)$52$26
VPGVishay Precision Group (sensors)$36.50$33

Okay, so everything lower, some by a lot. Looks like the best pick in the list is Vishay Precision Group sensors, at only 10% down. The next three are Heartland Express trucking (down 12%), Mastech Digital outsourcing (down 14%), and Photronics photomasks for high tech (down 14%).

Glad I didn’t buy SelectQuote – down 87% since the beginning of January 2022.

Firefox Sync and temporary containers fix

My synchronized Firefox items got out of sync. Here is how I fixed that.

  1. Log out of Firefox Sync on every machine that has Firefox.
  2. Backup your profile on your master machine.
  3. On every machine except the machine I want to keep as master, delete all temporary containers.
    1. This is most easily done with
      about:preferences#containers
    2. Click on the remove button for all the temporary containers that start with tmp.
  4. Go to
    about:support
    in Firefox on the master machine.

    1. Click the Open Directory button to open the profile directory folder.
  5. Click the Open Directory button to open the profile directory folder.
  6. Copy the
    containers.json
    file to an external file share of some sort. It could be a USB key, or Nextcloud, or email it to yourself and use webmail to get a copy of it.
  7. Go to
    about:support
    in Firefox on the slave machine.
    1. Click the Open Directory button to open the profile directory folder.
    2. Exit Firefox.
  8. Copy the
    containers.json
    file from the external share to the opened profile folder. Yes – replace the file.
  9. Start Firefox on the slave machine, and log in to the containers you have set which need to keep their login state.

  1. Log in to Firefox Sync on the master machine. You can do this, though it will only really help with keeping bookmarks in sync.
    1. Note that it sent me a confirmation code to my email address.
  2. Log in to Firefox Sync on all the rest of the machines.
  1. Note that if in Step 2, you have too many containers to click the remove button on: Navigate to
    about:debugging#/runtime/this-firefox
    1. Scroll down to Temporary Containers and click “Inspect” to the right of it.
    2. Click “Console”
    3. Insert into the console

const containers = await browser.contextualIdentities.query({});
await Promise.all(containers.map(container => {
if (tmp.container.isTemporary(container.cookieStoreId)) return;
const prefix = 'tmp';
if (container.name.substring(0, prefix.length) !== prefix) {return;}
return browser.contextualIdentities.remove(container.cookieStoreId);
}));
console.log("done");

Credit where credit is due: https://github.com/stoically/temporary-containers/issues/371

SO, I’m trying to use a WordPress plugin that lets one copy the code above to the clipboard. However, what then got pasted into the Firefox console was “helpfully” upgraded to UTF fancy quotes instead of the simple ASCII ‘ and ” characters. Please stop helping … or at least give me a way to override.

And of course … it does not work.

I have a set of temporary containers on my master machine, but, my other machines will not copy that list.

At least the slave instances don’t wipe out the master list.

I’ve updated this post with instructions that do copy the containers list to the slave machines. I don’t expect that Firefox Sync will be able to keep them in sync, though.

Microsoft idiocy again

Work wanted to implement Windows Hello. We got cameras, and it seems like a good idea.

First problem: during setup, it tells me I need to install Microsoft Authenticator, and leads me to the Microsoft App Store. Authenticator is only available for smartphones, and this is a laptop. Y’all couldn’t tell that?

Second problem: I click Logout, and Windows Hello logs me right back in. So, no-one during product testing considered that I might need to log out so I could log in as someone else?

Ah – my mistake was assuming Microsoft does product testing. They don’t need to test; they have 100 million users who will test for them, for free. Of course the hidden cost is that their idiocy is on full display with this scheme.

Back to Windows Hello: instead of logging out, you choose Switch User. Okay, do that. See some software on the box I don’t need. Try to un-install it.

“There are other users logged on to this computer. To properly uninstall this program, switch to and log off each user before you continue.”

Thank you for telling me to perform an impossible operation (logging off) when Windows Hello is installed.

Idiots.

Follow up to “Microsoft is bad at software” – as a matter of fact, Microsoft is REALLY bad at software

In my previous post, one of my complaints was that I had deleted a journal mailbox connector, yet the email kept flowing out the connector to the partner organization.

The problem is that new Exchange Admin Center –> Mail Flows –> Connectors shows you an administration interface that appears to let you administer your connectors. You can create a new connector in the new Exchange Admin Center; but you cannot delete it. Well, the new Exchange Admin Center will show you that it is deleted, but the mail will continue to flow out of your network.

The only way to stop the flow of email out through the connector is to switch to the classic Exchange Admin Center.

Then, when you go in to classic Exchange Admin Center –> Mail Flows –> Connectors you will see that your connector still exists and is pumping out your email.

The particular deliciousness of this failure is that as of the end of last week, classic Exchange Admin Center –> Mail Flows –> Connectors shows only a message that to manage the connectors, you have to switch to new Exchange Admin Center.