Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


HPR2518: Converting My Laptop to Dual Boot

Hosted by Steve Saner on 2018-03-28 00:00:00
Download or Listen

Converting My Laptop to Dual Boot

Summary

In this episode I describe how I converted my Linux-only laptop to dual-boot with Windows 10. Specifically, using information from a previous HPR episode.

Reference

The procedure used in this project drew heavily from the information presented in HPR episode 2305 by Mongo.

Target Laptop

  • Lenovo Thinkpad T550
  • Intel i7-5600U Dual-Core
  • 8GB RAM
  • 256GB SSD

Laptop was purchased in Jan 2016 as a factory refurb unit from an Ebay seller. The model was about 1 year old at the time. As soon as I got it, I summarily removed any trace of Windows, with prejudice, and installed Linux.

The Problem

I am needing to run some Windows software that doesn't work in either Wine or a virtual machine environment. Specifically Autodesk Fusion 360.

Some Challenges

  • No longer have Windows install media. I was able to download a Lenovo recovery USB image.

    https://support.lenovo.com/us/en/solutions/ht103653

  • I didn't think that a 256GB drive would be big enough for both Linux and Windows. I purchased a 512GB SSD drive.

  • I was happy with my Xubuntu setup and configuration and didn't want to have to start all over on that. I hoped that restoring my home directory would take care of that.

The Procedure

  1. Backed up my home directory, just in case.

  2. Replaced the hard drive.

  3. Tried to boot from Lenovo Windows thumb drive.

  4. Found that the BIOS was set to legacy mode, so reset BIOS to factory.

  5. Told the installer to use the entire drive.

  6. Went through the entire Windows install and update process.

  7. Used the instructions provided by Mongo to resize Windows filesystem size.

  8. Used the instructions provided by Mongo to turn of fast boot.

  9. Used the instructions provided by Mongo to turn of Secure Boot in BIOS.

  10. Booted from Xubuntu 16.04 thumb drive.

  11. Did Xubuntu install as normal, choosing the install type of installing along side Windows Boot Manager.

  12. Installed all of the updates.

  13. Mounted the old hard drive with a USB drive enclosure, which was a bit of a challenge because that drive was encrypted. The drive has 2 partitions. A small boot partition and then a large LUKS encrypted partition.

    This is a procedure that can be used to mount such a partition.

    • First you must decrypt the partition and map it to a device. This can be done with the following command (assuming the partition mount point is /dev/sdb2):

      cryptsetup luksOpen /dev/sdb2 cryptdrive

      This command will map the partition to the following device:

      /dev/mapper/cryptdrive
    • Normally you could then mount the filesystem as follows:

      mount /dev/mapper/cryptdrive /mnt
    • However, in this case the encrypted filesystem is actually an LVM volume that contains two volume groups that made up the partitions of the previous Linux install, so you can't directly mount it.

    • I had to first install the LVM tools, which had not been installed by default.

      apt-get install lvm
    • Then I had to issue the following command to activate the LVM volume groups.

      vgchange -ay

      That resulted in two more devices being created.

      /dev/xubuntu-vg/swap
      /dev/xubuntu-vg/root
    • I could then finally mount the old root filesystem with:

      mount /dev/xubuntu-vg/root /mnt
  14. Copied by entire home directory from the old hard drive to the new install.

    cd /home
    cp -rp /mnt/home/username .
  15. Rebooted computer and Xubuntu came up will all of my desktop settings intact. Just need to install non-default packages.

Result

This ended up being a totally successful process. The computer is now dual-boot. It boots into Xubuntu by default, but you can choose Windows. Xubuntu system is mostly restored back to the way it was.

Comments



More Information...


Copyright Information

Unless otherwise stated, our shows are released under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.

The HPR Website Design is released to the Public Domain.