Linux via external media, and making Windows play nice with it

#Introduction
For most people trying out Linux for the first time, they start with the live session, proceed with trying it out, consider installing it, and then they look at what they have to do so it lives alongside Windows. Installation is the biggest hurdle, with most people trying it out saying #^&< it.

I say that too, but for an entirely different, yet related reason; Linux doesn’t need to live alongside Windows. While USB performance may not be the best, it’s what I am using to run Ubuntu MATE and type this thread right now, and you can have a similar setup.

#Hardware

If you feel you have everything you need, you can skip this part entirely. Else, expand this and read below. ###Purchasing hardware **Media and mediums** There are a variety of media that can run off of USB, here's a basic checklist for an enjoyable use experience
  • Uses, or can use USB type-A 3.0 or greater
  • Has good capacity for daily use
  • Preferably solid-state, but if a 2.5" hard disk, spins at least 7200RPM

USB type-A 3.0 can handle that. Even USB 2.0 can, but it will be slower to operate overall because of USB 3.0 being (theoretically) ten times faster than USB 2.0.

Finding the best deal
When shopping for hardware, you may need to satisfy a series of conditions that differ with each configuration you want. Those conditions are;

  • Does it work with the motherboard?
  • Can it be adapted if it does not? (If USB, most likely yes)
  • Is it good value for money?
  • Is it reliable?
  • Can it use at least four partitions?

Even if you are not going to use a USB-connected hard disk for some time, you’ll want a media that has the capability to be read and written on lots and lots of times, so try to find information about that if you are not interested in using a more reliable, and probably more robust 2.5" drive.

PC Parts Picker Has the capability to sort by unit price for storage devices, with their measure being in gigabytes. While we’d all want a 6TB SSD, that’s very much out of the reach for most people, so try to find the cheapest drive possible, optimizing for value and reliability in the capacity you need. If it costs a little more for a media with greater capacity, but has a lower unit price, generally that is the better value if you can afford it. There is additional overhead about how to connect the media to your PC which requires some strong consideration before you jump on it.

The last consideration is for the installation of the system, which will be explained in-depth below.

###Installation
Pre-install
When you’ve confirmed the hardware you want to use works, whether out-of-the-box or requiring extra configuration, you’ll need to figure out how to install the system. If dual-booting between Linux and Windows systems; And everyone is a dual-booter by virtue some places require use of Microsoft Windows, you should optimize for use of the drive to have a Linux system installed with a partition Windows likes.

In a live session, do gksu gparted (sudo if gksu does not exist) and perform the following, or some variant thereof;
If necessary, format media with an MS-DOS partition table. Also note, this is a theoretical configuration, but it’ll be referenced to for brevity.

  1. Ext4; 32768MB
  2. Extended; remainder, sans 4096MB (assumed, adjust if you feel necessary)
  3. Ext4; 16384MB
  4. NTFS; remainder
  5. swap; 4096MB (or whatever amount you reserved prior.)

The NTFS partition is going to be used later, but for the time being, after this install should be treated like any other dual-partition installation. Some key points;

  • Adaptability; The capability to change systems on a whim
  • Preservation of files you have created and downloaded
  • Ease of system re-installation, if upgrading or re-installing
  • Capability to easily label partitions for ease of use
    Note: swap and extended partitions cannot be labeled.

Beginning installation
Using the setup above, ubiquity can be opened to install the system; This varies between different versions of Ubuntu, and ubiquity isn’t the only installer systems use, but since this is a Ubuntu forum, it’s all I will cover.

Select the media you formatted most recently, and set it up like this;

  1. Ext4; /: Do not format
  2. Extended
  3. Ext4; /home: Do not format
  4. Unassigned
  5. linux-swap

#Do not forget to set the bootloader to be installed on the same root device the system will be installed upon.
Seriously. If, for example everything is going to /dev/sdc, bootloader goes onto /dev/sdc. Failure to correctly assign this can make the system on the internal drive of the host machine fail to boot if you accidentally replace its MBR during installation, and will most certainly cause the system installed on its external media to be unusable without a separate bootloader.

Bootloader configuration is dead-simple, but it’s serious stuff; don’t mess it up. Formatting the partitions just configured with Ubiquity will remove their labels previously assigned in some cases, which may result in possible confusion later on. Ubiquity will complain about lack of formation, ignore and continue.

Post-install
When everything is finished and you receive the prompt to reboot or continue using the system, shut down. Yes, powering off is not an option listed in that dialog box, so instead choose to shut down the system. If you cannot figure this out from the interface now, then hold <Alt> and press <F2> to bring up the run dialog, using it to run mate-session-save --shutdown-dialog which will then present the option to shut the system down.

Disconnect the installation media, keeping the drive you installed the system on connected and start the machine again, booting from the USB-connected media the freshly-installed system resides, and log into it.

Remember that NTFS partition earlier? Time to make it usable; Open gnome-disks (installable via sudo apt install gnome-disk-utility in a terminal) and select the drive the system is on. You’ll notice the extended partition (being the biggest partition there) and the NTFS partition underneath (which is the biggest logical partition). Select it, and underneath the drive graph to the left is a gears icon.

Upon pressing the gears icon, select Edit Mount Options; you can configure the partition any way you like, but only if Automatic Mount Options is turned off; Disable it, then enable Mount at Startup, and change the Identify as option to whatever you want; this is how you will see it in your session when you next boot.

Restart the machine, and the entire point of this installation setup will be the focus from hereon;

#Making Windows see the stuff from your Linux session
Begin with opening your file manager (for MATE, that is caja) and see if the NTFS partition had mounted after having followed the steps above. If it does mount, then open a terminal and make a link to it. You may be tempted to just move directories and make links now, but save that for later; This first link is critical as we’ll be using it to make other links from hereon, and it makes re-linking everything easy should you change the NTFS partition in some way or re-install your system in the future.

For this example, I’ll assume you’ve labeled the NTFS partition as Storage, chose to identify as label in gnome-disks and name the link .ntfs;
ln /mnt/Storage ~/.ntfs

From hereon, the files will be moved there, and the remainder of the links can be made from that one critical link;
mv ~/Documents ~/.ntfs mv ~/Downloads ~/.ntfs mv ~/Pictures ~/.ntfs mv ~/Music ~/.ntfs mv ~/Videos ~/.ntfs ln ~/.ntfs/Documents ~/Documents ln ~/.ntfs/Downloads ~/Downloads ln ~/.ntfs/Pictures ~/Pictures ln ~/.ntfs/Music ~/Music ln ~/.ntfs/Videos ~/Videos

If the home partition begins to fill up, or if you anticipate lots of space being used up, move whatever existing content is there into the NTFS partition, then chain-link from the first link made into the home partition, where a piece of software expects it. For example, if you set up your dropbox directory to reside in /mnt/Storage (or ~/.ntfs), and as a Pidgin user your .purple directory is hosted there, you can then do this to make Pidgin usable without needing to specify the profile location to use;
ln ~/.ntfs/Dropbox/.purple ~/.purple

Or for Steam when you run out of space for games, or need more space for other things:
mv ~/.steam ~/.ntfs ln ~/.ntfs/.steam ~/.steam

It doesn’t even have to be explicitly named the same, the name can differ from the link name; here’s an example of that with Steam, once again;
mv ~/.steam ~/.ntfs/Steam\ library ln ~/.ntfs/Steam\ library ~/.steam
Yes, space being a special character requires a backspace in Bash.

As demonstrated, links can be very empowering and liberating for an end-user if used properly. The payoff of setting it up like this, is when you next boot into Windows or Mac with Paragon NTFS installed; You can access the NTFS partition and use whatever files you made in Linux, in Windows, without needing a solution like Ext2Fsd to read an Ext4 partition; something an IT admin at your local library or school might not have any idea about.

1 Like