Disk Management
Microsoft Disk Management
Format a hard drive using the Command Prompt (CMD) in Windows, follow these steps:
Manually assigning a drive letter using CMD/Diskpart :-
[Localization from this article: Manuelles Zuweisen eines Laufwerksbuchstaben mit CMD bzw. Diskpart - Microsoft Community]
Technical Difficulty: Expert
Applies to: Windows 10 & 11
In some cases, Windows will not assign a drive letter automatically to an inserted drive. For example, this can happen when using a Windows installation media.
In that case, you can use diskpart to manually assign a drive letter.
NOTE: If your drive doesn't get assigned a drive letter, even though you are in a normal Windows environment, this can indicate a problem with the drive. Please back up your files in that case.
Procedure :-
Open up a command prompt (CMD/PowerShell).
Type "diskpart" to start up diskpart. You will see the prompt change to "DISKPART>".
Type "list vol" to list all available volumes. You can identify the drive by size and file system. Additionally, the volume doesn't currently have a drive letter.
Select the volume using "sel vol <number>"
Assign the drive letter using "assign letter=<letter>".
You can now exit diskpart by typing "exit" and switch to the drive using "<letter>:".
It should also be available from Windows Explorer now.
Formatting a Pendrive Using Command Prompt :-
Here's how to format a pendrive using the diskpart command in Windows Command Prompt:
- Open Command Prompt as Administrator: Right-click on the Start menu and select "Run as administrator".
- Start Diskpart: Type
diskpart and press Enter.
- List Disks: Type
list disk and press Enter to see a list of connected disks.
- Select the Pendrive: Type
select disk [disk number] and press Enter, replacing "[disk number]" with the actual number of your pendrive. You can usually identify the pendrive by its size.
- Clean the Disk: Type
clean and press Enter. This will erase all data on the disk.
- Create a Partition: Type
create partition primary and press Enter to create a primary partition.
- Select the Partition: Type
select partition 1 and press Enter.
- Format the Partition: Type
format fs=fat32 quick and press Enter. Replace "fat32" with "ntfs" if you prefer the NTFS file system. The "quick" format is faster but might not completely erase all data.
Example:
diskpart
list disk
select disk 1
clean
create partition primary
select partition 1
format fs=fat32 quick
Important Note:
- Data Loss: Formatting a disk will erase all data on it. Make sure you have backed up any important data before proceeding.
- Disk Number: Double-check the disk number to ensure you're formatting the correct drive.
- File System: Choose the file system that is compatible with your operating system and devices. FAT32 is generally compatible with most devices, while NTFS offers larger file size support.
Manually : Assign Drive Letter "Z" (DISKPART)
Open Command Prompt as Administrator:
- Press
Win + Xand select Command Prompt (Admin) or Windows Terminal (Admin).Start Diskpart:
- Type
diskpartand press Enter.List Volumes:
- Type
list volumeand press Enter. This shows all available volumes.Select the Volume:
- Identify the volume you want to assign "Z" to, then type
select volume X(replaceXwith the volume number).Assign Drive Letter "Z":
- Type
assign letter=Zand press Enter.You’ve now assigned drive letter Z to the selected volume.
Manually: Remove Drive Letter "Z" (DISK PART)
Open Diskpart (if it’s not already open):
- If you exited Diskpart after assigning the drive letter, type
diskpartin Command Prompt and press Enter.List Volumes:
- Type
list volumeand press Enter again to view the volumes.Select the Volume with Drive Letter "Z":
- Type
select volume X(replaceXwith the volume number associated with drive letter "Z").Remove Drive Letter "Z":
- Type
remove letter=Zand press Enter.Exit Diskpart:
- Type
exitto close Diskpart.The drive letter "Z" is now removed from the volume.
shrink a disk volume using Command Prompt (CMD):
- Open Command Prompt as Administrator:
- Right-click Start menu
- Select "Windows PowerShell (Admin)" or "Command Prompt (Admin)"
- Start DiskPart:
diskpart- List all volumes:
list volume- Select the volume you want to shrink:
select volume X (replace X with your volume number)- Check available space:
detail volumeImportant Notes:
- Make sure to backup important data before proceeding
- Cannot shrink beyond point of immovable files
- System files might prevent maximum shrinking
- Use 'querymax' to see maximum possible shrink size:
shrink querymax- Shrink the volume:
For example, to shrink by 10GB:shrink desired=X (replace X with size in MB you want to shrink)shrink desired=10000EXIT
Creating a Bootable Media (OS Installation Pendrive ) :-You can create a bootable USB drive using a Windows 11 ISO file without any third-party apps by using the built-in Command Prompt and DiskPart utility in Windows. Here's how:
Step 1: Prepare the USB Drive
Insert a USB Drive:
- Ensure the USB drive has at least 8GB of free space.
- Backup your data from the USB drive, as this process will erase all data on it.
Open DiskPart:
- Press
Win + S, typecmd, right-click Command Prompt, and select Run as Administrator.- In the Command Prompt, type
diskpartand press Enter.Select the USB Drive:
Type the following commands step-by-step:
list diskIdentify the disk number of your USB drive (e.g., Disk 1).
select disk X(Replace
Xwith the USB disk number.)Clean and Format the USB Drive:
- Type the following commands:
clean create partition primary select partition 1 active format fs=ntfs quick assign exitYour USB drive is now ready.
Step 2: Mount the Windows 11 ISO
Mount the ISO:
- Locate your Windows 11 ISO file, right-click it, and select Mount.
- A new virtual drive will appear in File Explorer (e.g.,
D:).Note the Drive Letters:
- Note the virtual drive letter of the mounted ISO (e.g.,
D:).- Note the drive letter of your USB drive (e.g.,
E:).Step 3: Copy Windows Files to USB
In the Command Prompt (still with Administrator privileges), type:
xcopy D:\* E:\ /E /F /H(Replace
D:with the ISO drive letter andE:with the USB drive letter.)This will copy all Windows 11 installation files to the USB drive.
Step 4: Make the USB Bootable
The USB is bootable as long as the copied ISO contains the bootloader. Once the files are copied, you can use the USB to boot into the Windows 11 installer.
Step 5: Test the Bootable USB
- Restart your computer.
- Enter the BIOS/UEFI (usually by pressing F2, Del, or F12 during startup).
- Set the USB drive as the primary boot device.
- Save changes and exit. Your system should boot into the Windows 11 installer.
Comments
Post a Comment