- Arch Linux
- #1 2012-12-04 01:14:50
- Request: Ubuntu’s «Boot-Repair» for Arch Linux.
- #2 2012-12-04 04:04:45
- Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
- #3 2012-12-04 18:08:15
- Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
- #4 2012-12-06 10:14:29
- Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
- #5 2012-12-06 11:06:12
- Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
- Ethical hacking and penetration testing
- InfoSec, IT, Kali Linux, BlackArch
- Arch Linux does not boot: how to fix it
- How to repair an Arch Linux boot disk
- How to remove a program that prevents Arch Linux from booting
- GRUB/Restore the GRUB Bootloader
- Содержание
- Identify system partitions
- Manual chroot
- Use manjaro-chroot
- BIOS System
- Что делать, если Arch Linux не загружается
- Как восстановить загрузочный диск Arch Linux
- Как удалить программу, из-за которой не загружается Arch Linux
Arch Linux
You are not logged in.
#1 2012-12-04 01:14:50
Request: Ubuntu’s «Boot-Repair» for Arch Linux.
Seems like it would’ve come in handy multiple times.
#2 2012-12-04 04:04:45
Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
PS: I am not trolling. I feel you should either learn to use a live cd + chroot to fix such problems. If you don’t like that, there is supergrubdisk. In any case, you shouldn’t be needing either too often unless you like to break your system on a regular basis.
#3 2012-12-04 18:08:15
Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
the install media can by used as a repair media, probably lak of ALL reair tools available on repo byt you can steel download them
Well, I suppose that this is somekind of signature, no?
#4 2012-12-06 10:14:29
Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
@x33a @Jristz I don’t have blank CD’s at the moment. What I do have at the moment is an external USB SATA drive case that I can just plop drives into for repair, modifying, etc. Being able to easily install something like Boot-Repair would be very handy as opposed to getting up and having to skate or ride my bike 120 downtown-sized blocks to the nearest Walmart just to buy blank disks or a thumb drive. Plus all my Arch apps aren’t in the Live CD.
#5 2012-12-06 11:06:12
Re: Request: Ubuntu’s «Boot-Repair» for Arch Linux.
What are you doing to your system that has resulted in it breaking «multiple times»? Wouldn’t it be better not to do that, instead of trying to apply some other distro’s tool?
Regarding your resistance to using the arch iso on removable media: I personally don’t understand how anyone runs any distro without having rescue media at hand. Ask someone you know to pick you up a cheap usb stick whenever they’re passing the shop, since you’re too lazy to go there yourself.
Finally, why on earth would you need «all my Arch apps» on the Live CD? All you need it for is to fix your boot config.
Источник
Ethical hacking and penetration testing
InfoSec, IT, Kali Linux, BlackArch
Arch Linux does not boot: how to fix it
If your Arch Linux does not boot or boot into a black screen, start by switching to another terminal with the keyboard shortcuts Ctrl+Alt+F1, Ctrl+Alt+F2, Ctrl+Alt+F3, and so on. If you succeeded and you saw a command prompt to enter your login credentials, then everything is easy – log in and roll back the changes that prevent the system from starting.
But there are more difficult cases, for example, due to the installation of a video driver, bbswitch or similar programs, and it may be impossible to switch to other terminals due to a complete system freeze.
Another example of a difficult situation is completely removing the boot disk (this has happened to me).
Manjaro and other Arch Linux based distributions offer GUI installers for installing the operating system. But if you installed Arch Linux manually (as described in the Arch Linux Installation Guide), you may have noticed that we install packages and configure the system by booting from a Live image. This same trick can be used to fix problems of any complexity – even if your system is completely inoperative and won’t boot, it can still be fixed!
Boot into another operating system – for this you can install Linux on a USB flash drive and keep this USB flash drive for such cases. By the way, you can use an old flash drive, less than 1 gigabyte in size, to always keep the Arch Linux Live image on it – especially in case of such a problem.
Start by downloading the Arch Linux image from the official site: https://www.archlinux.org/download/
For burning, use the Etcher program (site https://www.balena.io/etcher/), which works great on any operating system.
How to repair an Arch Linux boot disk
If your boot partition is damaged or deleted, boot the Arch Linux Live image from the USB stick and run the following commands.
Note that instead of nvme0n1p1 you need to specify the name of your boot partition, for example /dev/sdb1. To see a list of all disks, run the command:
We format the boot partition to FAT32:
We mount partitions:
Change the root directory to a new one:
Installing the bootloader:
Edit the content of the file:
Delete what is there and write there:
Create a config file to add an Arch Linux item to the systemd-boot manager:
The content of the file should be as follows:
Pay attention to /dev/nvme0n1p2 – this is the path to my system disk, replace it with your own.
Exit the chroot, unmount the mounted partitions and reboot:
You can remove the installer disc.
How to remove a program that prevents Arch Linux from booting
Sometimes the booting fails due to an installed program, or vice versa, due to the removal of a required package.
Boot the Arch Linux Live image from a USB stick and run the following commands. Note that instead of nvme0n1p1 and nvme0n1p2, you need to specify the names of your disk’s partitions, for example /dev/sdb1 and /dev/sdb2. To see a list of all disks, run the command:
We mount partitions:
Change the root directory to a new one:
By default, you are the root user, but you can change the user existing on the system we are restoring. This can be useful, since the history of commands of this user will be available to us, and we can easily remember which configuration files we edited and which packages were installed/removed just before the inability to boot.
For example, on a non-working system, the last commands were executed from the user mial, let’s log in as this user:
Now, to install packages, use a command like:
And to remove packages, use a command like:
Источник
GRUB/Restore the GRUB Bootloader
Содержание
In order to load the operating system, a Linux-capable boot loader such as GRUB, rEFInd or Syslinux needs to be installed to the Master Boot Record (MBR) or the GUID Partition Table (GPT) of the media containing the Operating System. Installations created using Manjaro ISO defaults to GRUB.
For various reasons — it happens the bootloader get’s corrupted, erased or misconfigured resulting to a black screen with a failure message during boot, like No boot loaders found in /dev/. . To restore system operation without re-installing your OS or losing your data you will need to use your Manjaro installation media, such as, a CD/DVD or USB Flashdrive.
Identify the type of system you are attempted to resque as the commands involved are slightly different.
System Boot Override To override system boot order the vendor has a dedicated key. Most laptop keyboard has multiple use for the function keys and the primary function may be reversed. In such case a Fn key must be used with the function key. If you don’t know consult your system documentation. Manjaro ISO default usernames and passwords
Default Username | Default Password |
---|---|
manjaro | manjaro |
root | manjaro |
To identify your partitions and their designated use you need to run a partition manager. Depending on environment there is various tools. GTK based ISO offers GpartEd, QT based ISO offers KParted and common to all is the CLI tools.
More comprehensive information can be found using fdisk (requires superuser) and you can limit the probed device e.g. /dev/sda or /dev/nvme0n1
The clues to look for is mbr vs. gpt and the presence of a small partition — usually the first — formatted with the vfat filesystem followed by a larger partition formatted as ext4.
When you have loaded the live ISO — depending on environment — open a terminal and switch to root context. Use above mentioned root:password combination.
Chroot is a method to restrict various tasks to a restricted area e.g. package installation and other system maintenance tasks. Follow the link to read more about chroot on the Arch wiki.
Identify system partitions
From the above we assume you have identified the relevant partitions on your system and this document will refer the partitions as follows. Partitions not needed for this kind of maintenance has intentionally been left out (e.g. home, swap).
Partition | Usage | Comment |
---|---|---|
/dev/sdyA | EFI system | Required for EFI system and mounted on /boot/efi |
/dev/sdyB | boot | Optional but mounted on /boot The primary use is when GRUB cannot write to / (eg. f2fs) |
/dev/sdyC | root | Required and for the root filesystem and mounted on / — usually formatted using ext4 |
Manual chroot
Mount the partitions using the designated temporary mountpoint and always start with root
Then — if applicable — mount boot
Then — if applicable — mount efi
Create the chroot environment and use bash as shell
Use manjaro-chroot
Manjaro deploys a script called manjaro-chroot takes an optional argument which will search the visible devices — scan the partitions for signs of an operating system. If more than one Linux operating system is found you will get a choice of which system to chroot otherwise the file /etc/fstab from the system is used to mount the partitions and chroot into this system.
One possible cause why you are reading this document — is an unfinished update — which in turn can be caused by several situations — situation we will not dive into. To fix what ever caused this you should run a full system update including grub to ensure everything is in place.
When the transaction as completed continue below using the section matching your system
BIOS System
On a BIOS/GPT system there is no MBR and therefore no place to store the loader. The GPT partition specification allows for an unformatted partition of the BIOS boot partition type (0xEF02). The size of this partition can be as small as 1 mebibyte. The Calamares installer uses a fixed size of 32 mebibyte. On a BIOS/MBR system a part of the bootloader is written to the Master Boot Record for the primary disk.
The device is the disk (not a partition)
Make sure the grub configuration is up-to-date
Источник
Что делать, если Arch Linux не загружается
Если ваш Arch Linux не загружается или загружается в чёрный экран, то начните с переключения на другой терминал сочетаниями клавиш Ctrl+Alt+F1, Ctrl+Alt+F2, Ctrl+Alt+F3 и так далее. Если вам это удалось и вы увидели приглашение ввести учётные данные для входа в систему, то дальше всё элементарно — выполните вход и откатите изменения, из-за которых система не запускается.
Но бывают более тяжёлые случаи, например, из-за установки видео драйвера, bbswitch или подобных программ, и может оказаться невозможным переключение на другие терминалы из-за полного зависания системы.
Ещё один пример трудной ситуации — полное удаление загрузочного диска (у меня такое случалось).
Manjaro и другие дистрибутивы на основе Arch Linux предлагают инсталяторы с графическим интерфейсом для установки операционной системы. Но если вы устанавливали Arch Linux вручную (как описано в Инструкции по установке Arch Linux), то могли обратить внимание, что мы устанавливаем пакеты и настраиваем систему загрузившись с Live образа. Этот же самый приём можно использовать для исправления проблем любой сложности — даже если ваша система абсолютно неработоспособна и не загружается, её всё равно можно исправить!
Загрузитесь в другую операционную систему — для этого можно установить Linux на флешку и держать эту флешку для подобных случаев. Кстати, вы можете использовать старую флешку, размером меньше 1 гигабайта, чтобы всегда держать на ней Live образ Arch Linux — специально на случай такой проблемы.
Начните с загрузки образа Arch Linux с официального сайта: https://www.archlinux.org/download/
Для записи используйте программу Etcher (сайт https://www.balena.io/etcher/ ), которая прекрасно работает в любой операционной системе. Подробности об этой программе смотрите в статье «Etcher: запись образов ОС на флешки и USB диски».
Как восстановить загрузочный диск Arch Linux
Если у вас повреждён или удалён загрузочный раздел, то загрузите Live образ Arch Linux с флешки и выполните следующие команды.
Обратите внимание, что вместо nvme0n1p1 вам нужно указать имя вашего загрузочного раздела, это может быть, например, /dev/sdb1. Чтобы посмотреть список всех дисков, выполните команду:
Форматируем разгрузочный раздел в FAT32:
Меняем значение корневой директории на новую:
Выполняем установку загрузчика
Редактируем содержимое файла:
Удалите то, что там есть и впишите туда:
Создайте конфигурационный файл для добавления пункта Arch Linux в менеджер systemd-boot:
Содержимое файла должно быть следующим:
Обратите внимание на /dev/nvme0n1p2 — это путь до моего диска с системой, замените на свой.
Выйдем из chroot, размонтируем смонтированные разделы и перезагрузимся:
Можно вынимать установочный диск.
Как удалить программу, из-за которой не загружается Arch Linux
Иногда загрузка не выполняется из-за установленной программы или наоборот, из-за удаления необходимого пакета.
Загрузите Live образ Arch Linux с флешки и выполните следующие команды. Обратите внимание, что вместо nvme0n1p1 и nvme0n1p2 вам нужно указать имена разделов вашего диска, это может быть, например, /dev/sdb1 и /dev/sdb2. Чтобы посмотреть список всех дисков, выполните команду:
Меняем значение корневой директории на новую:
По умолчанию вы являетесь пользователем root, но вы можете сменить пользователя существующего в системе, которую мы восстанавливаем. Это может быть полезно, так как нам будет доступна история команд этого пользователя и мы без труда вспомним, какие конфигурационные файлы мы редактировали и какие пакеты устанавливали/удаляли как раз перед невозможностью загрузиться.
Например, на нерабочей системе последние команды выполнялись от пользователя mial, выполним вход как этот пользователь:
Теперь для установки пакетов используйте команду вида:
А для удаления пакетов используйте команду вида:
Источник