Tutorials/Playing and saving Minecraft on a thumb drive

This tutorial explains how to run Minecraft on a portable drive. This is useful if you want to retain your game data (launcher profiles, worlds, resource packs, etc.) when switching computers.

The primary focus of this guide is to create an installation of Minecraft on a portable drive. However, the exact same steps can be followed to create a portable installation of the game; that is, an installation that is not so "integrated" with the computer, which is useful for managing multiple installations and generally keeping things organised.

Please note that this tutorial will only work with the modern 2.0 launcher, thanks to the addition of the  option. It will not work with the older launchers.

Instructions for Windows
'''For the sake of this explanation, this tutorial will guide you through installing the game to. However, this guide can be used to install the game to any directory. When following this guide, replace this directory with the directory you actually want to install the game to.'''

Setup
Before making the game portable, it is important to move all existing game data to the desired directory. Navigate to the portable drive in the file explorer, and create the  directory. Navigate to the  folder and copy all of its contents (but not the folder itself) into.

Once the game data has been moved to the new directory, you now need to move the launcher there too. Simply move  to.

Now all files are in place, the last step is to create a shortcut to the launcher. This shortcut must also be in. Once the shortcut has been created, right-click it and select Properties. In the Target field, append  to the end of the string that is currently there. Once done, the full Target field should read:.

Everything is now finished. When you want to play, just use the shortcut to launch the game. Do not start the launcher directly (without using the modified shortcut), or the game will just use the default directory in  as its working directory. It is recommended to set the launcher's executable to have the "hidden" attribute to avoid accidentally running it.

Instructions for launcher versions 1.6 and lower
WARNING: If not done correctly, Minecraft may crash or fail to start

Preparation

All folder and file names in the Windows guide are case sensitive. This section will guide you on copying your game data (worlds, saves data, resource packs, server list, etc.) onto the portable drive. If you do not want to copy your game data, you may skip this section.
 * 1) Insert your drive into your computer, and open it.
 * 2) Create a folder, name it Minecraft Portable and enter the folder.
 * 3) In Minecraft portable, create two new folders and name them Launcher and Data. Use the exact names specified.
 * 4) Add the launcher/client to the portable drive:
 * 5) Download the Minecraft launcher.
 * 6) *You can download it from this direct link or by visiting the Minecraft Downloads page.
 * 7) *Make sure you use the "Minecraft for Windows (alternative)" version. This can be found by clicking on "Try an alternative download" on the page.
 * 8) Copy the Minecraft.exe to the Launcher folder that you have created on the portable drive.

The .minecraft folder contains all of your current game data.
 * Press +
 * Enter %appdata% and click OK.
 * Locate your .minecraft folder and copy it
 * Copy the .minecraft folder and paste it into the Data folder

Setup
Now that all the data files are in the directory, a batch file will need to be created. set appdata= D:\Data start Launcher\Minecraft.exe set appdata= D:\Data java -jar Launcher\Minecraft.jar 3. Now click File > Save As ...
 * 1) Open Notepad.
 * 2) Copy and paste the following
 * If you would like to use Minecraft.jar, copy and paste this instead:

4. Navigate into your Minecraft Portable folder (not Data).

5. Name this file "StartMinecraft.bat"

Note: Make sure not to include the quotation marks ("") and choose "All Files" for the "Save As Type" field, or else Notepad will try to correct it to StartMinecraft.bat.txt and it will open as a text file rather than an executable script.

If you are getting an error stating that the system cannot find Minecraft.exe(or .jar, depending on what launcher you are using), use this script instead set appdata=D:\Data cd "D:\Launcher" start Minecraft.exe

Playing

 * To run, double-click the StartMinecraft.bat file.

Additional Notes

 * To install resource packs or mods onto the portable drive, use the .minecraft folder of that portable drive.
 * If there seems to be a problem with the StartMinecraft.bat and the command window closes before you can see what the issue is, add "pause" on a new line. This will keep the window from closing immediately after attempting to launch the Minecraft launcher.
 * If you would like to have multiple .minecraft ("Data") folders in order to quickly switch to an older version of Minecraft or play with mods, make multiple "Data" folders, with different names ("1.6.4", "Modded", and so forth) and a batch file for each one. You may have to make a second "Drive" folder if you want to use 1.5.2 or before, as that uses an older launcher.

Setup
Assume that the portable drive is at /dev/sdb1 and that Minecraft is installed at ~/games/.minecraft. Run the following in a terminal: umount /dev/sdb1 mkdir /media/minecraft mount /dev/sdb1 /media/minecraft mkdir /media/minecraft/games # If there is a folder called games in your portable drive, skip this command cp -rn ~/games/.minecraft /media/minecraft/ # This might take a while cd umount /dev/sdb1 rm /media/minecraft # Check to make sure that your portable drive is not mounted! After that, to launch Minecraft, enter the following in the terminal with superuser privileges. umount /dev/sdb1 mkdir ~/games # If there is a folder called games in your home directory, skip this command mount /dev/sdb1 ~/games # You will not be able to play any games that are saved in the ~/games directory Run the Minecraft launcher to start playing.
 * Note: You may need to use a different directory name depending on your distribution and set-up.
 * Note: The following commands require may require superuser privileges. Make sure you are running these as root or are using sudo.
 * Note: Text following the # symbol are comments, and can be omitted for that line.
 * Note: 'cd ~/.minecraft/' is the same as 'cd /home/user/.minecraft/'

Or use this script: mv ~/.minecraft ~/.minecraft.bak cp -a minecraft ~/.minecraft java -jar minecraft.jar mv minecraft minecraft.bak cp -a ~/.minecraft minecraft rm -r minecraft.bak rm -r ~/.minecraft mv ~/.minecraft.bak ~/.minecraft

Setup

 * Locate your Minecraft files. Press Command+Shift+G while in finder and then paste ~/Library/application support/minecraft into the dialog.
 * Copy that minecraft folder in your application support folder.
 * Insert in your portable drive and make 2 folders in it:
 * data and launcher (caSe SensiTive)
 * Paste your minecraft folder into the "data" folder in the portable drive.
 * Drag your launcher into the "launcher" folder
 * Remove your portable drive

Playing
Once you are done setting up, you can test if your Minecraft can start on another Mac. Or use this script: mv ~/Library/Application Support/.minecraft ~/Library/Application Support/.minecraft.bak cp -a minecraft ~/Library/Application Support/.minecraft open Minecraft.app mv minecraft minecraft.bak cp -a ~/Library/Application Support/.minecraft minecraft rm -r minecraft.bak rm -r ~/Library/Application Support/.minecraft mv ~/Library/Application Support/.minecraft.bak ~/Library/Application Support/.minecraft
 * Insert your portable drive into another Mac to test
 * Open the launcher folder and move the Minecraft launcher into your Applications folder.
 * Double click the launcher to run it. Then after Minecraft loads, exit it.
 * Again, go to Users/USERNAME/Library/Application Support
 * In "Application Support", delete the minecraft folder.
 * Move the minecraft folder in your data folder on your portable drive to the desktop.
 * Then drag it from your desktop into application support.
 * Run Minecraft again.

Source
If you have any trouble understanding, the original guide can be found in this forum thread.