Published on

linux addpart: Tell the kernel about the existence of the specified partition



2 min read

Linux addpart is a useful command that allows you to inform the kernel about the existence of a specific partition. By using this command, you can easily add a new partition to your Linux system. This article will guide you through the process of using addpart and provide you with a clear understanding of its functionality.

To use the addpart command, open your terminal and enter the following syntax:

sudo addpart [device] [partition number] [start sector] [end sector]

Let's break down the command and understand each parameter:

  • sudo is used to run the command as the superuser, granting you the necessary permissions to make changes to the system.
  • addpart is the command itself, followed by the device name, which refers to the specific disk you want to add the partition to.
  • The partition number indicates the number you want to assign to the new partition.
  • The start sector and end sector define the boundaries of the partition within the disk.

For example, to add a new partition named "sdb1" to the disk "sdb" starting from sector 2048 and ending at sector 4096, you would use the following command:

sudo addpart /dev/sdb 1 2048 4096

Once you execute the command, the kernel will be informed about the existence of the new partition. You can then proceed with formatting and mounting the partition to start using it.

It's important to note that adding a new partition may affect the existing data on the disk. Therefore, it's crucial to backup any important information before making any changes to your system.

In summary, the addpart command in Linux is a powerful tool that allows you to add a new partition to your system. By using this command, you can easily inform the kernel about the new partition's existence and continue using it for your storage needs.

So, go ahead and give the addpart command a try. It's a simple yet effective way to expand your disk space and improve the functionality of your Linux system.