Устранение неполадок

Если у вашего Mac возникли проблемы с загрузкой, вот несколько шагов, которые вы можете предпринять, чтобы выявить проблему и решить ее.

Сначала определите, что происходит при включении компьютера, и перейдите к соответствующему разделу:

Изменение запускаемой операционной системы

Вы можете выбрать, какая ОС загружается, временно или постоянно, с помощью встроенного в систему средства выбора загрузки. Для этого необходимо полностью выключить устройство:

  • Нажмите и удерживайте кнопку питания

  • Продолжайте удерживать, пока на экране не появится сообщение "Entering startup options" (ноутбуки, iMac) или пока индикатор питания слегка не погаснет (настольные компьютеры), затем отпустите.

Откроется окно выбора загрузки, в котором вы сможете выбрать следующую операционную систему для загрузки. По умолчанию выбор будет временным. Чтобы сделать ваш выбор постоянным для всех последующих загрузок, щелкните нужный вариант загрузки, удерживая нажатой клавишу Option на клавиатуре.

Вы также можете выбрать самый правый значок «Параметры», чтобы войти в систему recoveryOS, которую можно использовать для выполнения операций восстановления. Вам могут быть предложены ввести учетные данные для входа в macOS, в зависимости от состояния безопасности вашего компьютера. На главном экране параметров recoveryOS вы можете открыть окно терминала, нажав Shift-Command-T.

Вход в загрузочное меню GRUB

Если во время обновления пакета ядра возникла проблема или какая-либо другая проблема, которая препятствует правильной загрузке ядра, вам может потребоваться войти в меню GRUB, чтобы выбрать другое ядро или изменить параметры загрузки.

Серверные и минимальные установки должны отображать меню GRUB по умолчанию. При установке на настольный компьютер вам необходимо в нужный момент нажать Escape, чтобы войти в меню GRUB. Когда система загрузится, вы увидите цикл отображения m1n1 (логотипы Asahi Linux или Fedora) и U-Boot (текстовый экран с логотипом U-Boot в правом верхнем углу). На экране U-Boot отобразится краткий обратный отсчет. Нажмите Escape сразу после того, как обратный отсчет достигнет 0, чтобы войти в меню загрузки GRUB.

Отсюда вы можете выбрать более старую версию ядра (например, для восстановления после неудачной установки ядра) или изменить параметры загрузки (например, для сброса пароля или восстановления после других системных проблем).

Устранение неполадок U-Boot

У U-Boot могут возникнуть проблемы с некоторыми типами USB-устройств. Если вы наблюдаете странное поведение или журналы U-Boot, попробуйте отключить все USB-устройства (кроме одной клавиатуры для настольных компьютеров).

Если у вас возникли проблемы с работой внешней клавиатуры в меню U-Boot или GRUB, вы можете попробовать использовать другой порт USB (например, USB C с адаптером вместо USB A) или другую клавиатуру. Поскольку U-Boot поддерживает только одну клавиатуру, убедитесь, что другие USB-устройства, имитирующие клавиатуру, не подключены. Сюда входят некоторые USB-мыши, а также определенные USB-токены, считыватели штрих-кодов и т. д. (YubiKeys уже должны быть исключены и проигнорированы в U-Boot).

Устранение неполадок m1n1 stage 2

Если на консоли m1n1 отображается сообщение Running proxy…​, это обычно означает, что на stage 1 в m1n1 возникли проблемы с загрузкой stage 2 в m1n1.

Если это произошло после обновления системы, возможно, новый обновленный двоичный файл 2 этапа был установлен неправильно. Вы можете загрузиться в macOS или recoveryOS (см. раздел Изменение запускаемой операционной системы) и выполните следующие шаги, чтобы вернуться к предыдущей версии m1n1 stage 2 и U-Boot..

  1. Откройте терминал

  2. Напишите diskutil list | grep EFI чтобы увидеть доступные EFI разделы

  3. EFI раздел будет называться примерно так EFI — FEDOR. Обратите внимание на идентификатор справа, например disk0sX.

  4. Напишите `sudo diskutil mount disk0sX`с идентификатором, который вы получили выше, для монтирования раздела.

  5. Перейдите к точке монтирования с помощью cd "/Volumes/EFI - FEDOR" (заменив EFI - FEDOR на имя вашего тома).

  6. Перейдите в поддиректорию m1n1: cd m1n1.

  7. Просмотрите файлы с помощью ls. Должны быть файлы boot.bin и boot.bin.old.

  8. Переименуйте текущий файл, присвоив ему неактивное имя: mv boot.bin boot.bin.new.

  9. Переименуйте старый файл, присвоив ему активное имя: mv boot.bin.old boot.bin.

Если вы используете macOS, вы также можете выполнить действия по управлению файлами с помощью Finder. После монтирования раздела с помощью diskutil он появится на боковой панели Finder.

После возврата m1n1.bin загрузитесь обратно в Fedora Asahi Remix, чтобы протестировать восстановленную версию m1n1 stage 2 и U-Boot в частности.

Обратите внимание, что возврат двоичного файла m1n1 stage 2 к предыдущей версии не гарантирует корректную работу, поскольку иногда происходят несовместимые изменения в дереве устройств, которые сопровождают обновления версии ядра. После восстановления вы можете обнаружить, что некоторое оборудование работает некорректно. После успешной загрузки Linux вам следует запустить sudo update-m1n1 для обновления до текущей версии и снова перезагрузиться.

Обновление или восстановление m1n1 stage 1

Иногда политика загрузки системы для Fedora Asahi Remix может быть повреждена. Иногда это происходит после обновлений macOS (из-за ошибок в процессе обновления Apple). Если это произойдет, попытка загрузки этой операционной системы приведет к немедленной перезагрузке. Если эта ОС является загрузочной ОС по умолчанию, компьютер будет неоднократно перезагружаться, пока не появится экран восстановления ОС. Если это произойдет, вам необходимо восстановить stage 1 m1n1 и связанную с ним политику загрузки.

Обновление встроенного ПО системы также может вызвать несовместимость в stage 1 m1n1, требующую обновления. Это может произойти, если вы обновитесь до macOS Sonoma 14.5 или более поздней версии с версией m1n1 stage 1 старше 1.4.13 (выпущенной в мае 2024 г.) из-за ошибки в этих старых версиях m1n1. Чтобы решить эту проблему, обновите stage 1 m1n1.

The process for both of the above situations is the same. First, follow the steps in Изменение запускаемой операционной системы to boot into recoveryOS (preferred) or macOS, and open a Terminal. Ensure you are connected to the internet, and then run the Fedora Asahi Remix installer again, using the instructions in the Installation page (or the steps available on asahilinux.org). Once the installer starts, one of the available options should be to Repair an incomplete installation (p) or Upgrade m1n1 on an existing OS (m). Choose the appropriate option and follow the instructions to upgrade or reinstall m1n1 stage 1.

Recovering an unbootable machine

If your machine is stuck displaying an exclamation mark icon (laptops and iMacs) or SOS LED blink pattern (desktops), you may need to perform a DFU Revive or Restore. To determine if this is necessary, first try to boot using both the current paired recoveryOS and the System recoveryOS.

To boot using the current recoveryOS:

  • Fully power down the machine

  • Нажмите и удерживайте кнопку питания

  • Продолжайте удерживать, пока на экране не появится сообщение "Entering startup options" (ноутбуки, iMac) или пока индикатор питания слегка не погаснет (настольные компьютеры), затем отпустите.

To boot using the System RecoveryOS:

  • Fully power down the machine

  • Quickly press, release, and then press and hold the power button (the whole action should take less than half a second)

  • Продолжайте удерживать, пока на экране не появится сообщение "Entering startup options" (ноутбуки, iMac) или пока индикатор питания слегка не погаснет (настольные компьютеры), затем отпустите.

If either of those processes succeeds and shows the Boot Picker, you can choose an alternate OS to boot or select the "Options" icon to boot recoveryOS and troubleshoot the issue or reinstall another OS from that environment.

Performing a DFU revive or restore

If your machine fails to boot or enter Startup Options, you may have to perform a DFU Revive or Restore.

A DFU Revive will restore and update System Firmware and Recovery (SFR), while leaving operating systems and data intact. This may be able to resolve some issues, but is not guaranteed to work (e.g. a DFU Revive cannot recover a missing System Recovery partition, but it can reinstall recoveryOS into an existing but blank System Recovery partition with the appropriate subvolume).

A DFU Restore will completely wipe all data on the internal storage and restore the machine to factory condition. It is also the only way to downgrade System Firmware to a prior version. This process can recover from any kind of corruption or problem with the internal NVMe storage, and even corruption of the internal NOR Flash storage and several other firmware components. Note that if you perform a DFU Restore, you will lose all data stored on the machine, and it will be returned to its factory condition.

To perform a DFU Revive or Restore, you will need either another Mac running macOS, or a Fedora Linux machine (any hardware) with an available USB port. You will also need an appropriate USB cable to connect both machines together.

Performing a DFU revive or restore using another Mac running macOS

Follow Apple’s documentation to learn how to perform a restore using another Mac, using the macOS Finder or Apple Configurator.

If you have trouble putting the machine into DFU mode, you may also wish to refer to the instructions below.

Performing a DFU revive or restore using a machine running Fedora Linux

You can also boot Fedora Linux on another machine (Intel compatible or Apple Silicon both work), and then use idevicerestore to perform the DFU Revive or Restore process.

If you have a spare x86-64 (Intel/AMD) machine that does not currently have Fedora installed, you can follow the steps in the next section to temporarily live boot Fedora from a USB stick and set up the environment to be able to perform the DFU Revive/Restore. Once the system is up and running, return to this section to continue the process.

You will need a compatible USB cable. If your host machine has Type A ports, use a Type A to Type C cable. If your host machine has Type C ports, use a Type C to Type C cable. You may also use a Type A to Type C cable together with a female Type A to male Type C adapter. Your cable must support data transfer (USB 2.0 480Mbps is sufficient, though USB 3 cables also work). Thunderboot 3 cables will not work, nor will charge-only cables.

To perform a DFU Revive using a second Fedora machine, follow these steps:

  1. Ensure you are connected to the Internet.

    • On Fedora Workstation, click on the top right menu bar icon to select a WiFi network (if not using wired Ethernet).

  2. Open a Terminal.

    • On Fedora Workstation, click on the top left menu icon, type 'terminal' and hit Enter.

  3. Ensure you have at least 40GB of available disk space in the current working directory. If not, change to another directory that does or add additional storage as needed.

    • If you have followed the below steps to perform a live boot and configure your environment, this is already the case.

  4. Run the command sudo dnf install -y idevicerestore usbmuxd to install idevicerestore.

    • If the output indicates that usbmuxd was also installed as a dependency (and was not already installed), run sudo udevadm control --reload to reload the udev rules. Fedora Workstation live images should already have usbmuxd installed.

  5. Run the command sudo dmesg -w to show the live kernel log.

  6. Connect the USB cable between your host machine and the target machine to be restored. The cable must be connected to a specific USB port on the target machine:

    • For laptops, use the leftmost (rearmost) Type C port on the left side.

    • For iMacs, facing the rear of the machine, use the rightmost Type C port (closest to the power connector).

    • For Mac Mini machines, facing the rear of the machine, use the leftmost Type C port.

    • For Mac Studio machines, facing the rear of the machine, use the rightmost Type C port.

    • For Mac Pro desktop machines, facing the top of the machine, use the Type C port farthest from the power button.

    • For Mac Pro rackmount machines, facing the front of the machine, use the Type C port closest to the power button.

    If you are using a Type A to Type C cable, connect the Type C end to the target machine. The Type A end may be directly connected to the host machine, or to a Type C port via a Type A to Type C adapter. USB hubs may also be used on the host machine side (but not the target machine side).

  7. Enter DFU mode. The process is different for desktops and laptops (you can pick one of two options for laptops; try both if you have trouble getting it to work).

    • For desktops:

      1. Start with the machine fully powered down.

      2. Unplug the machine from the mains power and wait 30 seconds.

      3. Press and hold down the power button.

      4. While holding down the power button, connect mains power to the machine.

      5. Continue holding down the power button and watch the kernel log. Look for a USB device log that mentions Product: Apple Mobile Device (DFU Mode).

      6. Once you see the log, release the power button.

    • For laptops (method 1):

      1. Start with laptop fully powered down.

      2. Press and release the power button quickly.

      3. Immediately press and hold the following keys: Left control, left option, right shift, and the power button.

      4. Count down 10 seconds, then release everything except the power button.

      5. Continue holding down the power button and watch the kernel log. Look for a USB device log that mentions Product: Apple Mobile Device (DFU Mode).

      6. Once you see the log, release the power button.

    • For laptops (method 2):

      1. Start with laptop powered up (make sure something is visible on the display).

      2. Press and hold the following keys: Left control, left option, right shift, and the power button.

      3. Wait until the screen turns off, then count down 5 additional seconds, then release everything except the power button.

      4. Continue holding down the power button and watch the kernel log. Look for a USB device log that mentions Product: Apple Mobile Device (DFU Mode).

      5. Once you see the log, release the power button.

    If you don’t see the DFU device in the log, or the Product mentions "Recovery Mode" instead, something went wrong. Retry the steps again. The display of the target machine will remain blank in DFU mode.

  8. On your host machine, press Ctrl-C to stop the dmesg command.

  9. Run the following command: systemd-inhibit sudo -s TMPDIR=$PWD idevicerestore -l.

  10. When prompted, type '1' to select the latest available macOS/firmware version.

During the Restore process, the target machine will display an Apple logo and a progress bar, while the host machine running idevicerestore will print out progress log information. Note that this process involves connecting to Apple’s CDN and servers to download system firmware components and authenticate them for your specific machine.

After the process completes successfully, the machine will reboot into the Recovery Assistant. Follow the prompts to select a macOS volume to recover, and enter your macOS authentication credentials. After this process succeeds, your machine will boot into the Boot Picker. From here, you can choose which OS to boot next.

It is likely that any existing Fedora Asahi Remix installations will become unbootable as a result of the Revive process. If attempting to boot a Linux install triggers a reboot or a Recovery screen, follow the steps in the Обновление или восстановление m1n1 stage 1 section to reinstall m1n1 stage 1 and make the OS bootable again.

If the DFU Revive fails, you will have to perform a DFU Restore. To do so, follow the above steps again, but add the -e option to the idevicerestore command:

systemd-inhibit sudo -s TMPDIR=$PWD idevicerestore -l -e

This will irreversibly wipe all data on the target machine.

After a DFU Restore, your machine will be reset to its factory condition and boot into the macOS first-time setup wizard.

Live booting Fedora Linux on an x86 (Intel/AMD) compatible machine to perform a DFU restore

You can use a USB disk to live-boot Fedora Workstation on any x86-64 machine and perform the DFU restore from that environment, without having to install to local disk. You will need a USB disk with at least 64GB of capacity.

All existing data on the USB disk will be erased.

To set up the USB disk, we recommend using Fedora Media Writer. Follow the steps on that page to download it and write the image to your USB disk, and then boot it on your target machine.

Once the system is booted, follow the following steps to open up a terminal:

  1. On 'Welcome to Fedora' screen, click 'Not Now'.

  2. Click on the top right menu bar icon and connect to a WiFi network (if not using wired Ethernet).

  3. Click on the top left menu icon, type 'terminal' and hit enter.

To perform the DFU Restore process, idevicerestore needs a large amount of temporary disk space. Since the live image runs from RAM, it does not have enough temporary space available. To create and use a temporary partition in the remaining free space on the USB disk, run the following commands one by one:

Next, continue with the steps in the <<dfu-fedora>> section (you have already performed steps 1-3 and do not need to do them again).