Saturday, December 20, 2008

FIX & Bootcfg Commands on Recovery Console

# Fixboot writes a new startup sector on the system partition:

ex: fixboot c:

Use this command to write the new Windows boot sector code on the system partition. In the command syntax, drive name is the drive letter where the boot sector will be written. This command fixes damage in the Windows boot sector. This command overrides the default setting, which writes to the system boot partition. The fixboot command is supported only on x86-based computers.

# Fixmbr repairs the startup partition's master boot code:
The variable device is an optional name that specifies the device that requires a new Master Boot Record. Omit this variable when the target is the startup device.

fixmbr \device\harddisk2

Fixmbr Command Syntax: fixmbr (device_name)

device_name = This is where you designate the exact drive location that a master boot record will be written to. If no device is specified, the master boot record will be written to the primary boot drive.
Fixmbr Command Examples: fixmbr \Device\HardDisk0

In the above example, the master boot record is written to the drive located at \Device\HardDisk0. In this example, the master boot record is written to the device that your primary system is loaded onto. If you have a single installation of Windows installed, which is normally the case, running the fixmbr command in this way is usually the right way to go.

# Bootcfg modifies the Boot.ini file for boot configuration and recovery.

What Is the Bootcfg Command?:

The bootcfg command is a Recovery Console command used to build or modify the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located.
Bootcfg Command Syntax: bootcfg /list
/list = This option will list every entry in the boot list in the boot.ini file.

bootcfg /scan
/scan = Using this option will instruct bootcfg to scan all drives for installations of Windows and then display the results.

bootcfg /rebuild
/rebuild = This option will step you through the process of rebuilding the boot.ini file.

bootcfg /default
/default = the /default switch sets the default boot entry in the boot.ini file.

bootcfg /add
/add = This option allows for the manual entry of a Windows installation in the boot.ini boot list.

bootcfg /rebuild
In the above example, the bootcfg command scans all drives for any Windows installations, displays the results, and steps you through building the boot.ini file.

#Diskpart What Is the Diskpart Command?:
The diskpart command is a Recovery Console command used to create or delete partitions on hard drives.
Diskpart Command Syntax: diskpart /add
/add = The /add option will create a new partition on the specified hard drive.

diskpart /delete
/delete = This option will remove a specified partition on a specified hard drive.
Diskpart Command Examples:

diskpart /add \Device\HardDisk0 5000

In the above example, the diskpart command creates a 5,000 MB partition on the hard drive located at \Device\HardDisk0.

diskpart /delete \Device\HardDisk0\Partition1

In the above example, the diskpart command will remove the Partition1 partition located on the hard drive \Device\HardDisk0.

diskpart /delete G:

In the above example, the diskpart command will remove the partition currently assigned the drive letter