Меню Рубрики

Run boot windows 7

Все, что вы хотели знать про загрузку Windows, загрузчики и восстановление загрузки ОС

В этой статье я не планирую подробно рассказывать обо всех типах загрузчиков, но хочу свести воедино всю необходимую информацию, которую нужно знать для создания загрузочных дисков, флэшек, а также для восстановления загрузчиков.

Принципы загрузки операционных систем

При включении компьютера управление процессором получает BIOS, и если он настроен на загрузку (boot) с винчестера, то он подгружает в оперативную память компьютера первый сектор диска (MBR) и передает управление ему. Если у вас несколько жестких дисков, то каждый из них содержит свою MBR. В этом случае можно или менять порядок загрузки дисков в BIOS, или же прописать все операционные системы с разных дисков в один PBR загрузчик, об этом ниже.

Сразу оговоримся, что если у BIOS у вас включен режим загрузки UEFI, то структура разделов диска у вас должна быть не MBR, а GPT. GPT имеет не только другую структуру разделов, но и другую структуру загрузочной области. Там в первый сектор записывается «заглушка» для BIOS (Protective MBR), которая служит для того, чтобы старый Legacy BIOS мог загрузиться с GPT диска в режиме совместимости, если ОС была установлена на GPT (часто в BIOS его называют CSM – Compatibility Support Module). Однако, вы никогда не сможете загрузить ОС с MBR диска, если в BIOS выставлена загрузка в режиме UEFI.

При загрузке операционной системы, сначала считывается первый сектор с устройства загрузки, представляющий собой главную загрузочную запись (Master Boot Record — MBR). Стандартно, в качестве MBR выступает первый сектор загрузочного диска. MBR содержит список разделов, признак активного раздела (раздела, с которого будет выполняться загрузка ОС), некоторые служебные данные, а также программный код для считывания в память загрузочного сектора активного раздела (Partition Boot Record — PBR) и передачи ему управления.

Размер сектора на жестком диске — 512 байт. В секторе MBR хранятся данные, которые должны заканчиваться специальной сигнатурой. Этим словом называется специальная, строго установленная, последовательность из 2 байт с шестнадцатеричными значениями 55h AAh, которая записывается в последние 2 байта сектора и соответственно имеет смещение от начала сектора 1FEh. Если хотя бы один из двух последних байтов отличается по значению, считается, что первый сектор не является MBR и не содержит осмысленной информации. Если компьютер при старте, прочитав первый сектор, не обнаружит правильной сигнатуры, он не будет передавать управление располагающемуся там коду, даже если он правильный, а выдаст сообщение о том, что главная загрузочная запись не найдена.

Общая структура MBR может быть представлена следующей таблицей:

Смещение Длина Описание

000h 446 Код загрузчика

1BEh 64 Таблица разделов

1FEh 2 Сигнатура (55h AAh)

Длина указана в байтах.

Как видно, MBR может содержать информацию максимум о 4 разделах. Каждый 16-байтовый блок, содержащий информацию о разделах, в своем начале содержит признак активности раздела — т.е. признак того, что операционную систему следует загружать именно из этого раздела — может иметь значения 80h (раздел активен) и 00h (раздел не активен). Количество активных разделов должно быть не более одного.

Шестнадцатеричный однобайтовый код далее указывает на тип (ID) раздела. Например, 07h – раздел типа NTFS, 0Bh – FAT32, 17h – скрытый NTFS раздел, 27h – системный скрытый NTFS раздел для восстановления системы.

Типы MBR

Выше мы увидели, что в сектор MBR записывается код загрузчика. Что же это? Дело в том, что в MBR может быть записан как «стандартный» загрузчик, так и альтернативные загрузчики.

Существуют следующие распространенные типы MBR:

  • Windows NT версий 5.х и 6.x, занимает 1 сектор. Может загружать ОС только с первичного активного раздела.
  • GRUB4DOS версий 5.х и 6.x – занимает 16 секторов. Представляет собой файл gbldr.mbr. также его можно установить в качестве PBR прямо в раздел.
  • GRUB 2.0 – универсальный загрузочный менеджер, занимает 63 сектора. Состоит из файлов boot.img и core.img. Может работать с любыми файловыми системами и загружать ОС как с первичных, так и логических разделов.
  • PLoP – занимает 62 сектора и имеет продвинутый интерфейс. Позволяет организовать загрузку с CD/Floppy/USB без поддержки и обращения к BIOS.
  • UltraISO USB-HDD – занимает 1 сектор и позволяет выполнять загрузку с внешних USB HDD дисков.

Конечно, с учетом многообразия ОС, существует масса других MBR, но они не так популярны.

Операционные системы дружат только с определёнными типа загрузчиков, однако это не значит, что их нельзя модифицировать для поддержки других ОС. Так, в Windows MBR можно добавить информацию о Linux разделе, но этого недостаточно, чтобы Linux стал грузиться. Для этого также потребуется редактировать и PBR. Однако линуксовый LDLINUX.SYS требует наличия своего микрокода в MBR, чтобы обращаться к нему в процессе загрузки, то есть если у вас загрузочная запись Windows NT MBR, а загрузчик GRUB, то такая схема работать не будет. Виндовсовые загрузчики могут обойтись без наличия соответствующего микрокода в MBR, поэтому они могут грузиться и через GRUB MBR.

Главное, что вам нужно понять, что MBR содержит микрокод, инструкции для процессора, а не файлы. PBR же указывает на загрузчик, который является файлом.

Разнообразие PBR

Мы с вами выяснили, что MBR передает управление на активный раздел с PBR. PBR (Partition Boot Record), так же называют volume boot record (VBR) – это микрокод в начальном секторе раздела диска (часто это сектор 63), который содержит информацию, какой же загрузчик искать.

Существуют следующие загрузчики:

Тип MBR — NT 5.x/6.x, 1 сектор

  • io.sys для MS-DOS, Windows 95/98/МЕ
  • ntldr для Windows 2000/XP/2003
  • bootmgr для Windows Vista/7/8/8.1/10

Тип MBR — Grub4DOS, 18 секторов

Тип MBR — LILO/GRUB и др. линуксовые (к-во секторов зависит от версии и количества файлов)

  • ldlinux.sys – основной базовый модуль
  • syslinux.sys — для загрузки с FAT, FAT32, NTFS
  • isolinux.bin — для загрузки с iso9660
  • pxelinux — для загрузки по PXE
  • extlinux для загрузки с ext2/ext3/ext4 или btrfs

Как я сказал выше, загрузчик является не загрузочной областью, а бинарным файлом.

  • Файлы Windows NTLDR или BOOTMGR должны лежать в корне активного системного раздела и работают они по-разному. Об этом ниже.
  • Файл GRLDR используется Grub4DOS также должен лежать в корне партиции, с котрой выполняется загрузка
  • Syslinux – универсальный загрузчик, содержащий много модулей и поддерживающий загрузку с файловых систем ext2/¾, FAT, NTFS, CD/DVD дисков, по сети через PXE. Позволяет организовать текстовое или графическое загрузочное меню.
    Чаще всего этот загрузчик используют для запуска Linux с файловых систем FAT/NTFS или же создания мультизагрузочных USB флэшек, позволяющих загружать как Linux-совместимые приложения под DOS, так и Windows PE.

Например, типичные пример создания мультизагрузочной флэшки – Multiboot USB 2k10, создаваемые уважаемыми conty9 & korsak7. Мультизагрузочный диск системного администратора с возможностью загрузки c CD/DVD, флешки, USB-HDD и обычного HDD и состоящий из нескольких Windows PE-сборок, а также DOS версий продуктов компании Acronis – например Acronis True Image (выполнены на Linux-ядре). Именно из-за этого смешанного зоопарка систем и приходится использовать загрузчик Syslinux (хотя можно и Grub4DOS).

В своем арсенале вам необходимо обязательно иметь утилиту BootICE. Уникальная в своём роде утилита для изменения или бэкапа/восстановления MBR (Master Boot Record) или PBR (Partition Boot Record). С BOOTICE, вы можете легко изменять тип MBR/PBR. Поддерживается загрузочные записи: Grub4DOS, SysLinux, PLoP, MS NT52/60… Например, с помощью этой утилиты, вы можете установить Grub4DOS вашим MBR или PBR, установить NTLDR или BOOTMGR к вашему PBR, установить SYSLINUX на PBR, и так далее.

Источник

Windows 7 Boot Repair via Command Prompt (5 Ways and 2 Tips included)

Want to fix Windows 7 boot problems? You can see this article and learn Windows 7 boot repair via Command Prompt.

By Ivy / Last Updated October 9, 2020

If you have Windows 7 boot problems, the boot sector or master boot record on your system partition may be damaged, corrupted, or has missing files. And you will receive an error message like the following before Windows actually begins to load.

Missing operating system

Reboot and select proper boot device

Invalid partition table

Bootmgr is missing

FATAL: No bootable medium found! System halted.

Then, what are the boot sector and master boot record exactly?

What are the boot sector and master boot record?

The boot sector is a small section at the beginning of a hard drive. It’s created when you format the hard drive.

The boot sector contains some code and data that helps BIOS hand off the startup process to Windows. It also hosts the Master Boot Record (MBR), which contains the disk signature, partition table for the disk, and a small bit of code called the master boot code.

When a PC starts, the BIOS will load the master boot code into the PC’s RAM. Then it will scan the partition table, determine the active partition, load a copy of the boot sector into the PC’s RAM, and hand off the startup process.

If you backup MBR in advance, you can use it to restore your computer and make it work as normal. If not, you can see the next part and learn to repair boot with command prompt in Windows 7.

Five efficient ways to run Windows 7 boot repair

Way 1: Startup Repair with Windows installation media

If your boot sector or MBR runs into problems, you cannot start Windows normally. That’s to say, you need a bootable media to boot your computer. You can choose to create the Windows installation media or create a repair disk on a working computer.

Start with the detailed steps:

Step 1. Create Windows 7 installation media on a working computer. You can download ISO image files from Microsoft Store and burn the ISO image files to a USB drive or CD/DVD via Windows 7 USB DVD download tool.

Step 2. Plug the USB drive into your computer.

Step 3. Start your computer and press the corresponding key to go to BIOS.

Step 4. Set boot priority to your drive in the Boot option.

Step 5. Restart your computer and press any key to boot from it.

Step 6. Wait for Windows 7 installation files to load.

Step 7. Click Repair your computer in the initial Windows installation screen.

Step 8. Select the operating system in the window and click Next.

Step 9. Select Startup Repair in the System Recovery Options and it will automatically start to repair boot sector or MBR in Windows 7. Just wait patiently until the process is completed and click Finish.

If the startup repair not working in Windows 7, you still can click View advanced options for system recovery and support in the last page and back to the System Recovery Options page. Then, try command prompt in Windows 7 to repair boot.

Way 2: Windows 7 boot repair from Command Prompt

Step 1. Click Command Prompt in the System Recovery options

Step 2. Fix MBR in Windows 7. You can type the following command and hit Enter.

bootrec /fixmbr

Note: This command can write a new Windows-compatible MBR based on the version of your Windows to the boot sector. And it does not overwrite the existing partition table.

Step 3. Repair boot sector in windows 7. You can type the command below and hit Enter.

bootrec /fixboot

Note: This command can write a new boot sector to the system partition. And it does not overwrite the current partition table. If you install multiple operating systems on this computer, you need to reconfigure the boot options.

Step 4. Fix bootmgr is missing in windows 7 via command prompt. You can type the below command and press Enter.

bootrec /scannos

Step 5. Rebuild your BCD and get the missing Windows installations back. You can type the following command and press Enter to run it.

bootrec /rebuildbcd

Step 6. Rebuild the boot sector for Windows. You can type the following command and press Enter to start it.

bootsect.exe /nt60 all /force

The /nt60 parameter applies the master boot code that is compatible with BOOTMGR. The /all argument updates the master boot code on all partitions.

The /force parameter forcibly dismounts the volume(s) during the boot code update so that the Bootsect.exe tool does not gain exclusive volume access.

Way 3: Repair boot sector in Windows 7

If the bootrec /fixmbr and bootrec /fixboot doesn’t work, you can try to restore the boot sector code of your Windows 7 with steps below.

Step 1. Go to Command Prompt in the System Recovery Options and then type the following commands to find the drive letter of your installation media. Just see “Type” column which contains the word “CD-ROM”.

diskpart

select disk 0

list volume

Step 2. Take D: as an example and type commands below. If not, you can replace it.

cd boot

step 3. Type bootsect /nt60 SYS /mbr and hit Enter to restore boot sector code.

Step 4. Remove the installation media and restart your computer.

Way 4: Rename and rebuild BCD via Command Prompt

If the above command prompt does not work for you, you still can try to backup and rename BCD first and then rebuild it via CMD.

Step 1. Select Command Prompt in the System Recovery Options and type bcdedit /export C:\BCD_Backup command to create a backup for BCD.

Step 2. Type notepad in the command prompt and then click File > Open > Computer, find the file BCD in the corresponding drive, rename it as BCD.old, and then save the change and exit this window.

Step 3. Type bootrec /rebuildbcd in the command prompt window and input Yes when prompt.

Step 4. Type bcdedit /enum all in the window.

Step 5. Type exit and reboot your computer.

If you want to rebuild BCD without notepad, you can choose to type the following commands and hit Enter in order.

bcdedit /export C:\BCD_Backup

cd boot

attrib bcd -s -h -r

ren c:\boot\bcd bcd.old

bootrec /RebuildBcd

Note: cпјљrefers to the location of your Windows.

Way 5: Windows 7 boot repair without disk

Step 1. Turn on your computer, press and hold the F8 key to go to the Advanced Boot Options screen, then choose Safe Mode with Command Prompt.

Step 2. You can try command prompt for Windows boot repair above and see if it works.

Extra tips for Windows 7 boot repair

1. Scan the integrity of your file system and hard drive and run Windows startup repair command prompt via chkdsk.

Aside by problem of boot sector itself, the physical problem of your hard drive can also damage the boot sector and MBR. Thus, you need to rule out this possibility.

2. Backup your computer with a free backup software.

No one dares to say that you can recover your computer all the time. Once the recovery fails, you can only reinstall your computer and all the apps. What’s more, you will lose your files forever. Thus, you need to create a backup for your computer or files. With one or more backup in hand, you can restore it whatever happens. To backup your computer, you need a proper software. I recommend you the free backup software — AOMEI Backupper Standard.

With this software, you can backup system, disk, partition, even a single file. You can use email notification to get to know whether your backup is completed successfully or not. Also, you can create a Windows 7 schedule backup at an interval date, such as daily, weekly, monthly.

And you can manage backup disk space via Backup Scheme. But this feature is only available on the paid-version. If you want to free up disk space, you need to upgrade to AOMEI Backupper Professional. If you use server-based computer, you can directly download AOMEI Backupper Server edition.

If you want to protect unlimited PCs and servers within your company, you may choose AOMEI Backupper Technician Plus. It offers unlimited billable technical services to clients. It also enables you to copy installation directory for portable version creation.

To backup your computer, you can download the backup software and open it. Then, click Backup and select the Backup type in the list. At last, follow the corresponding article to finish the backup.

Secure Download

To restore your backup, you can click Restore and complete the rest of step via on-screen instructions.

If your computer cannot boot, you can create a bootable media on a working computer and boot the computer having trouble. Also, you can use PXE boot tool to boot the unbootable computer.

Summary

If you receive the above mentioned error message, the boor sector or MBR may be corrupted or damaged. You can use installation disk to run Startup Repair or do Windows 7 boot repair via Command Prompt.

If you can repair boot with command prompt in Windows 7, you are very luck. But, sometime, you will fail to repair startup issue. To ensure the security of your data and your computer, you’d better to create a backup in advance. With a backup in hand, you can restore it at any time.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Run ansible on windows
  • Rufus не запускается на windows 7
  • Rufus как пользоваться windows 7
  • Rufus windows to go что это
  • Rufus windows 2012 r2