Wednesday, March 18, 2015

How to create a Linux Mint persistent live USB





So..What exactly is a Linux Mint persistent live USB?

A Linux Mint Protestant Live USB drive is a USB memory stick with the Linux Mint Operating system installed, and is BOOTABLE. Which means, you can plug the memory stick into an open USB port, power up the PC or Laptop, and boot into Linux Mint off of the stick. You can use the copy of Libra Offices on the stick to edit documents, or FireFox to surf the web (provided you have an Internet connection of course). There is also a few gigs of free space on the USB to save your work.
You can also install Linux Mint onto the PCs hard drive from the USB if you wish.

When you are done using the computer, you simply halt the system, remove your USB, and restart. The PC will then boot off the hard drive again and go back to being a Linux, or Windows, or Mac machine.


There are a few very good reasons why someone would want to do this:

1. You can create such a USB for someone new to Linux, to try it without having to install it on their hard drive. If they find that they like it, they can use the USB to install Linux Mint on their hard drive.

2. You can carry your 'system' and any project files you are working on in your pocket. You simply need to find an available PC, boot off the USB, and all your 'stuff' is ready to go.

3. You can use this USB to boot a system that has crashed and won't boot on it's own. Then, copy (Recover) the files off of the failed systems hard drive. If you have the right packages installed on your USB, you can also (in most cases) repair the software on the failed PC and get it working again. Note: One of the future blog entries I'm working on is how to create a “Disaster Recovery USB” with all kinds of tools and tricks for recovering deleted files, 'fixing' and sick computer. Stay tuned to my blog list for updates soon.

4. Its just kind of geeky cool to have a few of these around to show your friends and co-workers. They will think your some kind of IT ninja; the person to call for help for their computer issues.


What is needed to create a Linux Mint persistent live USB?

1. You will need a PC or Laptop running Linux with an Internet connection. After the USB has been created, you will be able to use it without that Internet connection.

2. You will need a good quality USB memory stick, at least 16 gigs in size. You should buy a high quality one; the faster the better. Also, the larger the better; you will want extra space to save any documents or other files you might want to keep on your USB.

3. A pen and paper to take notes.

4. You will need about an hour of time to do this.


WARNING...WARNING...WARNING...WARNING...
This process will erase ALL the data on the USB stick.
Be sure to back it up, or better, use a brand new USB stick for this process.


Step 1 – Download the ISO image.

To start, you will need to download an ISO image of Linux Mint. 
I suggest the Mate 32 bit version since it runs easily on almost every computer. 

To download it, go to the Linux Mint download site (http://www.linuxmint.com/download.php) and select the Mate 32 bit version of Linux Mint.

Don't select the version that says “No Codex”.

You will then be asked from which of the 'Primary download mirrors' you want to download from. Try to select a site nearest to your physical location as it will be the fastest.

Depending on the speed of your connection, it should take about 20 minutes to download.

It will most likely save the file to your 'Downloads' folder. The file name will be something like “linuxmint-17.1-mate-32bit.iso” depending what what the current version of the package is.




Step 2 – Install a few additional packages needed to create the USB.

Open a terminal window by holding down the [Alt] and [Ctrl] keys on your keyboard, and tapping the letter 't'.

Enter or cut/past the following commands, one at a time. You will be prompted for your password.

    sudo apt-get update
    sudo apt-get install unetbootin -y
    sudo apt-get install gparted -y



Note: At this point, all the prep work is done. You can now follow Step 3 and down, to create as many of these USB devices you wish.


Step 3 – Create the partitions

Now plug your USB stick into any open USB port, wait a few minutes for it to mount, and enter this command into your terminal window. This should open the Gparted window.

    sudo gparted

VERY IMPORTANT: In the upper right corner of the Gparted window, change the device from your hard drive (/dev/sda) to your USB stick (probably /dev/sdb). If you don't do this, changes you make here will affect your hard drive instead of your USB. You will know you have the right device if it shows that the size is just less than 16 gigs, or whatever size your USB stick is.



Now, right click on the existing FAT32 partition, and select Unmount.



Then, right click again on the existing FAT32 partition, and select Delete.


Now, to create the static FAT32 partition where we will be installing Linux Mint.

Right click on the “unallocated” partition, and select New.
Change the size of the new partition to 1500 Megs,
Change the File system to FAT32,
Leave all the other fields at their default values,
and click the Add button at the bottom of the window.



Now to create the persistent partition where we will be able to save stuff.

Right click again on the “unallocated” partition, and select New.
This time change the file system type to ext2
and set the Label to casper-rw (all lower case letters)
Leave all the other fields at their default values,
and click the Add button at the bottom of the window.




Now hold down the [Ctrl] key on your keyboard and tap the [Enter] key. This is the keyboard shortcut to apply the changes.

Click on the “Apply” button to apply the changes.

This will take a few minutes to complete.
When it's completed, just click on the “close” bottom to get back to the gparted window.



Now to tell it that the FAT32 partition is bootable.
Right click on that first FAT32 partition, and select “Manage Flags”.
Click on the box next to “boot” so that it's has an “x” in it,
then click on the “close” button.

Your screen should now look something like this. The size of the ext2 partition may be different depending on the size of your USB stick. In this example, I'm using a 16 gig USB. Remember, you want a high quality and fast USB, with lots of space to store stuff.



Now, exit from gparted. We are done with it for now.

Remove the USB from the USB port. Wait abut 15 seconds.
Put the USB back into the USB port. Wait another 15 seconds.
This will open two new File Manager windows. Don't close them as we will be using them very soon. Just minimize them to get them out of the way for now.


Step 4 – Installing the Linux Mint ISO

In your terminal window, enter the following command. This will bring up the Unetbootin window.

    sudo unetbootin

Click on the radio button next to “Diskimage”.
Click on the “...” button to the right, select your “Downloads” folder, and then the linuxmint-17.1-mate-32bit.iso file that you download in step 1.
In the field for “Space used to preserve files”, change this to 100.
Leave all the other fields at their default values.

Your window should now look like this.



Click on the “OK” button.

When you are asked if you want to “Reboot Now” or “Exit”, select “Exit”. We still have a steps before we are ready for the reboot.

Now, go back to that File Manager window that opened when we plugged the USB stick back it. That's the one showing the 1.6 gig partition.

Right click on the 'casper-rw' file and Delete it. This will force Linux to use the casper-rw partition instead of this file to save stuff.


Now, close all your windows, and shut down your PC.
You will want to shut your PC all the way down and powered off.

It's time to boot from the USB for the first time.


Step 5 – Booting from the USB for the first time.
Please read all the instructions for Step 5 BEFORE you begin.

Now is the time to boot from the USB for the first time.

Make sure that your bootable Live USB is in one of the USB ports.
Restart your PC by pressing the power button.

As it's booting up, you should see a quick message flash at the bottom of your screen saying something like “Press F2 for Setup, F12 for boot menu”. You want to get to that “Boot Menu”. On most PCs, it's going to be the F12 key, but on some models, it could be the [Del] or [Esc] key.

On a Mac, you need to press and hold down the “option” key while it's powering up.

On some very old PCs, there is no boot menu. You will need to go into Setup and change the “Boot Order” so that the PC will try to boot from anything in the USB port before trying to boot from the hard drive. You should see the instructions on how to do this at the bottom of your Setup screen.

If the F12 key is not working for you, and you don't see that message saying what key to press, then you might want to check out this web site. It has a table listing the most common computer models and what key will get you to the boot menu.


When you get to the Boot Menu, use your up and down arrow keys to select the option to boot from the USB device, and then press Enter.




Next comes the UNetbootin menu.
Use your up and down arrow keys to select the
“Start Linux Mint 17.1 MATE 32-bit (compatibility mode)”
option, and press Enter.



On some computers, when the USB boots for the first time, it gives an error saying something like
“Could not find the ISO”. A screen shot of such an error is bellow.
If you get this error, just enter the world
exit
in lower case letters, and press Enter. The boot process should then continue.



The first boot up is very slow as there is a lot of house keeping that has to be done. It may take several minutes.
After the first boot, you will find that it will boot much faster.



Step 6 – Final odds and ends.

When you finally get it booted from of the USB, there are just a few last tasks to take care of.

1. Connecting to the Network; Just click on the network icon on the bottom of the screen and select the WiFi or Ethernet connection you use. You should be prompted for any passwords needed. Once this is done, the info will be saved onto the USB so you should not have to do this again. Be sure to open FireFox and test that you are able to get to a website like www.cnn.com

2. Set the time zone; You will see that the clock at the bottom of the screen has the wrong time. This is because the time zone is not set yet. To set your time zone, open a Terminal window by holding down the [Ctrl] and [Alt] keys, and tap the letter 't'. Then enter this command, and answer the questions as they come up. Once the time zone is set, the info will be saved onto the USB so you should not have to do this again.

         sudo dpkg-reconfigure tzdata

3. Label your USB: Also, don't forget to stick a label on your USB so you know what it is (see example photo at the top of my blog entry).



CONGRADULATIONS!
You now have a Linux Mint persistent live USB.



That's all for this time. Bye ya'll.



No comments:

Post a Comment