Category Archives: PC

How to upgrade a secondary disk in Windows

The 1 TB D-drive on my desktop Windows 10 computer was starting to get full, so I bought a new 3 TB drive to replace it with. After some googling, it seemed like the free version of AOMEI partition assistant would be a good program to copy/clone the contents of the old disk onto the new one. I let it run overnight and in the morning it was done. I then removed the old disk and only kept the new one plugged in.

This is where my trouble began. I had intended to just change the drive letter (if necessary) so that the new disk would also have the drive letter D, just like the old disk. This can normally be done by opening Administrative tools/Computer Management/Disk management (Administrationsverktyg/Datorhantering/Diskhantering in Swedish), right clicking on a drive and selecting “Change drive letter”. After doing this, I got an entirely unhelpful error message saying “Incorrect parameter” (Felaktig parameter in Swedish).

After some googling, it seemed like it might work in safe mode (felsäkert läge), so I managed to get the computer into this mode by holding down shift while clicking restart and navigating through the various menus that ensued. This however did not help. Still I got “Incorrect parameter”.

While in safe mode, I tried another tip I read during the googling, namely to make changes to the registry. This turned out to be successful. Here is what I did:

  1. Open the registry editor by pressing Win+R and typing regedit.
  2. Click to HKEY_LOCAL_MACHINE\System\MountedDevices.
  3. Scroll down in the right pane to entries starting with \DosDevices.
  4. Select all the \DosDevices entries and save them (Archive/Export) to a .reg file on the desktop in case things get messed up and have to be restored.
  5. If there is an entry for the drive letter you want to use (\DosDevices\D: in this case), delete it. (Do not delete the entry for C:!)
  6. Change the name of the entry for the new disk so that it becomes \DosDevices\D:
  7. Reboot

After this the new drive with all the contents from the old D:\ showed up as D:\!

I am not sure it was necessary to be in safe mode while doing this, but maybe it was. I now realize that a reason changing drive letters was so complicated might be that I had the swap file pagefile.sys on the drive I wanted to change letters for. Maybe it would have also worked if I had moved the page file to C:\ before trying to change letters for the secondary disk. Or maybe this had nothing to do with the issue.

There are very many posts on the internet about upgrading the system disk C:\ (which should be harder I guess), but it was a bit more difficult to find this information about how to get the upgrade of the secondary disk to work. I hope I will remember that I wrote this the next time I need to upgrade a disk…

WordPress gives 403 (forbidden) error for a post with “phpmyadmin” in the title

When I try to access a post with “phpmyadmin” in the title on my WordPress site, I get a 403 (forbidden) error. After digging around for a bit, I realized that the issue was in the permalink and that replacing “phpmyadmin” with “phpmyadm” made the post accessible again.

After some more thinking I figured out that the reason was that I had set up a rule in apache\conf\httpd.conf to deny access to phpmyadmin from most IP-addresses. The rule looks like this:

<Files "*phpmyadmin*">
  order deny,allow
  deny from all
  allow from 192.168.0.50
  allow from 127.0.0.1
</Files>

So, this rule inadvertently triggered on the permalink and denied access to the post.

Maybe someone else stumbles upon this problem and is able to google up this explanation and solution.

Changing PHP Timeout Setting

When e.g. updating WordPress, it often happens that the download takes longer than the default 30 second PHP timeout and so the upgrade cannot be completed. The workaround is to increase the timeout (temporarily), which is done by editing the max_execution_time variable in the php.ini file which is located in the php/ directory. 300 seconds is usually enough.

For this to have an effect, it is probably necessary to restart the Apache server.

And don’t forget to revert to 30 seconds once the WordPress upgrade (or whatever slow process) is done.