Content of the material
- 1. Download Kali Linux 2021 (Live)
- 4. Linux does not boot due to computer hardware changes
- 4.1 Linux does not load after adding/removing a disk
- 4.2 New graphics card
- How to see what errors dont load Linux
- 5. Cryptsetup / LUKS Encryption
- Step 2b: Formatting the USB Drive (Linux)
- Step 4: Partitioning
1. Download Kali Linux 2021 (Live)
In this guide we are using the Kali Linux Intel/AMD 64-Bit (Live) image, which most modern PCs support.
If you have a torrent client, use the Kali torrent download link to speed up the download (10 minutes) as sometimes throttle web downloads heavily.
4. Linux does not boot due to computer hardware changes
4.1 Linux does not load after adding/removing a disk
Linux drive name depends on the number of drives on the computer. The first drive on Linux is usually called /dev/sda, the second drive is called /dev/sdb, the third drive – /dev/sdc, and so on. That is, usually the name has the form /dev/sdX, where a Latin letter comes instead of X. The names may be different – it depends on the type of hardware interface, but usually it's still /dev/sdX. By the way, disk partitions are also called the same as the disk itself, but a number is also added. For example, the first partition of the first disk is named /dev/sda1.
Since the letter depends only on the serial number of the disk, when transferring to another computer, the name of the disk may change. For example, your Linux disk was second and called /dev/sdb, and on the other computer it is the third disk and it is called /dev/sdc.
The problem here is that the name of the disk is written in the bootloader settings and if the name has changed, then it cannot load the Linux kernel and, therefore, the entire system.
A clear sign of an incorrect drive name in the bootloader settings is a related error:
Its reason is that the GRUB settings point to an invalid drive, for example, to a Windows drive. The system does not understand the disk file system and cannot continue loading. This problem is solved quite simply.
Restart your computer, and when the GRUB bootloader menu appears, press e. You will see something like the following:
Pay attention to the line starting with linux. In my case there is a record
Since during the installation on the virtual computer there were no other media except the flash drive, it was given the name /dev/sda1. The real computer has at least one more hard drive, and the name /dev/sda1 could be assigned to it. And the flash drive I'm trying to boot from now has a different name. This name can be /dev/sdb1, or /dev/sdc1, or another (depending on the number of disks in the system).
If you don’t know the new name, then just go through the different options. Move the cursor to the disk name and change it to /dev/sdb1. After that, press the F10 key and wait for the download. If the download is unsuccessful, then restart the computer and change the entry to /dev/sdc1 (and so on alphabetically), press F10 and verify that the download is successful.
After a successful boot into the system, change the name of the bootable disk. For example, in my case, the drive name was /dev/sdc1 (with the letter c). Then the command to change the boot disk will look like this:
Replace /dev/sdc with the name of your drive or flash drive.
Now, when rebooting, an error will not occur.
4.2 New graphics card
If you replaced the video card, then see the section “3.1 Unable to boot after installing the video card drivers”.
How to see what errors dont load Linux
There are two ways to see errors that prevent the system from booting:
1) on screen while booting
2) using the journalctl command
Sometimes the system hangs tight and it is impossible to use the journalctl command, then in this case only the first option remains. But another problem is that many Linux distributions hide booting log output under splash screen or boot silently.
1) To return to displaying the system boot log, follow these steps:
1.1 On the boot menu, press e (or TAB). The download options window opens. If there are several lines in it, then move the cursor to the line that begins with
1.2 See if “quiet” and “splash” appear on this line?
- quiet means do not show download progress messages
- splash means show splash screen
1.3 Remove both of these lines and start the download (F10 button). Look at exactly what errors prevent the system from booting.
2) How to view the log of the last boot
If you managed to log in, even if only with a command line interface, then use the journalctl command to display the boot log:
Or use the following command to save information about the last boot to a file:
5. Cryptsetup / LUKS Encryption
cryptsetup is a utility used to conveniently set up disk encryption using LUKS Encryption.
As my persistence partition is
sdb2, the commands below will reflect that. Make sure to replace
sbd2 with your own persistence partition, otherwise you might overwrite data accidently. You have been warned!
YES and press
ENTER to wipe the partition.
Enter a password twice. You can generate a strong password here. Make sure to keep it safe. Once the partition is encrypted, you cannot recover it without your password.
LUKS Encryption has now been applied to your persistence partition.
Now open your encrypted persistence partition.
Enter your password.
Step 2b: Formatting the USB Drive (Linux)
For this, we will be using gparted. If you don’t have it, it is available in the default repos on most distributions. Simply issue the installation command.
Ubuntu & Derivatives:
sudo apt-get install gparted
Fedora & Derivatives:
sudo yum install gparted
Plug in your drive and open gparted. In the top right corner, and select the /dev/sdb object. Right click the main partition and click unmount.
Under the device menu, select ‘Create Partition Table’ and approve it. You will then see that the drive has been converted to unallocated space. Right click the space, select new.
Change the file system type to FAT16. THIS IS IMPORTANT.
Pick a label and click add. Press Ctrl+Enter to apply the operation.
And that’s it. After installing the correct graphics drivers, your Kali Linux installation will boot into graphical mode without any problems.
If you have any problem with any step mentioned above, do not hesitate to drop it in the comment section below. I will reply ASAP.
Step 4: Partitioning
At this point you will see a asking you to configure disks. Click manual and then continue and you will see this screen (left).
The middle section is a list of all recognized storage drives. If you have already configured your partition, skip this next part.
Click on the partition you created in step 6 and click continue.
If you reach a screen asking you to create a new partition table, click yes if you are using Kali by itself, no if you are dual-booting then click continue.
On the next screen, you will see a list of all devices and partitions, including your created partition, or FREE SPACE if you are installing on a single OS computer. Click on the desired partition and click continue.
If you are asked to create a new partition, simply point and click through the wizard until you see this next screen:
On this screen, make sure it is set to Ext4 journaling file system. Set the mount point to / and label it something. Click “Done setting up the partition” and Continue to move on to the next step.
This will take you to the previous screen, with your new partition. Verify it is correct, then select “Finish partitioning…” and click Continue.
You will be prompted with a screen requesting you to make a swap partition. Click NO and continue. On the next screen, it will confirm that the changes be written to the disk. Click YES and Continue. Shortly after this, it will install the system to the HDD. Simply point and click through the remainder of the wizard, and when it is installed, simply reboot. Take care to remove the USB drive first.
Note — After install, if Kali doesn’t appear in the GRUB bootloader for your current system, open your current Linux system and issue the following command: