Ошибка неправильный блок окружения ubuntu

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • [РЕШЕНО]Ошибка : Неправильный блок окружения.
  • Печать

Страницы: [1]   Вниз

Тема: [РЕШЕНО]Ошибка : Неправильный блок окружения.  (Прочитано 5340 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
alienonline

 Здравствуйте, уважаемые участники форума !
Продолжаю устранять неприятные симптомы после краха SSD.

Сабж возник после одного из эпизодов самопроизвольного монтирования файловой системы в read-only. Теперь все стоит на новом SSD, но возникает при загрузке. Если выбирать пункты загрузки вручную, то его не возникает,а появляется привычное «Загружается начальный образ…»
  А вот по умолчанию высвечивается в верхнем левом углу именно это :

Ошибка : Неправильный блок окружения.
Нажмите любую клавишу для продолжения...

В принципе жить не мешает, но раздражает и если по клавише не жмакнуть, то ждет секунд 5, а потом нормально стартует. Может кто сталкивался?

« Последнее редактирование: 20 Октября 2016, 18:27:28 от Punko »


Оффлайн
alienonline


  • Печать

Страницы: [1]   Вверх

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • [РЕШЕНО]Ошибка : Неправильный блок окружения.

SMF 2.0.19 |
SMF © 2011, Simple Machines | Карта форума

Страница сгенерирована за 0.08 секунд. Запросов: 25.

Проблема с Grub2: invalid environment block

Пару дней назад позвонила мне знакомая с такой проблемой. Обновлялась у неё операционная система Linux Lubuntu 12.04 и во время обновления у неё свет выключился. Сразу как свет обратно включили у неё совершенно отказалась загружаться операционная система Linux Lubuntu 12.04. Появляется окно загрузчика Grub2, после выбора загрузки Linux система выдает вот такое сообщение

error: invalid environment block
Failed to boot default entries.
Press any key to continue…


Далее после нажатия любой клавиши обратно загружается Grub2 и все по кругу. Я так догадался что как раз когда свет выключился у неё наверно этот самый загрузчик и обновлялся. Печально конечно, но вроде не смертельно.

Решаю обновить Grub2 с Live-CD. Соответственно беру Live-CD с Ubuntu пытаюсь открыть DVD-ROM и получаю первый облом. DVD-ROM не работает. Оказалось у неё дочурка ))) туда напихала ваты и сухарей. Положение усугубляет то что комп у неё старый и загрузку с USB тоже не поддерживает. ((( Все это совершенно не радует, но все равно мысль крутится что раз Grub2 загружается то можно как-то указать что ему загружать, хоть там что-то и не работает.
Включаю Google и ищу как это сделать. Хорошо хоть искал не долго. Итак

Как только загружается Grub2 жмём кнопку «e» и заходим в режим редактирования Grub2. Далее находим строчку

recordfail

И удаляем её. После чего нажимаем Ctrl-X и загружаемся.
Загружается наконец наша операционная система Linux Lubuntu 12.04. Вводим логин, пароль, все работает. Дальше произвел обновление системы, первая же команда

sudo apt-get update

И система начала ругаться, в связи с чем я выполнил переконфигурацию пакетов.

sudo dpkg —configure -a

Система что-то обновила. Далее ещё раз, на всякий случай обновился при помощи.

sudo apt-get update
sudo apt-get upgrade


Да и на всякий случай, выполнил

sudo update-grub2

Уж сам не знаю надо ли было? Ну перезагрузился, система спокойно запустилась. Все рады и довольны, принцесса спасена от кривого Grub2, поцелуй мне так и не достался ((

Today after I restart my computer, a mysterious error occur: “Error: invalid environment block. Press any key to continue…”. The most tragic is, after I press any key, the system is no-response, it was die.

After I search some solution on internet, I found many people say I need to key in the terminal instructions. My God.

To solve this problem, I use the “Ubuntu Live USB” and enter the Ubuntu environment and I can use terminal! (maybe you can refer “A simple note to Make a Ubuntu 18.04 Live USB”).

If you can key in instructions in black window, you will not be so troublesome.


Solution

If you also use Ubuntu Live USB to enter the Ubuntu desktop environment to open the terminal, now, you need to mount your boot disk.

And then, get the sudo permission:

sudo -i

Use the following instructions to try to fix grub (the path is the boot disk you mount):

cd /boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
grub-editenv grubenv list
update-grub
reboot

The above instructions have been learned from StackExchange, and I have confirmed that using Ubuntu Live USB can also be used successfully.


References

  • https://askubuntu.com/questions/191852/error-invalid-environment-block-press-any-key-to-continue
  • https://unix.stackexchange.com/questions/522402/error-invalid-environment-block

I recently re-purposed two old computers into one new machine, and installed Linux Mint 19.2.

Now on every boot, something is wrong with GRUB. I know what you’re thinking: Bad disk, replace ASAP. But please read on.

I’ve written down a few of these boot messages and numbered them for reference.

Error 1

error: failure writing sector 0x74800 to `hd0'.
error: failure reading sector 0x6338d from `hd0'.

Press any key to continue...

I don’t think pressing a key ever did anything. I need to hard reset.

Error 2

error: failure writing sector 0x6c808 to `hd0'.
error: failure reading sector 0x74200 from `hd0'.
error: you need to load the kernel first.

Press any key to continue...

    Failed to boot both default and fallback entries.

Press any key to continue...

Key-press does not boot the system, but I can press ctrl+alt+del to reboot.

Error 3

error: invalid environment block.

The computer hangs here. Num-lock is responsive but extremely laggy. I need to hard-reset the system.

Error 4

error: invalid environment block.

Press any key to continue...

This is the one that makes me happy, because pressing a key will make it boot normally.

So every boot, 1 out of 2 times I get Error 4 above, and I can just press a key and boot normally.

The other half of the time, I need to boot with a Linux Mint bootable USB stick. I will run fsck.ext4 -f /dev/sda1 (which is my /boot partition), which finds no problem, I reboot and 4 out of 5 times I get Error 4 above and I can boot normally.

I guess there is this 1 out of 10 times left where I need to boot to USB again, and run gdisk, which informs me that the GPT of the bootable SSD has been corrupted and I restore the backup record. Then when I reboot, I get the above Error 4, and I can boot normally.

Hoping for an easy fix, I’ve tried reinstalling Linux Mint completely using different partition layouts. The problem was the same.

Thinking there must be a problem, I’ve run fsck, fsck.ext4 -f, e2fsck -c, e2fsck -cc (these are the ones I recall) and there are never any problems found.

I’ve tried recreating the environment block like so:

cd /boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0

Recreating the environment block will sometimes result in a single boot without error, but the next boot the error is always back.

Hoping to trigger some internal bad blocks reordering system, I tried to zerofil /boot before recreating the environment block like so:

dd if=/dev/zero of=/boot/zerofil.bin bs=32M; rm /boot/zerofil.bin

But this didn’t change anything either. I have backed up my partitions, and compared the backups. I have not encountered any data corruption apart from /boot/grub/grubenv and sometimes the GPT. I have checked all blocks using non-destructive read-write.

According to the SMART screen in the ‘disks’ utility, all assessments are «OK». Not a single attribute assessment exceeds its threshold. The «Reallocated sectors count» is zero, and the «Read Error Rate» is zero.

I believe that there is nothing wrong with the SSD, but somehow my system cannot handle safely writing to the disk prior to starting Linux, causing it to corrupt files it touches. It seems that starting Linux from a live USB stick first and doing a soft reboot fixes this remedy. Sometimes I need to do a hard reset, and I believe this sometimes causes the GPT to be corrupted, needing me to restore the backup using gdisk.

What causes this, and how can I fix this?

So this is a Crucial M4 ATA M4 CT256M4SSD2 revision 0009 on an old ZOTAC H77-ITX WiFi H77ITX-AE (2012) mainboard with an old bios, but unfortunately it’s the latest bios.

A209P 0.10 x64 05/09/2013 09:48:07

I vaguely remember having issues that made me think this SSD was broken when I installed Linux on this ssd/mainboard some 6 (?) years ago, and I tried random things until it just worked. I believe it involved installing Windows first, and then installing Linux alongside of it. But that sounds like a coincidence. The SSD has not been used a lot, because most of the action happened on separate HDD drives. This SSD basically just contained Windows and Linux. I never use(d) Windows on this SSD, and it is not installed today.

The error message might refer to GRUB2 environment block, located usually in /boot/grub/grubenv. It should contain readable text, so have a look at it.

Hanging on black screen might be caused by many things. Perhaps your distribution sets up GRUB in such a way that some essential setting is stored in the environment block, and the problem in the environment block also causes the boot to fail. Or perhaps it’s caused by something different, like BIOS detecting the disks in a different order than expected by the grub-install program.

The updates to the Manjaro OS may have included an update to GRUB, causing it to automatically re-install it. If you had to do any special steps in installing GRUB when you originally installed Manjaro, you may have to do them again now.

Or if you added any new disks to the system after installing the OS and updating it, you might not originally have needed any special steps, but might need them now… and that could be what tripped up the automatic update.

If your system uses classic BIOS rather than the new UEFI firmware, the root cause is likely the fact that there is no guaranteed way for the OS to identify the disks that would be meaningful to the BIOS. Without further information from the system administrator, the grub-install command will have to essentially guess in which order the BIOS will detect the disks at boot time.

If the /boot/grub/device.map file exists, it describes the current information/guess GRUB has on the BIOS boot order; if you add/remove/change disks on the system, you should also update this file to match the new state, or else an automatic GRUB update might cause exactly the kind of situation you’re experiencing right now. To fix, correct the current device.map file to match how your BIOS actually sees the disks, then use grub-install to reinstall GRUB.

С http://ubuntuforums.org/showthread.php?t=1285098 :

Нажмите Eв меню GRUB. Найдите строку с надписью save_env recordfailи удалите все с помощью клавиши Delили Backspace. Нажмите Ctrl+ Xдля загрузки, а затем откройте терминал, выполнив поиск по нему в тире (меню запуска).

Выполните следующую команду, а затем, когда она запросит ваш пароль, введите ее и нажмите Enter. Ваш пароль не будет показан, даже звездочки.

sudo -i

Затем выполните каждую команду, одну за другой .

cd /boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
grub-editenv grubenv list
update-grub

Команда с двумя последними должна отображаться default=0. Если это так, выполните последнюю команду и дайте ей закончить. Когда он закончится, вы должны /boot/grub#снова получить приглашение или что-то в этом роде (это то, что вы видите после каждой команды). Запустите exitдважды, а затем перезагрузите компьютер.

Понравилась статья? Поделить с друзьями:
  • Ошибка неверный тип аргумента or stringp symbolp nil
  • Ошибка нет доверия сертификату astra linux
  • Ошибка неправильный номер карты
  • Ошибка несоответствие токена phpmyadmin
  • Ошибка неправильный запрос 1с