The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,183 other subscribers

Archive for September 4th, 2020

Need to figure out how to remount 2015 Retina MacBook Pro SD card that got ejected during sleep

Posted by jpluimers on 2020/09/04

Somehow, every now and then, a 2015 Retina MacBook Pro will eject the SD Card during sleep.

I’m not sure about the cause, just about the message that a drive got unmounted in an unexpected way.

This fails to rescan for the drive on Mac OS Sierra:

sudo kextunload -b com.apple.driver.AppleSDXC
sudo kextload -b com.apple.driver.AppleSDXC

As per [WayBack] external disk – Problem with kextunload SD card remount – Ask Different, I tried the kextstat below, however, before the unload/load statements, kextstat | grep -e SDXC returns nothing.

After them, it returns something like

156 0 0xffffff7f841f3000 0x12000 0x12000 com.apple.driver.AppleSDXC (1.7.6) 0F6F5025-A1C4-3E77-9ECD-4D4410E684C5 <16 15 12 5 4 3 1>

When it happens again, I will likely need to read these:

It might be that somewhere along the line, SDSX is not started by default any more or not applicable to MicroSD to SDXC card converters. These screenshots at least show that this disk is connected via a USB path:

The screenshots are from the stock “System Information.app” tool, and I really wish it showed the kext drivers used for each device. That would make debugging these issues a lot easier!

A solution then could be as easy as this:

Unmount all USB connected devices (for instance with a command like diskutil eject disk1);

sudo kextunload -b com.apple.driver.AppleUSBCardReader
sudo kextload -b com.apple.driver.AppleUSBCardReader

However my first try got me an error similar to the one result [WayBack] External USB disk sometimes requires a reboot to be recognized after eject – Ars Technica OpenForum I found after searching for “class com_apple_driver_AppleUSBCardReaderDriverNub has” “instances.”:

7/28/16 10:05:54.000 AM kernel[0]: Can't unload kext com.apple.driver.AppleUSBCardReader; classes have instances:
7/28/16 10:05:54.000 AM kernel[0]: Kext com.apple.driver.AppleUSBCardReader class com_apple_driver_AppleUSBCardReaderDriverNub has 2 instances.

–jeroen

Posted in Apple, Mac, MacBook, MacBook Retina, Power User | Leave a Comment »

ESXi: shrinking a Windows disk

Posted by jpluimers on 2020/09/04

I had to shrink down a Windows disk of an ESXi based Virtual Machine from 240 Gibibyte to about 140 gigabyte.

In this case, it was Windows 7 on ESXi 6.5, but the actual versions do not really matter.

The only way to decrease ESXi .vmdk files is by fiddling with disk sector counts in the text based .vmdk files (not the binaries .vmdk files!) of a diskname.vmdk / diskname-flat.vmdk text/binary pair. This is described for instance in these two articles:

Notes:

  1. This article presumes you already shrunk your NTFS partition (for instance as described in Consolidating NTFS free space).
  2. If you only have a binary .vmdk file, then you can use vmkfstools to create a text/binary pair for you, for instance by using these commands:
    vmkfstools --clonevirtualdisk Windows7.vmdk Windows7.thick.vmdk
    vmkfstools --clonevirtualdisk Windows7.vmdk Windows7.thin.vmdk --diskformat thin
  3. You cannot workaround 2. as the --geometry functionality of vmkfstools only displays existing geometry, see

ESXi has .vmdk files that count disk sizes in sectors, but the tooling that ship with Windows to not show partition sizes in sectors, especially not the partition ending sector.

All permutations of tooling like DISKPART, PowerShell, WMIC and terms partition, ending sector, cylinder, head, etc failed me to return built-in tools.

Luckily, “powershell” “partition” “ending sector” found the documentation for [WayBack] Test Disk | File System | Data Management titled “TestDisk Documentation, Release 7.1, Christophe GRENIER” which lead to:

[WayBack] TestDisk Download – CGSecurity

Download TestDisk & PhotoRec. TestDisk is a free and open source data recovery software tool designed to recover lost partition and unerase deleted files. PhotoRec is a file carver data recovery software tool.

It is available for many platforms, including Windows x86 (fully featured) and x64 (limited features):

There was also the much more convoluted PowerForensics which is also more difficult to install:

As a check (because the calculations by hand are too cumbersome to trust on a first trey), I also downloaded the ISO image of gparted:

Let’s get started for real!

Read the rest of this entry »

Posted in Power User, Virtualization, VMware, VMware ESXi, Windows, Windows 7 | Leave a Comment »

SSL certificates – not optional | Open Query Pty Ltd

Posted by jpluimers on 2020/09/04

Some tips on using the certbot for Let’s Encrypt and the support for wildcard certificates through DNS updates: [WayBack] SSL certificates – not optional | Open Query Pty Ltd

–jeroen

Posted in Encryption, HTTPS/TLS security, Let's Encrypt (letsencrypt/certbot), Power User, Security | Leave a Comment »

 
%d bloggers like this: