Access Disk Partitions
Be very careful. Always double-check the disk/partition. A wrong choice can wipe your OS.
Windows
Example - Access EFI Partition & Delete Boot Loader Entry
Goal: Temporarily mount the EFI/system partition, delete a boot folder, then restore things.
1. Open disk tool
- Open Command Prompt as Administrator.
- Start disk tool:
diskpart
2. Select the correct disk and volume
- List all disks:
list disk
- Select the disk (example: disk 0):
sel disk 0
- List volumes on that disk:
list vol
- Select the system/EFI volume (example: volume 1):
sel vol 1
3. Assign a drive letter to EFI partition
- Assign a temporary letter (example:
N):
assign letter=N
Now the EFI partition is accessible as
N:in Explorer / terminal.
4. Delete unwanted boot loader folder
- Exit disk tool (stay in admin terminal):
exit
- Go to the EFI partition:
N:
dir # or: ls
- Enter EFI directory:
cd EFI
dir
- Delete the folder you don’t want in the boot menu:
rmdir Folder_Name
5. Cleanup: remove letter (and optional destructive actions)
- Reopen
diskpartand select the same disk & volume again:
diskpart
sel disk 0
sel vol 1
- Remove the drive letter so it goes back to hidden system state:
remove letter=N
Optional (destructive) operations on the selected volume
- Delete the whole volume (even if protected):
delete volume override
- Format the volume (choose one filesystem):
format fs=NTFS
or
format fs=FAT32
Linux
Format a Disk & Merge/Delete All Partitions
Goal: Wipe a disk, create one new partition, format it, and mount it.
Only do this on a data disk, never on your OS disk. Double-check device names.
1. Identify the target disk
- List disks and partitions:
lsblk
# or
sudo fdisk -l
- Choose your target disk, e.g.
/dev/sdb.
- Do not touch
/dev/sdaif that’s your OS drive.
2. Unmount all partitions on that disk
- For each mounted partition (examples):
sudo umount /dev/sdX1
sudo umount /dev/sdX2
sudo umount /dev/sdX3
Replace sdX1, sdX2, … with real names like sdb1, sdb2.
3. Delete all partitions and create a new one (fdisk)
- Open
fdiskon the disk:
sudo fdisk /dev/sdX
# example: sudo fdisk /dev/sdb
- Inside
fdisk(interactive):
d→ delete a partition (repeat until no partitions left)g→ create new GPT partition tablen→ create new partition- Press
Enterfor default partition number - Press
Enterfor default first sector - Press
Enterfor default last sector (use full disk)
- Press
w→ write changes and exit
Now you have one new partition, e.g. /dev/sdX1 (/dev/sdb1).
4. Format the new partition
- Create an ext4 filesystem and label it (optional label
mydisk):
sudo mkfs.ext4 /dev/sdX1 -L mydisk
# example: sudo mkfs.ext4 /dev/sdb1 -L mydisk
5. Mount the partition
- Create a mount point and mount it:
sudo mkdir -p /mnt/mydisk
sudo mount /dev/sdX1 /mnt/mydisk
# example: sudo mount /dev/sdb1 /mnt/mydisk
Now the new disk is available at /mnt/mydisk.