Translated

This commit is contained in:
2022-10-27 21:25:22 +08:00 committed by GitHub
parent 5b641a65cc
commit 3a16d40460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 110 additions and 110 deletions

View File

@ -1,110 +0,0 @@
[#]: subject: "How to Recover Arch Linux Install via chroot"
[#]: via: "https://www.debugpoint.com/recover-arch-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Recover Arch Linux Install via chroot
======
**This quick guide explains some of the steps which may come in handy to recover an Arch Linux Install.**
Being a rolling release, sometimes things break in Arch Linux. Not because of your own actions but hundreds of other reasons, such as a new Kernel vs your hardware or software compatibility. But still, Arch Linux is still better and provides the latest packages and applications.
But sometimes, it gives you trouble, and you end up with a blinking cursor and nothing else.
So, in those scenarios, instead of re-formatting or reinstalling, you may want to try to recover the installation, including the data, before giving up your hope. This guide outlines some steps in that direction.
### Recover Arch Linux Installation
- The first step is to create a bootable LIVE USB with Arch Linux. Download the .ISO from this link and create a bootable .ISO. You can check out this guide on how to create bootable .ISO using Etcher. Remember this step requires another working stable system, obviously, as your current system is not usable.
[download arch linux][1]
- You need to know on **which partition your Arch Linux** is installed. This is a crucial step. If you dont know, you can use GParted to find out. Or check in your Grub menu, Or you can run the below command to find out. This will list all your disk partitions, size, and labels.
```
sudo lsblk -o name,mountpoint,label,size,uuid
```
- Once done, plug in the USB stick and boot from it. And you should see the Arch Linux prompt in the LIVE medium.
- Now, mount to the Arch Linux partition using the below. Change the `/dev/sda3` to your respective partition.
```
mount /dev/sda3 /mnt
arch-chroot /mnt
```
- The arch-chroot command will mount your Arch Linux partition in the terminal, so log in using your Arch credentials. Now, you have the following options based on what you want at this stage.
- You can take backups of your data by going through /home folders. In case the troubleshooter doesnt work. You may copy the files to an external USB or another partition.
- Verify the log files, especially the pacman logs, because an unstable system may be caused by upgrading some packages, such as graphics driver or any other driver. Based on the log, you may want to downgrade any specific package if you want.
- You may use the below command to view the last 200 lines of the pacman log file to find out any failing items or dependency removal.
```
tail -n 200 /var/log/pacman.log | less
```
- The above command gives you 200 lines from the end of the pacman.log file to verify. Now, carefully check which of the packages were updated since your successful boot.
- And note down the package name and version somewhere. And you may try to downgrade packages one-by-one or if you think a specific package created a problem. Use the -U switch of pacman command to downgrade.
```
pacman -U <package name>
```
- You can run the following to start your Arch system after downgrading if any.
```
exec /sbin/init
```
- Check the status of your display manager and whether if there are any errors. Sometimes, the display manager creates a problem which cant communicate with X Server. For example, if you are using lightdm, then you can check its status via the below.
```
systemctl status lightdm
```
- Or, you may want to start it via the below command and check the error.
```
lightdm --test-mode --debug
```
- Here is an example of lightdm failure, which caused an unstable Arch system.
![lightdm - test mode][2]
- Or check via kicking off the X server using `startx`.
- In my experience, if you see errors in the above command, try to install another display manager, such as **sddm** and enable it. It may eliminate the error.
- Try the above steps based on the state of your system, and troubleshoot. For errors specific to display manager lightdm, we have a [guide][3] which you may want to check out.
- If you are using sddm, then check out [these troubleshooting steps][4] if something works.
### Closing Notes
Every installation is different. And above steps may/may not work for you. But it is worth a try, and as per my experience, it works. If it works, well, good for you. Either way, let me know how it goes in the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/recover-arch-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://archlinux.org/download/
[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
[3]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
[4]: https://wiki.archlinux.org/title/SDDM#Troubleshooting

View File

@ -0,0 +1,110 @@
[#]: subject: "How to Recover Arch Linux Install via chroot"
[#]: via: "https://www.debugpoint.com/recover-arch-linux/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "robsean"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何通过 chroot 恢复 Arch Linux 安装
======
**这篇速成指南诠释了一些步骤,它对于恢复一个 Arch Linux 安装很有帮助。**
作为一个滚动发布版本Arch Linux 有时会崩溃。那不是因为你自身的行为而是因为数百个其它的原因例如一个新内核与你的硬件或软件的兼容性。但是即使如此Arch Linux 仍然是比较优秀的,并且提供最新的软件包和应用程序。
但是,有些时候,它会给你带来麻烦,最后你只会看到一个闪烁的光标。
因此,在这种情况下,在你放弃希望前,你可能希望尝试恢复系统的安装以及数据,而不是重新格式化或重新安装。这篇指南在这些方面概述了一些步骤。
### 恢复 Arch Linux 安装
- 第一步骤是创建一个可启动的 Arch Linux 的 LIVE USB 。从下面的链接中下载 ISO 镜像文件,并创建一个可启动的 ISO 的启动盘。你可以查看这篇关于如何使用 Etcher 创建可启动的 ISO 的启动盘的指南。记住,这一步骤需要在另一个工作稳定的系统上完成,很明显,这是因为你当前系统是不可用的。
[下载 arch linux][1]
- 你需要知道在 **哪个分区上安装了你的 Arch Linux** 。这是关键的一步。如果你不知道,你可以使用 GParted 来找出来。或者在你的 Grub 菜单中查看,或你可以运行下面的命令来找出来。这将列出你所有的磁盘分区、大小和标签。
```
sudo lsblk -o name,mountpoint,label,size,uuid
```
- 在完成后,插入 USB 设备,并设置从中启动。你应该会在 LIVE 介质中看到 Arch Linux 提示符。
- 现在,使用下面的命令挂载 Arch Linux 分区。将 `/dev/sda3` 更改为你实际对应的分区。
```
mount /dev/sda3 /mnt
arch-chroot /mnt
```
- arch-chroot 命令将在终端中挂载你的 Arch Linux 分区,如此,以便使用你的 Arch 用户名和密码来登录系统。现在,取决于你在这个阶段的各种需要,你可能有下面的一些选项。
- 你可以前往 /home 文件夹来备份你的数据。为防止不能正常的解决重大问题。你可以复制这些文件到一块外部的 USB 磁盘或其它的分区。
- 验证日志文件,尤其是 pacman 日志,因为升级一些软件包可能会导致系统不稳定工作,例如,图形驱动程序或其它一些驱动程序。依据日志的记载,如果你有需要的话,你可以降级一些具体指定的软件包。
- 你可以使用下面的命令来查看 pacman 日志文件的最新的 200 行日志,来找出一些引起失败的项或依赖项的缺失。
```
tail -n 200 /var/log/pacman.log | less
```
- 上面的命令向你给出 pacman.log 文件的末尾处的 200 行来用于查对。现在,仔细检查自你成功启动以来更新了哪些软件包。
- 并且,在某个地方下,记录下软件包的名称和版本。你可以尝试逐个降级软件包,或者,如果你认为是某个特定的软件包造成的问题话,你可以使用 pacman 命令的 -U 开关选项来降级它。
```
pacman -U <package name>
```
- 在降级后(如果有一些软件包进行降级的话),你可以运行下面的命令来启动你的 Arch 系统。
```
exec /sbin/init
```
- 检查你的显示管理器的状态,并检查其是否有一些错误。有时,显示管理器会产生不能与 <ruby> X 服务器 <rt> X Server </rt></ruby> 通信的问题。例如,如果你正在使用 lightdm ,那么你可以通过下面的命令来检查它的状态。
```
systemctl status lightdm
```
- 或者,你可能希望通过下面的命令来启动它并检查错误。
```
lightdm --test-mode --debug
```
- 这里是一个 lightdm 故障的示例,它导致了 Arch 系统不稳定工作。
![lightdm - test mode][2]
- 或者,使用 `startx` 来启动 X 服务器 进行检查。
- 根据我的经验,如果你在上面的命令中看到这些错误,尝试安装另外一个显示管理器,例如, **sddm** 并启动它。它可以消除错误。
- 根据你的系统的实际状态来尝试上面的步骤,并解决重大问题。针对特定的显示管理器 lightdm 的错误,我们有一份[指南][3],你可能会想查看它。
- 如果你正在使用 sddm ,那么,检查 [这些解决重大问题的步骤][4] 是否工作。
### 结束语
每个系统安装都是不同的。上面的步骤不一定适合你。但是,它值得一试,根据我的经验,它是工作的。如果它工作,对你有好处。不管怎样,在下面的评论区让我知晓它是如何进行的。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/recover-arch-linux/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://archlinux.org/download/
[2]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
[3]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
[4]: https://wiki.archlinux.org/title/SDDM#Troubleshooting