SD cards of different brands are slightly different sizes.

I recently downloaded an img file online where a lot of people claimed the image was too large for their SD cards. For that reason, I got a bit curious to know which card he used, which cards were larger/smaller, etc.

These were the partitions on that image.

Device Boot Start End Sectors Size Id Type
image.img1 32768 262143 229376 112M c W95 FAT32 (LBA)
image.img2 262144 14598143 14336000 6.8G 83 Linux
image.img3 14598144 250347519 235749376 112.4G 7 HPFS/NTFS/exFAT

The last sector is marked in bold. The person that shared the image claimed that the card he used was the same Samsung 128gb EVO select card. I guess he was lucky. I have 2 of those cards and this image didn’t fit on either of them.

I went through all of my SD cards to check their sizes hoping to find one that fit. Here are the sizes in order from smallest to largest.

Team 128GB Elite microSDXC UHS-I U3, V30, A1, 4K UHD Memory Card with SD Adapter, Speed Up to 90MB/s (TEAUSDX128GIV30A103)

Team 128GB Elite microSDXC UHS-I U3, V30, A1, 4K UHD Memory Card with SD Adapter, Speed Up to 90MB/s (TEAUSDX128GIV30A103)

Disk /dev/sde: 117.75 GiB, 126437294080 bytes, 246947840 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc9f931c9

Device Boot Start End Sectors Size Id Type
/dev/sde1 32768 262143 229376 112M c W95 FAT32 (LBA)
/dev/sde2 262144 14598143 14336000 6.8G 83 Linux
/dev/sde3 14598144 246947839 232349696 110.8G 7 HPFS/NTFS/exFAT

This was the smallest of the cards. The difference in size is only a couple of gigabytes, but if you tried to load the image on this card by the byte, you would not be successful.

SanDisk 128GB Extreme MicroSDXC UHS-I Memory Card with Adapter – C10, U3, V30, 4K, A2, Micro SD – SDSQXA1-128G-GN6MA

Disk /dev/sdd: 119.08 GiB, 127865454592 bytes, 249737216 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc9f931c9

Device Boot Start End Sectors Size Id Type
/dev/sdd1 32768 262143 229376 112M c W95 FAT32 (LBA)
/dev/sdd2 262144 14598143 14336000 6.8G 83 Linux
/dev/sdd3 14598144 249737215 235139072 112.1G 7 HPFS/NTFS/exFAT

This card was also one of the smaller cards.

SAMSUNG (MB-ME128GA/AM) 128GB 100MB/s (U3) MicroSDXC EVO Select Memory Card with Full-Size Adapter

Disk /dev/sdd: 119.25 GiB, 128043712512 bytes, 250085376 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc9f931c9

Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 32768 250085375 250052608 119.2G 7 HPFS/NTFS/exFAT

Front view of the Kingston 128GB microSDXC Canvas React Card + SD Adapter

Disk /dev/sdd: 119.48 GiB, 128286982144 bytes, 250560512 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc9f931c9

Device Boot Start End Sectors Size Id Type
/dev/sdd1 32768 262143 229376 112M c W95 FAT32 (LBA)
/dev/sdd2 262144 14598143 14336000 6.8G 83 Linux
/dev/sdd3 14598144 250347519 235749376 112.4G 7 HPFS/NTFS/exFAT
/dev/sdd4 250347520 250560511 212992 104M 83 Linux

The difference in sizes are trivial, but as you can see, the image would only fit on 1 of the cards. I’ll show you in a later post how I got the image to fit on any card.

How to expand a LUN with SteelFusion

 Why would you want to do this?

No matter how well you plan, resources are almost never in abundance. There could be a few reasons why you want to expand a LUN. Perhaps you want to add more vmdks to the same VMFS volume. Another reason could be that you might want to increase the size of the partition of the guest VM. In either case, you might want some of the workarounds listed at the end of the article before continuing. If you’re convinced that expanding the LUN is what you’re going to do, here is how to do it.

Check feasibility. First check at the maximum size and expandability of the partitions involved.

  • Check the guest OS partition. If NTFS, the maximum partition size for NTFS is 256TiB according to http://en.wikipedia.org/wiki/NTFS. You probably don’t need to go beyond that.
  • Check the partition size of VMFS. Consult VMware documentation http://www.vmware.com/support/pubs/ to ensure that you do not exceed maximum size for your partition. For example, if your partition is VMFS-3 and formatted with a 1MB block size, your maximum is 2TB-512bytes. If you’re already at the maximum, see workarounds further in this document.

These are the steps in a nutshell:

  • Resize/expand the LUN on the backend array.
  • If the SteelFusion Core is a virtual machine and LUN is connected via fiber, run a Rescan/Refresh on the HBA on the ESXi server where the Core is hosted.
  • On SteelFusion Core, perform a LUN rescan
  • Following VMware documentation, resize the VMFS volume http://kb.vmware.com/kb/1752
  • Resize or map the device in Windows

Resizing the LUN on the backend array.

Consult your array’s documentation for resizing the LUN. Here’s an illustration on how it’s done with a Netapp array.

1) Locate the LUN you want to expand, right click and select Edit.

01locate_lun

2) In the Edit LUN window, assign the new LUN size, and click save and close.

02editlun

Seeing the new size on the SteelFusion Core

The SteelFusion Core may automatically detect the change in LUN size depending on how busy the LUN is. If there are read/write operations from the backup with a “LUN configuration changed” status, the Core will be forced to rescan and retry and it will automatically change. There’s also a periodic rescan every 5 minutes that would cover change it. If you need the change immediately, you can do a manual rescan and force the change. The size will highlight in orange when it changes.

03addlun

Once the Core sees the change, the new size will be propagated to the Edge. If the LUN was pinned, the Edge will approve or deny the size increase based on Blockstore capacity.

Extending the VMFS volume size

Reference this http://kb.vmware.com/kb/1752 VMware KB article for extending your VMFS volume. Here’s how it’s done with the vSphere Web Client if you’re using vCenter:

 

Find the Datastore, right click and select Increase Datastore Capacity.

04increasedscap

Select Use Free space to expand the Datastore.

05usefree

If you’re using the deprecated Windows client, you can effectively do the same in the Datastore view here:

07increase

Select the Datastore you are expanding, go to the Configuration tab and select the Properties of the Datastore. In the Properties box, Select Increase.

08epxand

Follow the wizard and it will expand the volume.

Expanding the size of the virtual disk on the VMFS volume

If the UI doesn’t allow you perform the following steps, refer to this VMware KB:

http://kb.vmware.com/kb/1004047

Find the VM settings and change the size of the VMDK.

09find

In the Windows client, it’s in the same area.

10find

Expanding the partition in Windows

Lastly, go into the Windows guest and expand the volume size.

First, go to the Disk Management in the Computer Management application, right click and select Rescan Disks.

11rescan

Upon rescanning, you should see the newly added space as unallocated.

12unallocated

Right click on the primary partition of the disk and select Extend Volume.

13extend

At completion, you now should have your expanded disk.

Consideration

Consider inflating the VMDK file after doing the extension during non-peak hours. Because the added capacity that you just added to the VMDK file is sparse, you may want to fill it up with zeroes. The reasoning behind this is so that you are not struck with first write or double-write penalty (in all copy-on-write disks) when your guest writes to the disk. You can read a little about the penalty here: https://blogs.vmware.com/vsphere/2014/05/thick-vs-thin-disks-flash-arrays.html

http://blogs.vmware.com/vsphere/2012/03/thin-provisioning-whats-the-scoop.html

You can do this in the Datastore browser. Just find the VMDK file of your VM, right click and select Inflate.

14inflate

Functionality also is available in the Windows client.

15inflate

Workarounds

Here are some workarounds to consider LUN expansion is not feasible:

  • Consider moving swap files to another VMFS volume, preferably on a Local LUN. You can do this in the Options tab of a VM’s settings. This will require your VM to be shutdown, but the benefit of having this on a Local LUN is that it does not need to be replicated.
  • Consider moving guest page file, swap files, and print spools to another drive. Like workaround #1, these things do not need to be replicated, so moving them to a Local LUN can help with your WAN traffic.

Not-recommended workaround

A workaround that may sound logical, but is not recommended is to Storage vMotion the disk to another LUN. This should be your last resort. This may be something that vSphere administrators do commonly, but because the Blockstore on the Edge is a cache and not ordinary storage, this will result in a lot of WAN traffic and can be potentially dangerous.