Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log in from live disk #1180

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions content/login-from-live-disk.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Login from Live Disk (Chroot)
title: Log in from Live Disk (Chroot)
description: >
Access an installed OS from a Live Disk/Recovery.
keywords:
Expand All @@ -19,7 +19,7 @@ section: software-troubleshooting
tableOfContents: true
---

## Login from Live Disk (Chroot)
## Log in from Live Disk (Chroot)
ahoneybun marked this conversation as resolved.
Show resolved Hide resolved

It is possible to mount an OS drive and log into the installed OS with root access. This is called gaining "chroot" (change to root) access. This process is useful when [rescuing files](/articles/disaster-recovery), [fixing package manager issues](/articles/package-manager-pop), or [resetting forgotten user passwords](/articles/password).

Expand Down Expand Up @@ -56,18 +56,23 @@ To access an encrypted disk, run these additional commands to unlock the encrypt
|:--------------------------------------------------:|:-------------------------------------------------:|
| ```sudo cryptsetup luksOpen /dev/sda3 cryptdata``` | ```sudo cryptsetup luksOpen /dev/nvme0n1p3 cryptdata``` |

>**Note:** You will see "Enter passphrase for /dev/nvme0n1p3 (or the name of your exact drive):" - Enter your encryption password here. You will "enter this blind," i.e. you won't see the characters typed out. Then press Enter.

```bash
# scan for logical volumes
sudo lvscan
# scan and setup volume groups
sudo vgchange -ay
```

>**Note:** Pay attention to what the `cryptdata` group is called. If it is named something other than `data-root`, substitute the correct info into this next command. Make sure that `-root` is on the end:

```bash
# setup access to the encrypted file system on '/mnt'
sudo mount /dev/mapper/data-root /mnt
```

Now the existing hard drive can be accessed by going to the `/mnt` folder. To use the <u>Files</u> program, go to `+ Other Locations` -> `Computer` and then click on the `/mnt` folder.
**Note:** If you want to backup your files, you can do so at this point in the process if you don't already have a [backup of your data](/articles/backup-files/)

## Chroot

Expand All @@ -80,6 +85,7 @@ The EFI partition is the next partition to be mounted. To help identify it, this
| ```sudo mount /dev/sda1 /mnt/boot/efi``` | ```sudo mount /dev/nvme0n1p1 /mnt/boot/efi``` |

```bash
# mount several "kernel" virtual file systems from the live system to '/mnt/'
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
```
Expand Down
Loading