How to Set a Partition As Active on Linux

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.
You can mark any partition as bootable using Linux utilities.

Each computer storage device is divided into non-overlapping partitions. Different partitions can contain data, or code, for totally separate operating systems on the same computer. The computer keeps persistent data about the characteristics of all partitions (e.g., their beginning and end addresses) on a special, reserved part of each storage device. That data includes the "bootable" flag; a partition needs to have this flag set to be active, that is, for its contents to be bootable. You can set a partition as active using built-in Linux commands.

Advertisement

Step 1

Log in to the Linux computer.

Video of the Day

Step 2

Launch a command shell by clicking on the "Terminal" icon on the graphical desktop.

Step 3

Elevate the shell's privileges. The specific way of performing this step depends on the Linux distribution. For instance, for Ubuntu, type the following command into the shell:

Advertisement

sudo -i

Press "Enter." Linux will prompt you for your password; enter it.

Step 4

Type the following command into the shell:

Advertisement

fdisk /dev/hdb

Advertisement

Replace "/dev/hdb" with the Linux name of the device where the partition is contained.

Step 5

Type "a" into the active "fdisk" prompt, then press "Enter." fdisk will prompt you for the number of the partition whose bootable flag you want to set; enter it, then press "Enter."

Advertisement

Step 6

Type "w" and press "Enter." fdisk will save your modification to the partition table and exit. At that point, your partition will have been marked as active.

Video of the Day

Advertisement

Advertisement

references

Report an Issue

screenshot of the current page

Screenshot loading...