Use to disk how to
Use to disk how to
10 fdisk Commands to Manage Linux Disk Partitions
fdisk stands (for “fixed disk or format disk“) is an most commonly used command-line based disk manipulation utility for a Linux/Unix systems. With the help of fdisk command you can view, create, resize, delete, change, copy and move partitions on a hard drive using its own user friendly text based menu driven interface.
This tool is very useful in terms of creating space for new partitions, organising space for new drives, re-organising an old drives and copying or moving data to new disks. It allows you to create a maximum of four new primary partition and number of logical (extended) partitions, based on size of the hard disk you have in your system.
fdisk command to manage disk partition
This article explains 10 basic fdisk commands to manage a partition table in Linux based systems. You must be root user to run fdisk command, otherwise you will get a “command not found” error.
1. View all Disk Partitions in Linux
The following basic command list all existing disk partition on your system. The ‘-l‘ argument stand for (listing all partitions) is used with fdisk command to view all available partitions on Linux. The partitions are displayed by their device’s names. For example: /dev/sda, /dev/sdb or /dev/sdc.
2. View Specific Disk Partition in Linux
To view all partitions of specific hard disk use the option ‘-l‘ with device name. For example, the following command will display all disk partitions of device /dev/sda. If you’ve different device names, simple write device name as /dev/sdb or /dev/sdc.
3. Check all Available fdisk Commands
If you would like to view all commands which are available for fdisk. Simply use the following command by mentioning the hard disk name such as /dev/sda as shown below. The following command will give you output similar to below.
Type ‘m‘ to see the list of all available commands of fdisk which can be operated on /dev/sda hard disk. After, I enter ‘m‘ on the screen, you will see the all available options for fdisk that you can be used on the /dev/sda device.
4. Print all Partition Table in Linux
To print all partition table of hard disk, you must be on command mode of specific hard disk say /dev/sda.
From the command mode, enter ‘p‘ instead of ‘m‘ as we did earlier. As I enter ‘p‘, it will print the specific /dev/sda partition table.
5. How to Delete a Partition in Linux
If you would like to delete a specific partition (i.e /dev/sda9) from the specific hard disk such as /dev/sda. You must be in fdisk command mode to do this.
Next, enter ‘d‘ to delete any given partition name from the system. As I enter ‘d‘, it will prompt me to enter partition number that I want to delete from /dev/sda hard disk. Suppose I enter number ‘4‘ here, then it will delete partition number ‘4‘ (i.e. /dev/sda4) disk and shows free space in partition table. Enter ‘w‘ to write table to disk and exit after making new alterations to partition table. The new changes would only take place after next reboot of system. This can be easily understood from the below output.
Warning : Be careful, while performing this step, because using option ‘d‘ will completely delete partition from system and may lost all data in partition.
6. How to Create a New Partition in Linux
If you’ve free space left on one of your device say /dev/sda and would like to create a new partition under it. Then you must be in fdisk command mode of /dev/sda. Type the following command to enter into command mode of specific hard disk.
After entering in command mode, now press “n” command to create a new partition under /dev/sda with specific size. This can be demonstrated with the help of following given output.
While creating a new partition, it will ask you two options ‘extended‘ or ‘primary‘ partition creation. Press ‘e‘ for extended partition and ‘p‘ for primary partition. Then it will ask you to enter following two inputs.
You can enter the size of cylinder by adding “+5000M” in last cylinder. Here, ‘+‘ means addition and 5000M means size of new partition (i.e 5000MB). Please keep in mind that after creating a new partition, you should run ‘w‘ command to alter and save new changes to partition table and finally reboot your system to verify newly created partition.
7. How to Format a Partition in Linux
After the new partition is created, don’t skip to format the newly created partition using ‘mkfs‘ command. Type the following command in the terminal to format a partition. Here /dev/sda4 is my newly created partition.
8. How to Check Size of a Partition in Linux
After formatting new partition, check the size of that partition using flag ‘s‘ (displays size in blocks) with fdisk command. This way you can check size of any specific device.
9. How to Fix Partition Table Order
If you’ve deleted a logical partition and again recreated it, you might notice ‘partition out of order‘ problem or error message like ‘Partition table entries are not in disk order‘.
For example, when three logical partitions such as (sda4, sda5 and sda6) are deleted, and new partition created, you might expect the new partition name would be sda4. But, the system would create it as sda5. This happens because of, after the partition are deleted, sda7 partition had been moved as sda4 and free space shift to the end.
To fix such partition order problems, and assign sda4 to the newly created partition, issue the ‘x‘ to enter an extra functionality section and then enter ‘f‘ expert command to fix the order of partition table as shown below.
After, running ‘f‘ command, don’t forget to run ‘w‘ command to save and exit from fdisk command mode. Once it fixed partition table order, you will no longer get error messages.
10. How to Disable Boot Flag (*) of a Partition
By default, fdisk command shows the boot flag (i.e. ‘*‘) symbol on each partition. If you want to enable or disable boot flag on a specific partition, do the following steps.
Press ‘p‘ command to view the current partition table, you see there is a boot flag (asterisk (*) symbol in orange color) on /dev/sda1 disk as shown below.
Next enter command ‘a‘ to disable boot flag, then enter partition number ‘1‘ as (i.e. /dev/sda1) in my case. This will disable boot flag on the partition /dev/sda1. This will remove the asterisk (*) flag.
I’ve tried my best to include almost all basic commands of fdisk commands, but still fdisk contains a variety of other expert commands you can use them by entering ‘x‘. For more detailed information, check out ‘man fdisk‘ command from the terminal. If I’ve missed any important command, please do share with me via comment section.
Read Also :
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
How to Open Disk Management in Windows 11, 10, 8, 7, XP or Vista [4 Ways]?
If you have no idea how to open Disk Management in Windows 10/8/7 PC system, have a look of this article. There are several ways that you can choose.
By Michael / Last Updated March 15, 2022
What is Disk Management?
Disk Management is a Microsoft Windows utility first introduced in Windows XP as a replacement for the fdisk command. It enables you to view and manage hard disks that installed in the computer as well as the partitions associated with those drives. You can initialize disks, create volumes, format volumes as FAT32 or NTFS file systems, etc with this tool. Many people must be familiar with the earlier version of Disk Management. Anyway, some new features are added since the appearance of Windows 7.
в–Є Extend and shrink volumes: Shrink a volume to get some unallocated space that can be used to create or extend another one.
в–Є Simpler partition creation: You’re able to choose whether to create a basic, spanned, or striped partition directly.
в–Є Convert disk: If you add more than 4 partitions to a basic disk, it will prompt you to convert the disk to dynamic or GPT (GUID partition table) style.
How to: open Disk Management in Windows 11, 10, 8, 7, XP, or Vista
There’s no shortcut to Disk Management in the Windows start menu or on the desktop because it’s not a program in the same sense as most other software. So here will display several ways to open Disk Management in Windows PC systems.
Way 1. Through Computer Management
Step 1. Right-click Computer →Manage.
Step 2. Choose Disk Management on the left.
Way 2. Via Run
Step 1: Press Windows+ R.
Step 2: Type diskmgmt.msc → OK.
Way 3. By Command Prompt
Step 1. Click Start menu → input cmd in the search box → Enter.
Step 2. Type diskmgmt → Enter.
Way 4. From Control Panel
Step 1. Click Start menu → Control Panel.
Step 2. Select System and Security.
Note: “System and Security” is only found in Windows 10/8/7. In Windows Vista, it’s called System and Maintenance while Performance and Maintenance in Windows XP.
Step 3. Under Administrative Tools, click the option as shown below. That’s it!
By the way, if you’re using Windows 10 or Windows 8, just right-click the Start button then choose Disk Management option to open the same. Generally, among these methods, there should be at least one that suits you.
A better disk management tool
As extending and shrinking volumes are often used, many users may find these two options greyed out in Disk Management sometimes. Why? Actually, some limitations exist in Windows built-in Disk Management. For example, if you increase the size of a partition, you can only use the unallocated space next to it and just on the right side. But the feature «Shrink Volume» always makes the unallocated space locates behind the volume you shrink. Therefore, in many cases, you have to delete a partition before you can extend one. What’s worse, you can’t shrink a volume beyond the point where any unmovable files are located. Thus, it seems that you need to hire a better disk management tool.
AOMEI Partition Assistant Standard is a free disk partition management software that comes with a lot of powerful functions that enable you to control hard disks and partitions easily.
With the concise main interface, it’s convenient for you to view statues of every partition. Many utilities like Resize Partition, Merge Partitions, etc break the limitations that Windows built-in Disk Management has. Besides, most operations can be completed simply by a few clicks without losing data! You can free download it to have a tryпјЃ
Disk Management
Everything you need to know about this Windows tool
In This Article
Jump to a Section
Disk Management is an extension of the Microsoft Management Console that allows full management of the disk-based hardware recognized by Windows.
It’s used to manage the drives installed in a computer—like hard disk drives (internal and external), optical disk drives, and flash drives. It can be used to partition and format drives, assign drive letters, and much more.
Disk Management is sometimes spelling incorrectly as Disc Management. Also, even though they might sound similar, it’s not the same as Device Manager.
Disk Management Availability
Disk Management is available in most versions of Microsoft Windows including Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and Windows 2000.
Even though it’s available in all of these operating systems, some small differences in the utility do exist from one Windows version to the next.
How to Open Disk Management
The most common way to access Disk Management is via the Computer Management utility, which you can get to from Administrative Tools in the Control Panel.
It can also be started by executing diskmgmt.msc via the Command Prompt or another command-line interface in Windows.
How to Use Disk Management
Disk Management has two main sections—a top and a bottom:
The panes and menus you see are customizable, so if you’ve ever changed the settings, the above might not be exactly how the program looks to you. For example, you can change the top pane to be the graphical representation and disable the bottom pane entirely. Use the View menu to change where the panes are displayed.
Performing certain actions on the drives or partitions make them available or unavailable to Windows and configure them to be used by Windows in certain ways.
Here are some common things that you can do in Disk Management:
More Information
The Disk Management tool has a graphical interface like a regular program and is similar in function to the command line utility diskpart, which was a replacement of an earlier utility called fdisk.
You can also use Disk Management to check free hard drive space. Look under the Capacity and Free Space columns (in the Disk List or Volume List view) to see the total storage capacity of all the disks as well as how much free space is remaining, which is expressed in units (i.e., MB and GB) as well as a percentage.
Disk Management is where you can create and attach virtual hard disk files in Windows 11, 10, and 8. These are single files that act as hard drives, which means you can store them on your main hard drive or in other places like external hard drives. To build a virtual disk file with the VHD or VHDX file extension, use the Action > Create VHD menu. Opening one is done through the Attach VHD option.
The View menu is how you can change which panes you see at the top and bottom and how you change the colors and patterns Disk Management uses to display unallocated space, free space, logical drives, spanned volumes, RAID-5 volumes, and other disk regions.
Alternatives to Disk Management
Some free disk partitioning tools let you perform most of the same tasks supported in Disk Management but without even needing to open Microsoft’s tool at all. Plus, some of them are even easier to use.
MiniTool Partition Wizard Free, for instance, lets you make a bunch of changes to your disks to see how they’ll affect the sizes, etc., and then you can apply all the changes at once after you’re satisfied.
Something else you can do with that program is wipe a partition or whole disk clean with DoD 5220.22-M, which is a data sanitization method not supported with Disk Management.
[Free Guide]: Use Diskpart Assign Drive Letter in Windows 11, 10, 8, 7
This post will show you how to use Diskpart assign drive letter in Windows 11, 10, 8, 7. In addition, another free GUI software will be introduced to assign or remove the drive letters.
By Cherry / Last Updated April 2, 2022
Why use Diskpart assign drive letter?
As we all know, Windows assigns drive letters to all available drives on your computer, such as internal hard drives, optical drives, SD cards, and external USB drives. A drive letter is an alphabetical identifier for a volume, and each drive letter can be used once on a computer.
But sometimes, users want to change the original drive letter to another drive letter. Or due to some operation, the drive letter will not be available and the user needs to assign a new drive letter. So a computer-experienced user might assign drive letter by Diskpart, as this is the faster way. The purpose of this article is to provide you with some methods for assigning a drive letter, including Diskpart, Disk Management, and another easier way.
Step-by-step: Assign drive letter by Windows built-in tools
The Disk Management tool in Windows provides you with an easy-to-use graphical interface to manage your disks with a single mouse click. And Diskpart is a command-line tool that allows you to quickly manage your disks or partitions from the command prompt. The next section will show you how to use Disk Management and Diskpart to assign drive letters.
в”‚ Use Diskpart to assign drive letter
Diskpart is a Windows built-in tool that you can use to manage your hard drive, like format disk partition, create partition, delete partition, etc. Well, how to use Command Prompt Diskpart assign drive letter? The following parts may help you a lot.
Step 1. Press «Windows + R». Then, type «diskpart» and press Enter.
Step 2. Type in «list volume» and press Enter. Now, you can see all volumes on PC.
Step 3. Type in «select volume 7» and press Enter(here take volume 7 as an example).
Step 4. Finally, type in“assign letter=F” and press Enter.
If you want to remove the drive letter, type “remove letter=X”(X is the drive letter you want to remove).
Actually, you may assign a drive letter when you create a new one. For that, you need to create partition first. After creating a partition, type “assign letter=?” to that partition. Or, if there is some volume hidden, it will not have the drive letter, to unhide it, you need to assign a drive letter for it.
в”‚ Assign drive letter via Disk Management
In addition to Diskpart, Disk Management may be another good choice to assign drive letter.
Step 1. Press “Win + R” to open the “Run” window and type diskmgmt.msc in the box.
Step 2. Right-click the drive you want to assign, and select change Drive Letter and Paths in the pop-up window.
Step 3. Click Change to summon the next window.
Notice: If you want to remove the drive letter of your partition, you can select «Remove» and follow the instructions step by step.
Step 4. After that, you should choose the new drive letter from the drop list, and then, click OK.
Now, do you understand how to use Disk Management and Diskpart assign drive letter?
Although it’s convenient for most people, you need to be aware that sometimes you can’t assign drive letter successfully, because Disk Management and Diskpart only support assigning drive letter with FAT or NTFS. When the drive’s file system is another type, you can format it to NTFS or FAT, or use another method to assign a drive letter.
Diskpart assign drive letter alternative
Disk Management and Diskpart are not perfect because they have limitations. Fortunately, there is an easier way to make up for their shortcomings perfectly.
AOMEI Partition Assistant Standard is a completely free third-party partition manager. It supports users to assign drive letters through a more friendly interface, which can be done with just a few clicks, much simpler than Diskpart. Also, it can assign drive letter on any file system. More importantly, it has more complete functions and allows you to manage disks flexibly.
>Launch AOMEI Partition Assistant, it will show you all storage devices in the main interface. you can see the removable drive doesn’t have a drive letter. If you want to assign a drive letter for the drive, here you need to right click it, select Advanced-> Change Drive Letter.
>Then, select a drive letter for the drive.
>Click Apply to submit the task.
Conclusion
Now, do you know how to use Diskpart assign drive letter? If you are the user who has computer background, Diskpart may be the quickest method to assign the drive letter. However, if you are normal user, AOMEI Partition Assistant Standard is the correct choice. After you upgrade to AOMEI Partition Assistant Professional, there are more advanced features you can try, such as Allocate free space from one drive to C, Move installed app from one drive to another.
Last but not least, although the system drive letter can be changed, do not do it because that would make the system unable to boot.
How to Partition a Hard Drive (Windows 11, 10, 8, 7, +)
Hard drives must be partitioned before being formatted in Windows
What to Know
This article describes how to partition a hard drive in Windows 11, 10, 8, 7, Vista, and XP.
What Is Partitioning?
To partition a hard drive in Windows means to section off a part of it and make that part available to the operating system.
In other words, a hard drive isn’t useful to your operating system until it’s partitioned. Additionally, it’s not available to you to store files on until you format it (which is another, just as simple process).
Most of the time, this «part» of the hard drive is the entire usable space, but creating multiple partitions on a hard drive is also possible so that you can store backup files in one partition, movies in another, etc.
Manually partitioning (as well as formatting) a hard drive is not necessary if your end goal is to clean install Windows onto the drive. Both of those processes are included as part of the installation procedure, meaning you don’t need to prepare the drive yourself.
How to Partition a Hard Drive in Windows
Don’t worry if this process sounds a bit more complicated than you thought because it’s not. Partitioning a hard drive in Windows isn’t at all hard and usually only takes a few minutes to do.
Here’s how to do it:
These instructions apply to Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.
Open Disk Management, the tool included in all versions of Windows that lets you partition drives, among a number of other things.
In Windows 11/10/8/8.1, the Power User Menu is the easiest way to start Disk Management. You can also open Disk Management via command prompt in any version of Windows, but the Computer Management method is probably best for most people. Check which version of Windows is installed on your computer if you’re not sure.
When Disk Management opens, you should see an Initialize Disk window with the message «You must initialize a disk before Logical Disk Manager can access it.»
In Windows XP, you’ll see an Initialize and Convert Disk Wizard screen instead. Follow that wizard, making sure to not select the option to «convert» the disk, unless you’re sure you need to. Skip to Step 4 when done.
Don’t worry if this window doesn’t appear. There are legitimate reasons you may not see it—we’ll know soon if there’s a problem or not. Skip down to Step 4 if you don’t see this.
On this screen, you’re asked to choose a partition style for the new hard drive. Choose GPT if the new hard drive you installed is 2 TB or larger. Choose MBR if it’s smaller than 2 TB.
Choose OK after making your selection.
Locate the hard drive you want to partition from the drive map at the bottom of the Disk Management window.
You might need to maximize the Disk Management or Computer Management window to see all the drives on the bottom. An unpartitioned drive will not show up in the drive list at the top of the window.
If the hard drive is new, it will probably be on a dedicated row labeled Disk 1 (or 2, etc.) and will say Unallocated. If the space you want to partition is part of an existing drive, you’ll see Unallocated next to existing partitions on that drive.
If you don’t see the drive you want to partition, you may have installed it incorrectly. Turn off your computer and double-check that the hard drive is properly installed.
Once you’ve found the space you want to partition, tap-and-hold or right-click anywhere on it, and choose New Simple Volume.
In Windows XP, the option is called New Partition.
Choose Next > on the New Simple Volume Wizard window that appeared.
In Windows XP, a Select Partition Type screen appears next, where you should choose Primary partition. The Extended partition option is useful only if you’re creating five or more partitions on a single physical hard drive. Select Next > after making the selection.
Choose Next > on the Specify Volume Size step to confirm the size of the drive you’re creating.
The default size that you see in the Simple volume size in MB: field should equal the amount shown in the Maximum disk space in MB: field. This means that you’re creating a partition that equals the total available space on the physical hard drive.
You’re welcome to create multiple partitions, that will eventually become multiple, independent drives in Windows. To do so, calculate how many and how large you want those drives to be and repeat these steps to create those partitions. For example, if the drive is 61437 MB and you want to partitions, specify an initial size of 30718 to partition only half the drive, and then repeat the partitioning again for the rest of the Unallocated space.
Select Next > on the Assign Drive Letter or Path step, assuming the default drive letter you see is OK with you.
Windows automatically assigns the first available drive letter, skipping A & B, which on most computers will be D or E. You’re welcome to set the Assign the following drive letter option to anything that’s available.
You’re also welcome to change the hard drive letter later on if you want.
Choose Do not format this volume on the Format Partition step, and then select Next >.
If you know what you’re doing, feel free to format the drive as part of this process. However, since this tutorial focuses on partitioning a hard drive in Windows, we’ve left the formatting to another tutorial, linked in the last step below.
Verify your choices on the Completing the New Simple Volume Wizard screen, which should look something like this:
Because your computer and hard drive are unlikely exactly like mine, expect your Disk selected, Volume size, and Drive letter or path values to be different than what you see here. File system: None just means that you’ve decided not to also format the drive right now.
Choose Finish and Windows will partition the drive, a process that will only take a few seconds on most computers.
You might notice that your cursor is busy during this time. Once you see the new drive letter (F: in our example) appear in the listing at the top of Disk Management, then you know the partitioning process is complete.
Next, Windows will try to open the new drive automatically. However, since it’s not yet formatted and can’t be used, you’ll see this message instead: «You need to format the disk in drive F: before you can use it. Do you want to format it?»
This only happens in Windows 11, 10, 8, and 7. You won’t see this in Windows Vista or Windows XP and that’s perfectly fine. Just skip to the last step below if you’re using one of those versions of Windows.
Select Cancel. Or, if you know how to format a hard drive in Windows, feel free to choose Format disk instead. If you don’t, consult a tutorial first before attempting it.
Advanced Partitioning
Windows doesn’t allow for anything but very basic partition management after you create one, but a number of free disk partition management software programs exist that can help if you need them.
In Disk Management, select the partition you want to remove. Right-click on that partition and select Delete Volume. Select Yes to confirm that all data will be lost.
Go to Applications > Utilities > Disk Utility. Select the partition to remove and click Erase. Confirm the deletion by selecting Erase, then select Done.