This tutorial will simply show how to use chroot to get to your broken system. What you may need to do to repair your system obviously depends on your circumstances and there are to many possibilities to discuss here. You can do this from any OMLx iso booted ‘Live’ or if you have multiple operating systems on the same computer from one of the other operating systems. You can usually do this with any other Linux distros ‘Live’ iso or a system rescue CD/DVD/Flash drive.
Note: This is easier and faster to do than it will be to read the tutorial. After you do this once or twice you will get the gist of things. A lot of this is just copy and paste. Of course you need to know what to copy and paste.
Let’s get to it:
Boot a OMLx iso ‘Live’ or boot to one of your other operating systems if you have one. For the examples here I booted ROME iso # 1602.
Open Konsole (terminal)
To become root type:
$ su -
# fdisk -l
to list your partitions. Find your root partition. Mine is highlighted:
The part we will need in a few minutes is listed under ‘Device’ in my case
/dev/nvme1n1p4. For a lot of users it may be something like
x is the partition number.
- Next we mount the root partition to existing directory
/mnt. In my case like this:
# mount /dev/nvme1n1p4 /mnt
- Now we need to mount some directories from the working system we are booted in to to
/mntso we can execute some commands on the remote (broken) system like this:
# for i in /proc /sys /sys/firmware/efi/efivars /run /dev /dev/pts; do mount --bind $i /mnt$i; done
- Now we use
chrootcommand to change the root directory to the remote system we mounted earlier with
mountcommand like this:
# chroot /mnt
Notice the change in the shell identifier from:
I am now in the remote system as root. I can verify this with the command:
# df -T
We can see the root partition we mounted with the mount command in step 4:
Filesystem Type Size Used Avail Use% Mounted on /dev/nvme1n1p4 ext4 49G 11G 36G 23% /
You are root in your remote operating system, you are the boss, be careful. You should be able to edit any files that need editing. You may be able to reset a lost or missing root password. If the operating system you are booted in to and the remote system use the same package manager like
dnf you should be able to install or remove packages or upgrade or dsync the system. You can copy, move, remove, ect. There may be situations where you will want to have a file or files copied to a usb flash drive to use on the remote system. There is a lot one can do.
- Optional if you need to repair broken boot-loader on UEFI boot system we need to:
# mount /boot/efi:
Now you can run the
grub2-install command if needed.
- When you are done and it is time to go we need to;
# umount -l /dev/nvme1n1p4 /mnt
- Now your are done. Reboot.
Anyone with problems or questions about this please post in English/Support forum or reach out to us on OpenMandriva Chat. If you spot any errors or have suggestions let us know.
(Tested 2022-12-31 on ROME iso # 1602 booted ‘Live’ and on an installed ROME system.)