mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
translated
This commit is contained in:
parent
041b32ae2f
commit
aa78ee1e36
@ -1,118 +0,0 @@
|
||||
[#]: subject: "How to Recover Arch Linux Install via chroot"
|
||||
[#]: via: "https://www.debugpoint.com/2021/07/recover-arch-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: 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 breaks in [Arch Linux][1]. Not because of your own actions, but hundreds of other reasons such as 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
|
||||
|
||||
* 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][2]. Remember this step require another working stable system obviously as your current system is not usable.
|
||||
|
||||
[download arch linux][3]
|
||||
|
||||
* You need to know on which partition your Arch Linux is installed. This is a very important step. If you don’t 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 of your disk partitions with their size, 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 below. Change the /dev/sda3 to your respective partition.
|
||||
|
||||
```
|
||||
/dev/sda3
|
||||
```
|
||||
|
||||
```
|
||||
mount /dev/sda3 /mntarch-chroot /mnt
|
||||
```
|
||||
|
||||
* The arch-chroot command will mount your Arch Linux partition in the terminal, so login using your Arch credentials. Now, at this stage, you have the following options, based on what you want.
|
||||
|
||||
* You can take backups of your data by going through /home folders. In case, troubleshooter doesn’t work. You may copy the files to external USB or another partition.
|
||||
|
||||
* Verify the log files, specially the pacman logs. Because, unstable system may be caused by upgrading some packages such 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 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 the 200 lines from the end of the pacman.log file to verify. Now, carefully check which of the packages were updates 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, whether if there are any errors. Sometimes, display manager creates a problem which can’t communicate with X Server. For example, if you are using lightdm, then you can check its status via below.
|
||||
|
||||
```
|
||||
systemctl status lightdm
|
||||
```
|
||||
|
||||
* Or, may want to start it via below command and check what is the error.
|
||||
|
||||
```
|
||||
lightdm --test-mode --debug
|
||||
```
|
||||
|
||||
* Here is an example of lightdm failure which caused an unstable Arch system.
|
||||
|
||||
![lightdm - test mode][4]
|
||||
|
||||
* Or check via kicking off the X server using startx.
|
||||
|
||||
```
|
||||
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][5] which you may want to check out.
|
||||
* If you are using sddm, then check out [these troubleshooting steps][6] 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 experience, it works. If it works, well, good for you. Either way, do let me know in the comment box below, how it goes.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2021/07/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://www.debugpoint.com/tag/arch-linux
|
||||
[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
|
||||
[3]: https://archlinux.org/download/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
|
||||
[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
|
||||
[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting
|
@ -0,0 +1,120 @@
|
||||
[#]: subject: "How to Recover Arch Linux Install via chroot"
|
||||
[#]: via: "https://www.debugpoint.com/2021/07/recover-arch-linux/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
如何通过 chroot 恢复 Arch Linux 的安装
|
||||
======
|
||||
这个快速指南解释了恢复 Arch Linux 安装的一些步骤。
|
||||
|
||||
作为一个滚动发布的版本,[Arch Linux][1] 中有时会出现一些问题。不是因为你自己的行为,而是数以百计的其他原因,如新内核与你的硬件,或软件的兼容性。但是,Arch Linux 仍然是更好的,它提供了最新的软件包和应用。
|
||||
|
||||
但有时,它也会给你带来麻烦,你最终只能看到一个闪烁的光标,其他什么都没有。
|
||||
|
||||
所以,在这种情况下,与其重新格式化或重新安装,不如在放弃希望之前尝试恢复安装和数据。本指南概述了这个方向的一些步骤。
|
||||
|
||||
### 恢复 Arch Linux 安装
|
||||
|
||||
* 第一步是用 Arch Linux 创建一个可启动的 Live USB。从这个链接下载 .ISO 并创建一个可启动的 .ISO。你可以查看这个指南[如何使用 Etcher 创建可启动的 .ISO][2]。记住这一步需要另一个稳定的工作系统,因为你目前的系统不能使用。
|
||||
|
||||
[下载 arch linux][3]
|
||||
|
||||
* 你需要知道你的 Arch Linux 安装在哪个分区上。这是一个非常重要的步骤。如果你不知道,你可以用 GParted 来查找。或者在你的 Grub 菜单中查看,或者你可以运行下面的命令来了解。这将列出你所有的磁盘分区及其大小、标签。
|
||||
|
||||
```
|
||||
sudo lsblk -o name,mountpoint,label,size,uuid
|
||||
```
|
||||
|
||||
* 完成后,插入 U 盘并从它启动。你应该在 Live 介质中看到 Arch Linux 的提示。
|
||||
|
||||
* 现在,用下面的方法挂载到 Arch Linux 分区。把 /dev/sda3 改成你各自的分区。
|
||||
|
||||
```
|
||||
/dev/sda3
|
||||
```
|
||||
|
||||
```
|
||||
mount /dev/sda3 /mntarch-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
|
||||
```
|
||||
|
||||
* 检查你的显示管理器的状态,是否有任何错误。有时,显示管理器会产生一个问题,无法与 X 服务器通信。例如,如果你正在使用 lightdm,那么你可以通过以下方式检查它的状态。
|
||||
|
||||
```
|
||||
systemctl status lightdm
|
||||
```
|
||||
|
||||
* 或者,可以通过下面的命令启动它,并检查什么是错误。
|
||||
|
||||
```
|
||||
lightdm --test-mode --debug
|
||||
```
|
||||
|
||||
、* 下面是一个 lightdm 失败的例子,它导致了一个不稳定的 Arch 系统。
|
||||
|
||||
![lightdm - test mode][4]
|
||||
|
||||
* 或者通过使用 startx 启动 X 服务器来检查。
|
||||
|
||||
```
|
||||
startx
|
||||
```
|
||||
|
||||
* 根据我的经验,如果你在上述命令中看到错误,尝试安装另一个显示管理器,如 sddm 并启用它。它可能会消除这个错误。
|
||||
|
||||
* 根据你的系统状态,尝试上述步骤,并进行故障排除。对于特定于显示管理器 lightdm 的错误,我们有一个[指南][5],你可能想查看一下。
|
||||
|
||||
* 如果你使用的是 sddm,那么请查看[这些故障排除步骤][6]是否可以。
|
||||
|
||||
### 结束语
|
||||
|
||||
每个安装都是不同的。上述步骤可能对你不起作用。但它值得一试,根据经验,它是有效的。如果它起作用,那么,对你来说是好事。无论哪种方式,请在下面的评论区中告诉我,它结果如何。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2021/07/recover-arch-linux/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lkxed][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者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://www.debugpoint.com/tag/arch-linux
|
||||
[2]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/
|
||||
[3]: https://archlinux.org/download/
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2021/03/lightdm-test-mode.jpg
|
||||
[5]: https://www.debugpoint.com/2021/03/failed-to-start-lightdm/
|
||||
[6]: https://wiki.archlinux.org/title/SDDM#Troubleshooting
|
Loading…
Reference in New Issue
Block a user