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

Error: invalid environment block. Press any key to continue

The error message appears immediately after the boot screen on purple background. Ubuntu 12.04.1 LTS.

Have you tried pressing a key to continue? Also, is this on the installation CD or after you install?

After pressing a key, booting is continuing, even with pressing no key after few seconds. It’s after install.

If it continues to boot, there really is no serious problem, is there? «If it ain’t[sic] broke, don’t fix it!»

On Ubuntu 12.04.4 there’s no line saying save_env recordfail There’s one saying just recordfail . Shall I delete it anyway?

2 Answers 2

Press E at the GRUB menu. Find the line saying save_env recordfail and delete all of it with the Del or Backspace key. Press Ctrl + X to boot, and then open the Terminal by searching it in the dash(launcher menu).

Run the following command, and then when it asks for your password, type it, and press Enter . Your password will not be shown, not even asterisks.

Then, run each command, one-by-one.

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

The second-to-last command should show default=0 . If it does, run the last command, and let it finish. When it finishes, you should get the prompt /boot/grub# or something like that again(it’s what you see after each command). Run exit twice, and then reboot.

The GRUB menu can be found by holding Shift while the system is in the early stages of booting (right through BIOS). The password you give to sudo -i is your USER password, not the root password.

in my boot configuration there is only one line saying recordfail . I deleted it but still can’t get it to boot up

@LưuVĩnhPhúc I know it’s probably too late for you, but I just had the same problem as you. The options seem to have changed slightly in 14.04. I used help.ubuntu.com/community/Boot-Repair to get it to a state where it boots past the error message, and then followed the above instructions to permanently remove the error itself.

@LưuVĩnhPhúc Same problem with my boot configurations. Anything you tried which worked for you? Please help.

This error message means that the grubenv file is > 1024 bytes. This is mostly caused by manually editing the file. (e.g. vi appends a newline on the last line)

To avoid this, you should never edit grubenv using anything other than grub-editenv .

Using grub-editenv set exiting_var=existing_value does not fix the file.

Speculation: You should be able to fix the file by deleting a character or two to get the size back to exactly 1024 bytes. If that does not work, you need to recreate the file using the instructions in this answer instead. (Get the correct values of the variables using grub-editenv grubenv list first and recreate a file with those values)

Читайте также:  Linux debian static ip

Источник

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

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

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

Ошибка : Неправильный блок окружения.
Нажмите любую клавишу для продолжения.
В принципе жить не мешает, но раздражает и если по клавише не жмакнуть, то ждет секунд 5, а потом нормально стартует. Может кто сталкивался?

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

Оффлайн
alienonline

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

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

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

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

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: 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: 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: invalid environment block. 

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

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.

Читайте также:  Astra linux переустановить samba

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.

After a recent system update I got the following error message:

Error: invalid environment block Press any key to continue.

Luckily the system would boot up but ignoring errors isn’t best practice. This error is caused by a faulty GRUB2 environment block. This is a file located in /boot/grub/grubenv.

You can easily regenerate it with the following commands. It is advisable to make a backup copy the file just in case you need to revert.

# grub-editenv grubenv create # grub-editenv grubenv set default= # grub-editenv grubenv list # update-grub

After rebooting the message should have disappeared.

Читайте также:  Linux mint intel linux graphics installer

If you can’t boot from your system drive you can use a Live CD and then mount your system’s boot partition and apply the same commands.

I haven’t tested this part personally but maybe the commands will help as a reference. Details are scarce on purpose, check what the commands do before doing anything.

# mount /dev/sda1 /mnt/boot/efi or # mount /dev/sda1 /mnt/boot/ # grub-editenv /mnt/boot/grub/grubenv grubenv create # grub-editenv /mnt/boot/grub/grubenv grubenv set default= # grub-editenv /mnt/boot/grub/grubenv grubenv list # grub-mkconfig -o /mnt/boot/grub/grub.cfg

The other approach, also untested by me, could involve chroot.

# mount /dev/sda2 /target # mount --bind /dev /target/dev # mount --bind /dev/pts /target/dev/pts # mount --bind /sys /target/sys # mount --bind /proc /target/proc # mount /dev/sda1 /target/boot chroot /target # grub-editenv grubenv create # grub-editenv grubenv set default= # grub-editenv grubenv list # update-grub

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.

Источник

Оцените статью
Adblock
detector