Bricked fedora with a bad .bashrc file?

If you edited your .bashrc file that should be done very carefully and should not be used to perform anything except configuring your login parameters.

It can be easily restored to default with a live boot media and booting to the live environment. You will need to identify the main (root) file system and the /home file system.
lsblk -f will help with that.

Once you know which partition is / and which is /home then they can be mounted on the live file system and used to recover.
My example shows the drive as /dev/sda and the partition as btrfs on /dev/sda3. You will need to use the device name as appropriate for your system.

  1. su
  2. mount -t btrfs -o subvol=root,compress=zstd:1 /dev/sda3 /mnt
  3. mount -t btrfs -o subvol=home,compress=zstd:1 /dev/sda3 /mnt/home
  4. cd /mnt/home
  5. ls to confirm where you are and to see the users home directory
  6. cd <USER> to cd into your users home directory
  7. cp /mnt/etc/skel/.bash* . to replace the existing files with the default files that were installed when the user account was created.
  8. cd / to exit from the mounted file system.
  9. Now reboot and the system should be able to boot properly and allow your user to log in.
2 Likes