Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
🐧 Linux Recovery: Using CHROOT to recover a broken Linux installation - PC✗3
🐧 Linux Recovery: Using CHROOT to recover a broken Linux installation

🐧 Linux Recovery: Using CHROOT to recover a broken Linux installation

Summary:

We can enable chroot in the recovery console, so customers can start essential services and use it to generate MySQL database backup.

In cases of server crash in Linux, we need to recover data from the machine using the recovery/rescue mode. We can enable chroot in the recovery console, so users can start essential services and use it to generate MySQL database backup.

Initially, when you chroot in recovery console, you will get the following error:

[root@recovery ~]# chroot /mnt

chroot: failed to run command `/bin/bash': No such file or directory

This error means that there is no /bin/bash directory inside chroot. Make sure you point it to where bash (or other shell’s) executable is in chroot directory.

If you have /mnt/somedir/usr/bin/bash then execute chroot /mnt/somedir /usr/bin/bash.

Apart from the above, you also need to add libc directory dependencies, as mentioned in the answer here.

Now, if the machine crashed, follow the steps below to resolve:

mount /dev/vda1 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /bin /mnt/bin


Once it is done, you will be able to chroot to the mounted directory.

chroot /mnt
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.