As part of a recent upgrade of a piece of 3rd party software, I recently restarted one of the Windows 2000 servers that I currently maintain, only to be greeted with this message:
«Windows 2000 could not start because the following file is missing or corrupt: \WINNT\SYSTEM32\CONFIG\SYSTEM».
Ouch. I rebooted the server, and after looking in the ‘OS Choice’ menu, I found that it didn’t have the Recovery Console installed on it. After a bit of digging, I eventually found a set of four Windows 2000 Server boot disks (the CDs for Windows 2000 Server were not bootable) and booted up into the repair console.
To do this:
- Boot from the four Windows 2000 server boot disks. (See this link on how to make these if you don’t already have them.)
- At the «Windows 2000 Server Setup, Welcome to Setup» screen, use the second option, «To repair a Windows 2000 installation, Press R.»
- At the «Windows 2000 Repair Options» screen, use the first option, «To repair a Windows 2000 installation by using the recovery console, press C.»
- At this point, you’ll be given the option to choose which Windows installation you want to log on to. Usually, you’ll just have the one. Type the number of the listed Windows installation and press enter.
- Now you’re prompted for the Administrator password. (You ARE the administrator aren’t you?) Once you have typed the password you are presented with a very welcome command prompt.
Of course, having been through this once, I’ve now checked that all of the Windows servers I maintain have the Recovery Console installed and available at boot time. (See below for details.)
At the Recovery Console
You might like to run chkdsk /f on the partition that contains the system files, just in case a damaged file system is the cause of your problem. If, when you reboot your server, you find the problem isn’t resolved, you’ll really wish that you had the Recovery Console installed but for now it’s back to the floppy disks…
If the chkdsk /f didn’t help, it’s time to restore the Registry Hive to a previous version.
- Find the latest backup of your ‘system’ file.
- On Windows 2000, the orginal file will be in %SystemRoot%\Repair and backups will be in %SystemRoot%\repair\Regback
- On Windows 2003, the file will be in %SystemRoot%\Repair and will be the latest version created at the installation or during a backup.
- Change your working directory to %SystemRoot%\repair and check that you have a file called ‘system’.
- Change your working directory to %SystemRoot%\system32\config. Rename the ‘system’ file to system.old
- Copy the ‘System’ file that you found in the first step to %SystemRoot%\system32\config.
- Reboot your server.
If your latest ‘system’ file is out of date like mine was, some parts of your system may be restored to a previous state and you may find that you have to fix some items manually. For example, because my server had been renamed since %SystemRoot%\Repair\system was last updated, I had to remove my server from the domain, rename it and re-join it to the domain. However, at least I had a server that booted again.
Don’t copy the system.sav file over the system file as it is likely to be the system registry hive as it looked after the text based part of the Windows installer ran. (See below for details.)
Updating the Backup Files in the \Repair Directory
For the future, it’s probably worth updating the files in the %SystemRoot%\Repair directory to match your current installation.
You could use the ERD Wizard to create a recovery disk which will update the %SystemRoot%\Repair directory during the ERD creation. However, if you don’t want to create an ERD, you can just use the Backup tool to backup the System State. The files in the %SystemRoot%\Repair directory will be updated as part of the backup.
On a Windows 2000 Server backing up the System State will put the latest version of default, SAM, SECURITY, software and system into %SystemRoot%\repair\Regback, leaving the original files in place.
On a Windows 2003 Server backing up the System State will put the latest version of default, SAM, SECURITY, software and system into %SystemRoot%\repair\, overwriting the original files.
For Windows NT4, you can use rdisk /s. The /s tells the repair disk utility to NOT request a floppy to generate an new ERD, but to only update the \%SystemRoot%\Repair directory.
Installing the Recovery Console for Future Use
Booting from floppy disks is a slow process (if you can even create or use them at all), so why not install the Windows Recovery Console on to your servers now? To do this:
- Insert your Windows Server installation CD. (Or you could make the i386 folder available from the network if you prefer.)
- Click Start & Run, and then type WindowsInstallationMedia\i386\WINNT32.exe /cmdcons in the Open box.
- Click OK and follow the instructions on the screen.
- When you restart the server, you will have a new option for the Recovery Console in the boot menu.
Windows 2003 Server installation disks are bootable so this isn’t such a big issue for Windows 2003 machines. You can just boot from the CD to the Recovery Console instead.
Appendices
Standard Registry Hives and the Associated Files
- HKEY_CURRENT_CONFIG: System, System.alt, System.log, System.sav
- HKEY_CURRENT_USER: Ntuser.dat, Ntuser.dat.log
- HKEY_LOCAL_MACHINE\SAM: Sam, Sam.log, Sam.sav
- HKEY_LOCAL_MACHINE\Security: Security, Security.log, Security.sav
- HKEY_LOCAL_MACHINE\Software: Software, Software.log, Software.sav
- HKEY_LOCAL_MACHINE\System: System, System.alt, System.log, System.sav
- HKEY_USERS\.DEFAULT: Default, Default.log, Default.sav
Registry Hive File Extensions
- no extension: A complete copy of the hive data
- .alt: A backup copy of the critical HKEY_LOCAL_MACHINE\System hive. Only the System key has an .alt file
- .log: A transaction log of changes to the keys and value entries in the hive
- .sav: A backup copy of a hive
On Windows 2000 and Windows 2003 Server editions, the .sav file will most likely be a Hive backup from the text-mode stage of the server installation. It is created by the text-mode stage so that if the graphics-mode stage of setup fails, only the graphics-mode stage needs to be repeated when the computer is restarted.
Useful Links
- Microsoft Help and Support — Windows registry information for advanced users
- Windows Dev Center — Registry Hives
В этой статье я хотел бы рассказать о настройке и восстановлении операционных систем семейства Windows. Эта статья может оказаться полезной всем — как новичкам, так и опытным пользователям, которые хотели бы получить базовые знания об операционных системах, основанных на ядре NT (new technology) — Windows 2000/XP/2003 Server, а также о более ранних операционных системах — Windows 95/98/Millennium Edition.
Способы восстановления операционных систем Windows 2000/XP/2003 Server
Начну с того, что ядро операционных систем этого семейства состоит всего из нескольких файлов, содержащих всю информацию о программной и аппаратной составляющей любого персонального компьютера, например об установленных драйверах, софте, версии BIOS, видеокарте, процессоре, — в общем, обо всём компьютере.
Эти файлы легко найти, заглянув в папку <SystemRoot>/System32/Config (где <SystemRoot> — папка (путь), в которой установлена Ваша система.
Вы увидите несколько файлов, наиболее важные из которых: SYSTEM, Software, SAM, Security, Default. Обратите внимание, у файлов отсутствует расширение. Все они являются критическими — повреждение любого из них может привести к полной неработоспособности Вышей системы.
Рассмотрим подробнее каждый из них:
- SYSTEM — этот файл содержит сведения об аппаратной комплектации компьютера — процессоре, чипсете, оперативной памяти, BIOS. Этот файл содержит в себе (хранит) раздел HKEY_LOCAL_MACHINE/HARDWARE, в котором, если войти в Редактор реестра, вы можете увидеть весь состав аппаратуры компьютера. Это наиболее критичный файл.
- Software — хранит сведения о программном обеспечении, установленном в системе, как ПО от Microsoft, так и от сторонних разработчиков. Файл представляет собой раздел реестра HKEY_LOCAL_MACHINE/Software и HKEY_LOCAL_MACHINE/Software/Microsoft.
- SAM — (Security Account Manager) или, как указывается в некоторых источниках, Security Access Manager. Файл содержит сведения об учётных записях пользователей, идентификаторе безопасности (SID, Security Identifier), а также о других аспектах, связанных с пользователями в системе Windows.
- Security — файл содержит сведения об общей политике безопасности, используемой на компьютере для конкретного пользователя.
- Default — файл содержит некоторые параметры по умолчанию, касающиеся аппаратной составляющей, программного обеспечения и пользователей.
Другие файлы являются библиотеками, отладочными компонентами, а также журналами протоколирования, создаваемые операционной системой в процессе установки и функционирования. Например, файл setup.log содержит информацию о процессе установки (он является очень важным и создаётся операционной системой). Теперь — то вы поняли, что вся система (системный реестр) хранится в определённых файлах.
А сейчас я хочу обратить Ваше внимание на то, как использовать это преимущество с практической точки зрения.
Войдите в каталог <SystemRoot>Repair. Что Вы видите там? Правильно! Те же файлы — SAM, Security, Software, System, Default, которые Вы видели в каталоге <SystemRoot>/System32/Config. В чём же разница, спросите Вы? Всё очень просто. Заботливые разработчики из Microsoft (которых мы постоянно ругаем), предельно упростили задачу восстановления и сняли тяжёлое бремя возвращения Windows в рабочее состояние с простых пользователей.
Дело в том, что Windows создаёт две копии описанных выше файлов — в каталоге <SystemRoot>/Repair и в каталоге <SystemRoot>/System32/Config. В первом случае хранится полностью работоспособная копия системы, созданная при установке. В ней все настройки хранятся по умолчанию. Отсутствуют программы и драйвера, которые Вы устанавливали в системе — т.е. это «чистая» система.
Во втором случае используется «рабочая» копия. Это наводит на мысль о том, что «рабочую» копию можно заменить «чистой», чем сейчас и займёмся.
Рассмотрим варианты восстановления системы:
Шаг 1. Загружаем компьютер с диска — реаниматора или с загрузочной дискеты. (Если Вы имеете опыт работы с DOS, то проблем возникнуть не должно).
Шаг 2. У меня Windows XP/2003 традиционно устанавливается в C:\Windows, поэтому в командной строке пишим: copy c:\windows\repair *.* c:\windows\system32\config (скопировать все файлы из каталога C:\windows\Repair в C:\windows\system32\config).
Шаг 3. Перезагружаем компьютер. Всё должно заработать. После перезагрузки система примет первоначальный вид.
Теперь о предосторожностях
При замене «рабочей» копии «чистой» копией необходимо обязательно копировать все файлы. При неполной замене файлов может возникнуть сбой системы. Microsoft вроде бы об этом ничего не говорит, однако, такие авторитетные авторы как Роберт Коварт, а также Питер Хипсон, автор книги «Реестр Windows XP» утверждают, что неполная замена файлов может привести к десинхронизации и, как следствие, полному краху системы.
Перед заменой системных файлов на всякий случай сделайте копию «рабочей» версии Windows. Скопируйте содержимое <SystemRoot>/System32/Config в отдельную папку. Это даст возможность вернуться к первоначальным настройкам, если восстановление пройдёт неудачно. Кроме того, обязательно сделайте полную копию реестра. Копия будет храниться в файле с расширением * .reg. В любой момент Вы можете запустить его и опять же, вернуться к первоначальному состоянию системы.
Обратите внимание на тот факт, что Windows не даст скопировать содержимое <SystemRoot>/System32/Config, т.к. эти файлы в данный момент используются системой (произвести данную операцию можно только в режиме DOS).
Мо можно выйти из этой ситуации, попробовав использовать команду xcopy с ключом /c (xcopy C:\windows\system32\config *.* D:\winrest /c).
Теперь Вы можете в любой момент сохранить текущее состояние Вашей системы.
А сейчас поговорим о таком полезном инструменте, как SFC (System File Checker), которая позволяет проверить, и в случае необходимости восстановить системные файлы. Данная утилита, насколько я знаю, была уже включена в первую версию Windows 98, в Windows ME от неё почему — то отказались, но она снова появилась в Windows 2000 и присутствует во всех последующих версиях. Использовать команду предельно просто. Откройте командную строку и напишите sfc /scannow. Данная команда активизирует процесс проверки системных файлов. Если программа найдёт повреждённый системный файл, она попросит вставить диск с дистрибутивом Windows для восстановления этого файла.
Несколько советов пользователям Windows 95/98/ME
Основными файлами в этих операционных системах являются system.dat (сведения о системе) и user.dat (сведения о пользовательских настройках). Скопируйте эти файлы в отдельную папку. Рекомендуется как можно чаще производить данную операцию, что всегда иметь под рукой наиболее свежую копию системы.
Также в состав этих операционных систем входят такие полезные программы как scanreg. Она помогает проверить реестр на ошибки и в случае необходимости восстановить его из резервной копии. Синтаксис команды:
- scanreg /fix — проверка и лечение системного реестра;
- scanreg /restore — восстановление реестра из резервной копии (по умолчанию Windows хранит копии 5 последних удачных загрузок системы);
- scanreg /backup — создание резервной копии реестра.
Кроме того, вы можете воспользоваться такой полезной утилитой как msconfig, где присутствует много интересных настроек относительно загрузки системы, переменных окружения и Автозагрузки.
Программа msinfo32.exe, которую можно запустить из приложения Выполнить, открывает доступ ко всей аппаратной составляющей Вашего компьютера: запросам на прерывания IRQ (Interrupt Request), каналам DMA (Direct Memory Access). На основании работы этой программы можно производить общую диагностику системы, выяснять причины проблем, например, аппаратных конфликтов.
Загрузка…
i computer mouse image by Edyta Anna Grabowska from Fotolia.com
Windows 2003 provides server services for your network users. The server operating system allows file sharing, print sharing and user permission control. Windows 2003 includes a backup application that saves snapshots of your registry settings. When the registry corrupts, you can restore a backup file and repair the Windows 2003 registry. This can fix problems after you install a software application that creates errors each time you boot the server computer.
Click the Windows 2003 «Start» button and then click «Programs.» Click the «Accessories» icon and then click «System Tools.» In the list of system tools, click «Backup» to open your backup and restore utility.
Click the «Restore and Manage Media» tab. This tab displays a list of options in the center list box. Click the plus sign next to «My Computer» to view a list of options.
Check the box labeled «System State.» In the details window, check the box labeled «Registry» and remove the check marks next to any of the other objects.
Click the «Restore» button to start the restoration of the registry files. This may take several minutes. Click «Restart» when prompted to reboot your computer.
Writer Bio
Jim Campbell has been a computer engineer for over five years. He excels in hardware repair, computer programming and troubleshooting, and software design. He is currently attending Florida Atlantic University, pursuing a master’s degree in computer and electrical engineering and fine-tuning his technical writing abilities.
Backing up and Restoring Windows NT/2000/XP/ Server 2003 Registries Manually
If the boot partition of Windows NT/2000/XP/Server 2003 is formatted using the FAT file system, you can easily back up the system registry manually by booting the computer under an alternative operating system (for example, MS DOS or Windows 9x/ME) or even using the boot diskette. When this is done, you will be able to copy registry-hive files to the backup media using any method of copying (for example, you may use both Windows Explorer and the command line).
If the Windows NT/2000/XP or Windows Server 2003 boot partition uses NTFS, you may have some difficulties using this method of backing up the registry (however, contrary to information provided in some sources, this isn’t always the case). You may sometimes need to format the Windows NT/2000/XP/Server 2003 boot partition using NTFS (this may be required by the security rules adopted by your company or by certain software products, which need to be installed on NTFS partitions). However, you may wish to continue using a manual method of backing up the registry. The simplest method of avoiding any possible problems is a parallel installation of the operating system. Microsoft officially recommends this method of improving system reliability. This tip can be found in both the Resource Kit documentation and in Microsoft Knowledge Base articles. If you follow this recommendation, though, you’ll need to consider the compatibility aspects of NTFS 4 and NTFS 5. You can also use shareware or freeware NTFS drivers, which can be downloaded from the Internet).
To back up Windows NT/2000/XP/Server 2003 registry manually, copy the files contained in the %SystemRoot%\System32\Config folder to the backup media. Note that you need to use backup media of sufficient capacity, since the contents of this folder almost certainly won’t fit on a 1.44 MB diskette.
Selection of removable storage media for transporting your files (for system administrators and technical-support personnel these, most probably, will include recovery tools, drivers, system updates, diagnostic utilities and, certainly, backup files, such as registry backups) is very important. Till recently, ZIP disks and CD-Rs were used for this purpose. Over the past few years, however, newer and better media have become more and more popular. If you need a portable toolkit for emergency situations, such things as external USB card readers, Flash Memory cards, and, above all, USB Flash drives, will be invaluable. Such devices can hold up to 1 GB of data, are very portable, extremely light weight, and compatible with any PC equipped with a USB port. Just stick the flash drive into the USB port of your PC running Windows 2000/XP or Windows Server 2003 and Windows Plug and Play will immediately see it as an additional drive (more information on this topic will be provided in Chapter 5). Then copy the files you need to take with you, unplug the device from the PC, and you’re ready to go. Flash drives hold more data than a floppy disk, are more portable than ZIP drives and other remote-storage devices, and are more convenient (and less fragile) than CD-RW disks. In short, USB Flash Drives may just be the perfect removable storage medium.
Note |
Unfortunately, the small size and large storage capacity of such devices, apart from the advantages that they bring, can also make them dangerous. In order to install such a device in Windows 2000/XP or Windows Server 2003, it isn’t necessary for the user to belong to the Administrators group. For example, during the installation of portable USB drives the user can bypass entirely administrative safeguards against worms and viruses, unauthorized software such as shareware programs, software pranks, MP3 files, video clips, spyware or keystroke loggers that can enable users to capture passwords or other sensitive information. Another threat created by such devices is that of theft or loss of software and confidential data. Unless you disable all of the USB ports in your environment, they are impossible to defend against. Protective measures that you can take to safeguard your corporate network against these threats will be considered in Chapter 9. |
The files that need to be copied from the %SystemRoot%\System32\Config folder are listed below:
Appevent.evt |
Secevent.evt |
Sysevent.evt |
Default |
Security |
System |
Default.log |
Security.log |
System.alt[*] |
Default.sav |
Software |
System.log |
Sam |
Software.log |
System.sav |
Sam.log |
Software.sav |
Userdiff |
[*]This file was eliminated in Windows XP and Windows Server 2003. It is only present in earlier versions of Windows NT/2000. |
Note |
When backing up the registry manually, don’t forget to create backup copies of user profiles, which are stored under %Systemdrive%\Documents and Settings\<Usemame> folders. To create backup copies of user profiles for each user quickly, log in as the Administrator and copy the Ntuser.dat files for each existing user profile (more detailed information on user profiles will be provided in Chapter 10. |
Restoring the registry from a backup copy that was created using this method requires booting the computer under an alternate operating system. After rebooting, you simply need to copy the registry files from the backup media back to the %SystemRoot%\System32\Config folder.