Red Hat Distro with Persistence

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
340
Reaction score
367
Credits
11,754
Many people like to have multiple Linux distros available to use. The problem for most people wanting to install multiple distros is that it would require major partitioning of their hard drive leaving little space for each distro. The main distro installed would be the primary one used and the others would be used temporarily. I like to use the other distros to test programs and installation requirements, but I do not use the other distros on a common basis. Other people may have their own reasons for using other distros.
If space is not too major an issue for a distro then having a bootable thumb drive would be a perfect solution. The problem with the bootable USB drive is that changes made to the Linux distro would not be saved. To get around the issue of not saving changes there is the option of Persistence (for more on persistence, see the articles: Creating a Fix Stick and Fix Stick Upgrade).
These two articles are mainly for Ubuntu systems, but this article will cover the creation of a Red Hat bootable USB Stick with Persistence.
There are three basic steps for this tutorial and they are:

  1. Files required
  2. Setup with an Ubuntu system
  3. Setup with a Red Hat system
Everyone will have to start at Step 1. If you have an Ubuntu system then you need to perform steps 2 and 3 as well. If you are running a Red Hat system already, such as CentOS or Fedora, then you need to perform step 3 and skip step 2.

Files Required

To install a Red Hat distro you will need the following files:

The first file is CentOS 7 for a 64-bit system. If you would prefer to use Fedora or another distro then simply download the file you need. Look for a ‘Live’ version.

Setup with an Ubuntu system

If you are installing from a distro other than Red Hat then this step is necessary since an image with persistence can easily be done with a Red Hat system. This step will require a second USB Stick to boot from CentOS, in this case, to perform the necessary steps.
On your system you will be using to setup the USB Stick you will need to have the program Unetbootin. If you do not have it installed then you can perform the following commands in a terminal to install it:

  • sudo add-apt-repository ppa:gezakovacs/ppa
  • sudo apt-get update
  • sudo apt-get install unetbootin
To start, the first USB Stick should be formatted as 2 partitions using FAT32. I am using an 8 GB thumb drive for my installation media. The second USB Stick is for the Persistence installation. The 8 GB stick is formatted as two - 4 GB partitions. The first partition is labeled as ‘CentOS’ and the second is ‘RPM’, to make things easy. The first partition will be the CentOS boot and the second partition is for the two files we downloaded in the previous step. Copy the two downloaded files to the ‘RPM’ partition.
In a terminal use the command ‘lsblk’ to list the drives. Look for the one labeled ‘CentOS’ and remember the ‘Name’, such as ‘sdc1’. Start Unetbootin and select to use a ‘Diskimage’ for an ‘ISO’ and select the location of where the ‘CentOS-7-x86_64-LiveGNOME-1804.iso’ file is located (unless you are using a different image). Set the ‘Drive:’ to the location you noted when running the ‘lsblk’ command. If the USB stick was found at ‘sdc1’ then the ‘Drive:’ would be ‘/dev/sdc1’. If the stick is not found by Unetbootin, then make sure it is formatted as FAT32.
Once all is set, then click on the ‘OK’ button.

NOTE: All files on the selected partition will be erased.

Once the USB Stick imaging is completed boot from the USB Stick. You may have to press a key, such as F12, during the BIOS screen to boot from the USB Stick (your system may differ). Once the menu is shown from Unetbootin select to ‘Start CentOS 7’. Once CentOS 7 is loaded you will be asked questions, such as language, to set up CentOS. Every time you boot from this USB Stick you will be asked the same setup questions. Once the desktop appears you may need to configure the Network Connection if you use Wi-Fi (the Wi-Fi password). Once you are connected to the Internet if possible, open the RPM partition in a terminal.
An icon for RPM should appear on the desktop. Right-click on RPM and select ‘Open in terminal’. To install the EPEL repository you run the command ‘sudo yum install -y epel-release-latest-7.noarch.rpm’.
After the EPEL repository has been added you will need to install the needed tool with the command ‘sudo yum install -y livecd-tools’.

Setup with a Red Hat system

If you are starting with a Red Hat system you will need to install the EPEL repository as well as the ‘livecd-tools’ as mentioned in the previous two paragraphs. Once you have the ‘livecd-tools’ installed then you can continue on with creating a CentOS 7 bootable USB with Persistence.
A USB stick is needed to install a Persistent image of CentOS 7. The Stick should be 16 GB or more. I am using a 32 GB USB Stick. Format the Stick as FAT32 because it will be erased anyway. The FAT32 formatting will be modified soon.
Insert the second USB Stick into the system USB port. Run the command ‘lsblk’ in a terminal to find the name of the new Stick. On my system it is ‘sdh1’.
The USB Stick needs to be unmounted to be imaged. Use the command ‘umount /dev/sdh1’. Change the name of the device as needed for your system.
The next command will copy the necessary files from the Live image to the USB Stick: ‘sudo livecd-iso-to-disk --format --overlay-size-mb 20480 CentOS-7-x86_64-LiveGnome-1804.iso /dev/sdh’. The USB Stick will be formatted and the image copied and a persistence file of 20 GB created. Once started the ISO image will be checked and you will be prompted to format the specified drive.
Once the process is done you need to restart the system and remove the first USB Drive you booted from leaving the second to boot from following the steps you performed to boot from the first drive.
The first time you start CentOS you will be asked a few setup questions. Once the system is configured and running you can add users and make other changes as needed. After a reboot the initial set of configuration questions will not be asked again unless you log in as a new user.
If you create a new user then you can add the user to the ‘wheel’ group to have Administrative privileges. The command to raise the permissions is: ‘sudo usermod -aG wheel username’. You will have to log out and back in again for it to take effect.
To find the current version of CentOS use the command: ‘cat /etc/redhat-release’. You can perform an update from a terminal with the command: ‘sudo yum -y update’.
You should now have a fully functional CentOS 7 USB Stick with Persistence.
 

Members online


Top