|
Enable the «persistence»Means that any changes you make to the system will be remembered when you start it again the next time. This is something that does not happen in most LiveCDs or LiveUSBs. Tools like Unetbootin and the like allow you to install some distros by enabling persistence. However, few Live distros support this option, here is one alternative what should function using any distro. |
This is the way to install a Linux OS (it shouldn't matter which one) to a USB (which must be in FAT32 format).
Surely you have noticed that in all Live distributions, when they are loaded into memory, any changes made to the system disappear the next time you start it.
Distributions that allow persistence, on the other hand, require the creation of a separate partition on the USB drive to hold the items that we want to be persistent (particularly the HOME folder).
Unfortunately, this is an option that very few distributions support.
The other day, I remembered an alternative that some reader had mentioned far and long ago and that I always wanted to try. I did it and was fascinated. It's so simple that it makes it beautiful: get persistence by installing the system on the USB drive, as if it were a hard drive.
Introduction
As an example, I'm going to use Crunchbang, a Debian-based distribution that uses Openbox and is very lightweight. I have used it to "revive" a machine with just 512 MB of RAM.
Download: Crunchbang official site (excellent distro)
It is possible to install Crunchbang on a 2GB drive, but I recommend using at least 4GB or 8GB in case you want to install extra apps.
Here is a step-by-step explanation so that no one gets lost ...
Step 1:
To start there are several possibilities: boot from a Live CD / USB or from a virtual machine. It all depends on the resources you have. My recommendation: use a LiveCD.
For more information on what is a LiveCD, how to create it, and how to make the system boot from CD, we created an extensive tutorial to help you.
Once the LiveCD has booted, select "Graphical Installer".
Step 2:
Select the language language.
Step 3:
Select your location.
Step 4:
Select your keyboard layout.
Step 5:
Select the host name. The one that comes by default will be fine for 99,9% of people.
Step 6:
Select your username.
Step 7:
Please enter your name. It is the same that will be used by email programs, etc.
Step 8:
Select the password. This is the administrator password that will be used as the password so that sudo can complete the administrative tasks.
Step 9:
Select your time zone.
Step 10 (from here things get more difficult)
Now we are ready to split our USB drive. Select the Manual option.
Step 11:
Find your USB drive and select it.
Click continue.
Step 12:
Change the "Use as:" option to ext3 or ext4, make the mount point / (root), and make sure the "boot flag" is set.
Step 13:
Select the option Finish partitioning and write changes to disk. This is your last chance to verify that the data entered is correct and that you are not modifying another disk.
Step 14:
A warning will appear saying that you forgot to create a swap partition (SWAP). I just chose the "no" option. A swap partition only takes up valuable disk space and puts the life of your USB drive at risk. On the other hand, it is possible that it makes the system slower (taking into account the characteristics of the type of installation we are doing).
Step 15:
Select "Yes" to finalize the partition.
Step 16:
The partition will be done and the system installation will begin. This is the perfect time to have a snack. 
Step 17:
This is VERY important: select "DO NOT install Grub on my computer's MBR".
Step 18:
Now you have to let Grub know the location of your USB drive. In general this is usually / dev / sdb1, but it is very possible that it is something else. You have to replace sdb1 with the letters and number that you wrote down in step 11.
Step 19:
Remove / unmount the LiveCD or LiveUSB. Restart the computer and configure the boot priority for USB in the BIOS.
Step 20:
Enjoy your persistent Linux. 
This is what my Crunchbang looks like with Iceweasel (and 2 open pages) and mtPaint open. It barely consumes 300 MB. The system loads with 80 MB of RAM, approximately. A luxury.
final recommendations
Disable internet browser cache. In Firefox / Iceweasel that is very easy. I opened the about: config page and looked for the network.http.use-cache option. To deactivate it, double click on it. It should be false.
Facilitate web browsing on machines with few resources. First of all, it is essential to enable the plugins.click_to_play option in the about: config of Firefox. This will disable Flash by default, unless you click on the item.
A second recommended configuration is to change the User Agent to make the pages (Gmail, Google, etc.) believe that we are using a tablet. As you all know, some websites have their "light" versions for better viewing on tablets or mobile devices. We can use this possibility to our advantage changing the User Agent by hand or using one of the many Extensions that exist for Firefox.
Mount partitions at startup. Although it is not essential, since almost all Linux distributions detect the partitions and allow them to be mounted at the time of use, you may want them to be mounted when the system boots (perhaps to establish shortcuts in your file explorer or any other reason). In that case, you have to modify the fstab file.
Assuming the typical case of wanting to mount NTFS partitions, I opened the / etc / fstab configuration file:
sudo nano / etc / fstab
And add a line similar to the following:
UUID = EA7CB00F7CAFD49B / media / win ntfs defaults 0 0
Replacing the UUID with that of your partition (to find out, run sudo blkid), / media / win with the path where you want the partition to be mounted (don't forget to create the necessary folder first using the mkdir command). The rest is usually fine for a traditional setup. In case you need to change the access privileges to the partition, you can.
To more information about fstab I recommend reading an old article posted on the blog.
