How To Install rEFInd Using Gparted, Arch Linux and Super Grub2 Disk

This tutorial outlines how to install the rEFInd Boot Manager on a GPT partition. When using UEFI boot, you should understand you will require a bootable esp partition that houses either the Windows Boot Manager, GRUB2, or rEFInd. I don’t know much about MacOS so do not follow these instructions exactly if you are using Mac (some may apply).

To install and use rEFInd, you need a little EFI partition with rEFInd on it or by copying the files and setting up the boot entry manually.

Most people can just install rEFInd and then run refind-install. Work out if you’re on GPT or MBR partition table, how many drives you have, which one you want to boot from. Don’t run all the commands on this page until you’ve read it all. It’s not a perfect guide but it worked for me:

I now have:

  • Arch on GPT NVME SSD (unbootable, no grub)
  • Second GPT Hard Disk with 2GB fat32 following by 968GB of free space/ext4

Before the guide, I had:

  • Arch on GPT NVME SSD (unbootable, no grub)
  • Second MBR Hard Disk with one big NTFS partition

You should read most of the official page first too. I don’t have Windows so I don’t know if this will allow you to dual boot or triple boot to Mac.

If you have a ESP partition you can do this

sudo pacman -S refind-install
refind-install

If you don’t have a little ESP partition, this guide may be for you.

During this tutorial we will be making a new fat32 partition on an unmounted disk that is bootable and installing rEFInd to that little partition.

If you only have one hard drive, you need to do all of this from the rEFInd live disk. I read that it doesn’t work on the Arch live USB because kernel files from the live USB are copied instead of the Arch kernel files.

If you have two hard drives on the computer, connect the drive you want to install boot partition on (rEFInd) with a caddy or HDD Drive Housing to USB and edit the partitions that way.

Be very careful resizing partitions with data as you can lose the data when resizing, no matter how careful you are.

It’s possible to use GPT on a data disk even on a BIOS-based computer, or to use an MBR data disk even on an EFI-based computer. Thus, if you examine the wrong disk, you can be led to an incorrect conclusion about your computer’s boot mode.
Another caveat relates to the use of a hybrid MBR, which is a variant on a GPT disk that’s most often used on Macs to permit booting Windows in BIOS mode and OS X in EFI mode. Most Windows tools will identify a hybrid MBR disk as an MBR disk, but most non-Windows tools will identify it as a GPT disk. Of course, as hybrid MBRs are generally used to enable dual-booting Windows and OS X, and as OS X boots in EFI mode, you should be able to install rEFInd from OS X to help manage such a dual-boot configuration.

https://www.rodsbooks.com/refind/bootmode.html

There are many different scenarios that need to be discussed before deciding where to install the esp partition and with what software too.

The most important thing is to build a recovery USB first. If you don’t build a boot recovery USB and you modify your GRUB or rEFInd files, you will most likely leave your system unbootable. The most common reasons for not being able to boot are (I have experienced all of these lol):

  • if you delete the Windows Boot Manager partition
  • if you install Windows in GPT/MBR and your Linux installation is MBR/GPT
  • if you delete GRUB2 entries
  • if you auto-install GRUB2 or rEFInd
  • if you try to install GRUB2 or rEFInd on a mounted disk (OS running)
  • if you try to boot Windows in UEFI mode or legacy mode and installed Linux in the opposite of the one you booted in
  • if you delete GRUB2 without installing rEFI
  • if you delete boot or kernel files, or move them to abnormal places
  • if you delete the wrong partition
  • if you format the wrong partition into ext4 or fat32 or else
  • if you leave Secure Boot on and cannot boot from USB

Step 1: Build a recovery USB to absolutely make sure you can boot again

Download the Super Grub2 Disk iso from the official website and use balenaEtcher to burn the ISO file to a USB. Make sure you burn to the right USB.

Or use the official rEFInd USB flash drive image file and use balenaEthcher to burn it.

Reboot now and test the recovery USB but only if you haven’t changed anything yet! Make sure your USB works. You might need to turn on Legacy Support, USB Boot, disable Secure Boot or change the boot order.

If you don’t have a USB, use a CD and burn the Super Grub2 Disk ISO onto the CD.

If you don’t have a CD or a USB stick, you must be very careful because you are making changes to boot processes of your computer. If you reboot, or power goes out, or your battery dies during the changeover process, you will have a big problem and most likely be unable to boot.

Do not proceed without a bootable drive, or second computer handy. I once had to install bootable EFI files onto my phone’s SD card and then try to boot into the SD card slot! Waste of time, get a USB handy.

Step 2: Check if you are using GPT or MBR partitioning

Since Arch linux is 64 bit by default, we skip a step here in figuring out whether we want 32bit or 64bit rEFInd.

Get GParted and Gnome Disks to edit disks with the GUI as command line will take hours.

sudo pacman -S gnome-disks gparted

Open BOTH gparted and Gnome Disks and check ALL the drives in both of those programs to check which drives are connected to your PC.

Make sure GPARTED and Gnome Disks show the EXACT same drives and order of all the partitions. I have experienced a discrepancy before where a drive was showing “Empty/Unallocated” in Gnome Disks but showing up perfectly in GParted. This is scary stuff. <– If this error happened to you, scroll to bottom I will explain how I saved my data

Check your drives in the shell terminal by first listing your removable media

ls /dev

And checking all of the sdX and nvmeX drives with fdisk -l to verify what Partition Tabling they are using.

Check your drives partitioning tables now :

sudo fdisk -l /dev/sda
sudo fdisk -l /dev/sdb
sudo fdisk -l /dev/nvme0n

Look for DOS or GPT.

DOS means MBR Partitioning. GPT means GPT…

DOS/MBR Partition can boot from the normal MBR partition and you should install GRUB or rEFInd there.

If you have a MBR linux disk without the Master Boot Record, or Windows Boot Manager, it won’t boot and you should either change the disk to GPT by moving all the data first to a separate disk and then back after the partition table change or you should install GRUB2/rEFInd to another whole disk. If you have Windows (I don’t) you will probably have to install it .

For GRUB or rEFInd to boot from a GPT-partitioned disk on a BIOS-based system, a BIOS boot partition is required. This is the little ESP I’ve been mentioning.

If the device you want to install your boot partition on is GPT then rEFInd will attempt to mount this partition and install on the esp boot partiition that we will be making in this tutorial.

If you have DOS/MBR partitioning and you want GPT partitioning, you need to move all your files on that entire disk to a backup disk, change the partition table in GParted, and after we finish the tutorial, move your files back. If you only have the one drive you can’t do this and need to install rEFInd in the MBR partition.

If you don’t have an MBR partition and you’re on a MBR drive, you need to move files first.

Even the maintainer of rEFInd suggests to move/backup files before attempting to change a disks partitioning table type. It is a risky process

Step 3: Partition the GPT disk with a fat32 esp partition

Serious error was incurred during this tutorial.

I used GPARTED to resize a MBR SSD disk to include a fat32 esp bootable partition after the main file system. Once changes were saved, the disk showed EMPTY and UNALLOCATED on Gnome Disks and did not even show the changes made on GParted. If this happens, use GParted to backup the partition with your data on it and start again. If you start creating new partitions over the top you will overwrite your data on that disk

If it is a brand new drive with no data, open GParted, and select the device from the drop down menu, then select Device > Create Partition Table and choose GPT.

If you change the Partition Table on a drive with data on it, it will wipe the drive and make it GPT. You will lose all the data on that disk.

Once your drive is GPT, in GParted, create a little 2GB or so partition at the start with fat32 format and edit the flags to say esp.

GParted GPT Disk Create Partition Table
GParted GPT Disk Create Partition Table

Note: you can’t resize or create a little esp boot partition on the drive that you are currently booted on right now.

To install the rEFInd partition, you need to have a second disk inside the PC or you will not be able to partition the disk you are currently reading this on as it is live and mounted. GParted won’t let you resize this partition.

Once you have a little fat32 partiton (minimum 1-2GB) then you can run the rEFInd install script:

sudo pacman -S refind-install
refind-install

# run again as first time it will mount the esp partition
refind-install

Run it twice as it will mount the disk on the first run.

Reboot and see if you can boot in!

Arch Linux Photoshop CC 2018-2019 WORKING

Having been using Photoshop on Linux since 2014, I have tried many approaches to running Photoshop CS 6 or the new Photoshop CC series on Wine and PlayOnLinux, but nothing came close to using Crossover.

Crossover is free to trial, but you can keep extending the trial, and use it for as long as you really want. To extend the trial just keep deleting the .eval file in your cxoffice folder:

# one of these commands will remove the evaluation file for Crossover on your PC once installed
rm ~/.cxoffice/default/.eval
rm ~/cxoffice/default/.eval

Photoshop Arch System Requirements:

Minimum 6GB of RAM

+ Swap Memory as Wine Server may hang and crash (LOSE UNSAVED WORK)

First, edit your pacman.conf to allow multilib packages to be used on Arch. Wine uses many lib32 32 bit libraries to run Windows based software.

sudo nano /etc/pacman.conf

Uncomment both the square bracket [multilib] line, and also the line under it that starts with “Include…”

[multilib]
Include = /etc/pacman.d/mirrorlist

Update your system and it should show Multilib in package database.

sudo pacman -Syuu base-devel

Install the following bunch of required lib32 files that Wine needs:

sudo pacman -S python2 glibc libice libsm libx11 libxext libxi freetype2 libpng zlib lcms2 alsa-lib libgl libxcursor libxrandr desktop-file-utils gstreamer0.10 mpg123 libgphoto2 libexif openal libcl pygtk python2-dbus libxinerama sane gnutls libcups libxcomposite libxslt v4l-utils gstreamer0.10-base libxxf86dga libxxf86vm glu python2 lib32-glibc lib32-libice lib32-libsm lib32-libx11 lib32-libxext lib32-libxi lib32-freetype2 lib32-libpng lib32-zlib lib32-lcms2 lib32-alsa-lib lib32-libgl lib32-libxcursor lib32-libxrandr desktop-file-utils lib32-gstreamer0.10 lib32-mpg123 lib32-libgphoto2 lib32-libexif lib32-openal lib32-libcl pygtk python2-dbus lib32-libxinerama lib32-sane lib32-gnutls lib32-libcups lib32-libxcomposite lib32-libxslt lib32-v4l-utils lib32-gstreamer0.10-base lib32-libxxf86dga lib32-libxxf86vm lib32-glu

The above list was created by an Arch user and is found directly on the developers of Crossover.

Some of the above libraries won’t be available on the core Arch database and you may need to get yay and then run the above list with yay to install any missing:

yay python2 glibc libice libsm libx11 libxext libxi freetype2 libpng zlib lcms2 alsa-lib libgl libxcursor libxrandr desktop-file-utils gstreamer0.10 mpg123 libgphoto2 libexif openal libcl pygtk python2-dbus libxinerama sane gnutls libcups libxcomposite libxslt v4l-utils gstreamer0.10-base libxxf86dga libxxf86vm glu python2 lib32-glibc lib32-libice lib32-libsm lib32-libx11 lib32-libxext lib32-libxi lib32-freetype2 lib32-libpng lib32-zlib lib32-lcms2 lib32-alsa-lib lib32-libgl lib32-libxcursor lib32-libxrandr desktop-file-utils lib32-gstreamer0.10 lib32-mpg123 lib32-libgphoto2 lib32-libexif lib32-openal lib32-libcl pygtk python2-dbus lib32-libxinerama lib32-sane lib32-gnutls lib32-libcups lib32-libxcomposite lib32-libxslt lib32-v4l-utils lib32-gstreamer0.10-base lib32-libxxf86dga lib32-libxxf86vm lib32-glu

Download the latest Crossover directly from them at their website.

You don’t have to provide a valid email address or name when downloading it.

Crossover Download For Linux Arch
Crossover Download For Linux Arch

Then bash the .bin file from Crossover.

cd ~/Downloads/
sh install-crossover-18.5.0.bin

You’ll get a graphic GUI installer, just go through the prompts.

Crossover Linux Wine Arch Installation 64bit
Crossover Linux Wine Arch Installation 64bit

Once installed, if you get any errors, you may be missing some libraries.

Make sure you install all missing lib32 and use Arch User Repository if required.

Just in case you’re missing any libs, you can install Wine itself (400mb):

sudo pacman -S wine

Create a New Bottle and install Photoshop with Internet unplugged and follow the Setup.exe usual process. I won’t describe this process.

After installation, you can go into Photoshop settings and uncheck a bunch of new whizz-bang feautres.

In Photoshop CC, go to Edit > Preferences > General and I recommend to disable a bunch of features:

Workspaces: turn off Floating Document Window Docking

Tools: turn off tooltips if you don’t need them as they sometimes sticky on top of other desktop windows. Turn off animated zoom (laggy.)

Performance: depending on your specs, you can adjust the RAM usage and the Graphics processor toggle. I use without Graphics processor.

Let us know below how it went! Feel free to contact us if you need help.

Photoshop CC 2018 on Arch Linux 64bit Crossover Wine PlayOnLinux Tutorial
Photoshop CC 2018 on Arch Linux 64bit Crossover Wine PlayOnLinux Tutorial



XFCE4 Brightness Button on Launcher Bar – Increase & Decrease Backlight Manually

First, find out your hardware backlight files

ls /sys/class/backlight/

this should list the device name that controls your backlight

In our case, it is amdgpu_bl0 so we cd into that folder and see the brightness file. Brightness is stored in the file ./amdgpu_bl0/brightess

cat /sys/class/backlight/amdgpu_bl0/brightness

In Arch:

sudo pacman -S acpilight

This gives us xbacklight command ability in XFCE4 without using root

This is a bash shell script to first check whether brightness is going to completely dim the backlight to zero (display off)

# /bin/bash
min_light=$(cat /sys/class/backlight/amdgpu_bl0/brightness)
echo $min_light
if [ "$min_light" -lt 50 ]
then
echo Too Dim
else
sudo xbacklight -dec 10
fi
exit

Lenovo Ideapad ARCH WiFi Setup 2019 rtl8821ce Not Working?

How to enable Realtek Lenovo Wifi Card drivers in a 2019 Lenovo Ideapad built in 2019. Lenovo Ideapad needs a specific new WiFi driver called rtl8821ce. This package is only available on the Arch User Repository AUR at the time of writing from a guy named tomaspinho.

If you are doing a fresh Arch install on a new Lenovo ideapad, you will need an ethernet cable or a USB internet dongle or possibly hotspot/tether your mobile phone to get connected because the WiFi is not present on the Arch Live USB at time of writing.

Once you have internet, you will need an AUR manager or to build rtl8821ce from the git. You will also need dkms.

The following tutorial was done after the base install.txt was completed and may not work if done while chroot’ed in arch-chroot.

This installs linux-headers, required to match the kernel package and dkms.

sudo pacman -Syu linux-headers dkms

If this is a fresh Arch install, you may need git

sudo pacman -S git

Install AUR manager named yay which allows AUR installs

cd ~
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Now that you have yay, install rtl8821ce

yay rtl8821ce

Follow the prompts to install rtl8821ce-dkms-git

After install, run ip link to see if your new interface has been installed (may need reboot)

ip link
realtek wifi card ip link rtl8821ce-dkms-git
realtek wifi card ip link rtl8821ce-dkms-git

In our case, the WiFi or wireless interface network is called wlp2s0

sudo wifi-menu wlp2s0

However, on first run, this gives an error. The error is quite clear, “the interface is already running.” Naturally, you can stop it:

sudo ip link set wlp2s0 down

This turns off wlp2s0 and then run the wifi-menu command again and it should turn on the Realtek card again

sudo wifi-menu wlp2s0
dhcpcd

Did this help you connect to internet on a 2019 Ideapad Laptop?

Feel free to let us know in the comments below!

FrameBuffer Error in Ryzen 5 & VEGA AMD Graphics and CPU

This error is reproducible in Debian 10 Buster as of time of writing on new L340 Ideapad and Thinkpad laptops by Lenovo.

With a 2019 Ryzen 3, Ryzen 5, or Ryzen 7 AMD CPU Laptop with inbuilt Radeon Vega AMD Graphics card, you will encounter a FrameBuffer error on upgrading Debian 9 to Debian 10.

If you upgrade to Debian 10 on one of these distros, you may lose xorg functionality. It may have something to do with nvidia. dffgfg

From what I understand, Debian 10 does not yet have the kernel drivers required for the 2019 Ryzen CPU combined GPU. Adding nomodeset to the GRUB boot option does not solve the issue.

Debian 9 works fine, Debian 10 gives a FrameBuffer EE please specify all busid error.

Solution? Wait for kernel updates or install another distro

Need immediate access? You can probably still boot into Debian and if you see a blinking underscore cursor, press Ctrl+Alt F1 or Ctrl+Alt F5 to get a console under tty5 or tty6.

Then you’ll need to connect to WiFi or Ethernet.

If you need to make bootable USB devices, use either dd method or Etcher command line version.


How to Turn Off Loud Beep PC Speaker Arch Debian Ubuntu

Just installed a new distro and hearing really loud beeps when pressing backspace? Your PC speakers are making this loud beeping noise.

To disable the speaker immediately, as root

rmmod pcspkr
sudo rmmod pcspkr

To permanently disable the speaker, either put that on a startup script or install some other audio & system sounds.

After you’ve done some further installations like alsa audio mixer etc. you will probably want the speakers back on, so don’t forget that you disabled them lol and to re-enable them as required.

Fix Debian 9 Upgrade apt-get update freezes and stops [0% Working]

Since our last dist-upgrade from Debian 8 Wheezy to Debian 9 Stretch, we’ve encountered quite a few new issues. By issues, I am referring to incompatibilities with any manual changes that I have made to my PC.

Most of the repositories that I have manually added have to be manually adjusted from wheezy to stretch. After that, we tried the usual sudo apt-get update and it never completed it’s course.

Stuck on 0% [Working]?

1
sudo apt-get install apt-transport-https

This one line solved the 0% Working issue where the package list downloading would hang and become stuck on Debian 9.

Using Rufus on Linux to make Bootable Windows USB. WoeUSB: WinUSB for Linux Debian, Ubuntu

Only recently I found out Etcher.io didn’t make bootable Windows USB’s properly, or rather, did not support it at all.

There are 3 ways to make Windows Bootable USBs on Debian Ubuntu of any Linux distro, but first you’ll need a Windows ISO which Windows themselves now provide. Just search “Windows ISO” and make sure you’re at microsoft.com. At the time of writing, Windows was providing the Windows 10 ISO here.

1)  Use WoeUSB on Ubuntu or Debian to make Bootable Windows USBs from ISO.

Woeusb debian ubuntu winusb for linux
Woeusb debian ubuntu winusb for linux

The deb packages for WoeUSB are found here, ignore the .exe files in this directory.

http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/w/woeusb/

2) Use a Windows VirtualBox to create a bootable USB using Rufus.

You’ll need to install VirtualBox (sudo apt-get install virtualbox) and then install a virtual Windows machine using the ISO from Microsoft.com at the start of this article.

You will also have to install VirtualBox Guest Additions to be able to passthrough the physical USB stick straight into the VirtualBox. To do that, boot your virtual machine, select Devices on the toolbar, and select insert Guest Additions CD. Install it, reboot, and you’ll now be able to connect your USB. To connect your USB, go to the virtual machine settings and add USB 2.0 or USB 3.0 support. You can only add USB support when the machine is off. If you haven’t installed the guest additions correctly, it will give you an error on booting.

USB not recognised virtualbox guest additons
USB not recognised virtualbox guest additons

If your VirtualBox doesn’t recognize the USB or fails to install drivers etc., make sure it’s formatted as Fat32 (use gnome-disks or gparted, might need to reformat it a few times with both programs).

When you boot the machine, bottom right of the virtual machine window has a small USB icon, right click it, and select the desired USB that you’d like to pass straight through to the VM.

USB passthrough virtualbox
USB passthrough virtualbox

Here is a screenshot of me successfully making a Bootable Windows USB using Rufus on a VirtualBox Windows 7 while my host OS is Debian.

Using rufus in VirtualBox Bootable USB Debian

3) Use another Windows PC to create the bootable USB.

Fix or Repair Debian GRUB when it’ not working. Blank screen with blinking underscore cursor.

Playing around with GRUB is a nightmare for the first few times, and often GRUB reinstallations will actually be mandatory when installing multiple operating systems on the same drive, or multiple drives, or after reinstalling windows or vice versa.

If you can’t boot into your OS, you’ll need a linux live CD of any kind (Debian or Ubuntu) or a rescue disc. The most natural way to reinstall GRUB is to boot into your main OS via a live CD and run the grub-install command. I prefer not to do this as my live CD is around 4GB and can take 5-20 minutes to create the USB. And if you don’t have your OS live CD laying around, you’ll need another PC to either download it and create the bootable USB (60 minute exercise at least), or you can use a smaller, lighter, recovery OS on a bootable USB.

The best rescue method is by ‘burning’ Super Grub2 Disk to a USB or CD/DVD. You’ll need to download the Super Grub2 Disk ISO from here: https://www.supergrubdisk.org/super-grub2-disk/

It’s a tiny 20MB ISO that you can use Etcher to create a Super Grub2 Disk bootable USB in about 30 seconds. Any version will work. This will get you back into your PC. Once you’re inside you can run the grub-install command. On Debian this is the only command that worked for me completely:

Open gparted or gnome-disks and find the /dev/sdX of the drive you want to install grub to. Your main partition will be either /dev/sda or /dev/sdb or /dev/sdc or /dev/sd0. It should show that it’s mounted at / which is your root directory of the OS you’re in, you’re main OS.

1
grub-install --force --debug --boot-directory=/boot /dev/sdabc0

Replace sdabc0 above with whatever your drive is.

Now reboot without the Super Grub2 Disk USB and see if your distro goes into GRUB. This is a good time to keep the Super Grub2 Disk in a safe place as it is a very powerful tool for booting into all sorts of drives or places, even ISOs with loopback setup.

How to use gparted live when your GRUB isn’t working with Super Grub2 Disk and when you only have one USB.

Now, here’s a challenge: rescue your linux computer with one USB.

Get Super Grub2 Disk as described above and boot into your normal OS via the above method. After you’re in your normal OS, download Rescatux but don’t burn it to a USB.

Instead, as root, open your boot folder and make a folder called boot-isos and put Rescatux in that folder.

1
2
3
sudo su
cd /boot
mkdir boot-isos

Download the latest Rescatux ISO from here and put it in that folder.

Rescatux bootable from hard disk loopback
Rescatux bootable from hard disk loopback

Now when you boot using Super Grub2 Disk, you’ll see a bootable ISO entry with the Rescatux ISO which you can boot into! This is because Rescatux is setup for loopback mount meaning you can boot into it on a hard disk instead of a USB. Booting a live distro from live USB. Rescatux has gparted and you can make changes to your partitions without being mounted but Rescatux does not have grub-install. This helped me when I had one single USB but I wanted to use both “gparted live” and Super Grub2 Disk at the same time without losing my Super Grub2 Disk USB.

John the Ripper VPS/Dedicated Server Cracking – Multiple Core & Thread Research Tutorial

John the Ripper, also know as john in yum & apt package managers, is an open source password cracker and hash decipher program.

Here is a “How To” tutorial for using John the Ripper on VPS or Dedicated instances so that you can leave it running overnight, for example.

John the Ripper CentOS & Fedora installation & usage:

1
2
# john requires openssl-devel package
yum install openssl openssl-devel -y
1
2
# get the latest JUMBO version of John
wget http://www.openwall.com/john/j/john-1.8.0-jumbo-1.tar.gz
1
2
3
4
# extract and enter the src folder
tar -xzvf john*
cd john*
cd src
1
2
# configure and make john
./configure &amp;&amp; make
1
2
3
# navigate and run the test and benchmark script
cd ../run
./john --test