|
|||||||
Консольные команды по управлению дисками в Windows
Время создания: 31.08.2020 09:04
Автор: Vic Laurie
Текстовые метки: windows, консоль, команда, диск, подключение, mbr
Раздел: Компьютер - Windows - BAT файлы, командная строка
Запись: xintrea/mytetra_syncro/master/base/1598853849u3xgvw759h/text.html на raw.github.com
|
|||||||
|
|||||||
Мало кто знает, но в консольке винда умеет работать с флешками, в которых используется MBR с гибридным образом. Если флешка не видится в графическом интерфейсе пользователя, с ней можно попробовать работать через консольные команды. Далее дано описание утилиты diskpart на английском. Следует учитывать, что состав команд, которые знает diskpart, отличается в зависимости от версии Windows. The Disk Management Console Diskpart Windows XP, Vista, and 7 have a powerful command-line console named Diskpart for carrying out a variety of disk operations. These include RAID, partition and boot management. Various features of Diskpart are described.
Diskpart is a separate suite of commands that runs in the command window in its own shell. It is opened by first entering the command "diskpart" (without quotes) and then entering one of the various sub-commands that are listed in the section below. To return to the regular command line, enter "exit". For Windows Vista and Windows 7 the command line must be opened with administrator privileges. These more recent versions of Windows contain features not available in Windows XP, as indicated in the list below. Also note that Windows XP does not allow operations on removable media whereas in Windows Vista/7, media such as USB keys can be the object of Diskpart operations. Before carrying out an operation on a particular disk, partition, or volume it must first be selected with the "list disk", "list partition", or "list volume" sub-commands followed by a "select" command. For example, the necessary sequence of commands can be represented in this schematic way for a disk operation:Open command line->open Diskpart shell->list disk->select disk->do disk operationA similar sequence would hold for a operation involving a partition or volume. Diskpart exists as a separate executable file diskpart.exe and can also be accessed through the Run line or the Vista/7 search boxes. Diskpart is a very powerful command and can easily wipe out the contents of a disk or volume so it must be used with great care. Always be sure which volume or disk you are operating on.
The list of sub-commands for Diskpart are shown below. Some commands are not available in Windows XP and they are indicates with an asterisk (*). ACTIVE - Mark the selected partition as active. *indicates a command missing from Windows XP.
This example applies to Windows Vista and Windows 7. Windows XP does not support using Diskpart on flash drives. Open a command prompt with administrator rights and enter the following sequence of commands:
In the "select disk" command, replace {number} with the drive number of your USB drive. Take care to choose the correct number since this procedure erases everything on the drive you select. The format command given above will create a FAT32 file system. This creates a bootable USB key that can be used for many purposes, once appropriate files are added. For example, it can be used to install Windows 7 (if the flash drive is large enough). . If you wish to use the USB key to actually run Windows 7 or otherwise need NTFS formatting, you will need to replace "format fs=fat32" with "format fs=ntfs" and also modify the boot sector.
Most Windows PCs sold today come with a hidden partition containing a restore function. This partition will often have no drive letter assigned and will not be visible in Windows Explorer. It may be possible to make the partition accessible by using Diskpart to assign a drive letter to the partition. However, there are limitations and according to Mivrosoft not all hidden partitions can be assigned this way. Here is the procedure. Enter the following sequence of commands:
Many of the commands also have sub-commands. For more details, see this Microsoft reference . |
|||||||
Так же в этом разделе:
|
|||||||
|
|||||||
|