Category Archives: MBR

Elegantly resizing a Linux LVM volume in a virtual machine…

I’ve seen many articles on how to resize a LVM volume after increasing a virtual disk capacity. Most write-ups call for adding partitions and simply adding them to the volume group. While it is simple, it’s not future proof since the number of partitions is limited.

Here’s the way I do it. I hope you enjoy!

  1. Resize your virtual disk (this depends on your hypervisor, I use VMware so YMMV)
  2. Shut down the VM, find an ISO that has GParted. I use PartedMagic but the GParted Live ISO works too.
  3. Boot from the ISO, start GParted.
    1 GParted
  4. Select the LVM physical volume, right click on it then click on deactivate.
    2 Deactivate
  5. Then right click on Resize/Move
    3 Resize
  6. Resize the partition (here, sda2, yours might be different)
    4 Resize
  7. Apply the changes by clicking the green checkmark in the toolbar at the top. Click Apply in the popup.
    5 Apply
  8. Don’t forget to reactivate the LVM physical volume.
    6 Activate
  9. In the terminal, enter the following commands (volume group names may vary) do an ls /dev/ if you’re not sure.
    #extend the volume
    lvm lvextend /dev/lv_hostname/lv_root /dev/sda2
    #check the filesystem for inconsistencies
    e2fsck -f /dev/lv_hostname/lv_root
    #resize the filesystem
    resize2fs /dev/lv_hostname/lv_root
  10. Shut down the VM, unmount the iso.
  11. You’re done.


Playing with Boot Camp on Macs and EFI limitations workarounds.

As you may know, Macs use a GPT (GUID Partition Table) unlike Windows, that usually uses the old MBR (Master Boot Record). On top of that, there is just a BIOS emulation on top of the EFIon Apple machines. As usual, Macs are a step ahead but that creates some side effects:

  • Inability to boot from exotic CDs like UBCD, Manufacturers HDD diagnostics and so on…
  • Inability to clone Windows partitions using standard tools like Ghost or Acronis.

Hopefully, there are workarounds. First of all, if you have HDD issues, you can move the drive to another computer (PC) to perform extensive testing, especially at the logical and mechanical level. You don’t need to actually boot on the HDD – that would be impossible anyway – to analyze it. Moving a drive is not hard and doesn’t void the warranty if done properly.

Cloning is now fairly easy, there is an awesome tool called WinClone from TwoCanoes that allows you to backup and restore a functional Boot Camp partition. You can even shrink your Windows partition. They also claim that you can deploy Windows using ARD.

I also would like to share a few reminders:

  • Windows is not like Mac OS. You can’t have a generic Windows image just by cloning it as every model of Mac is different and requires different drivers and settings (especially on the ACPI side) unless you use a third-party tool.
  • Macs doesn’t support PXE for obvious reasons. You can use NetBoot though.
  • If you don’t absolutely need to boot natively into windows, consider using a VM as they are less platform dependant.
  • Use Time Machine!