Finding which partition on a particular disk is active from the command line



Finding Which Partition on a Particular Disk Is Active from the Command Line

As an IT administrator, there are times when it is important to identify which partition on a particular disk is active. This could be necessary to determine the best way to configure the system, or to troubleshoot an issue. Fortunately, it is possible to find this information from the command line using a few simple commands.

The first command to use is the ‘fdisk’ command. This command allows you to view the partition table for a particular disk. To use it, enter ‘fdisk -l /dev/sdX’, where X is the name of the disk you want to view. This command will list the partitions on the disk, along with their type, size, and whether or not they are active.

The next command to use is the ‘parted’ command. This command will give you more detailed information about the partition table. To use this command, enter ‘parted -l /dev/sdX’. This will give you a list of the partitions on the disk, along with the type, size, and whether or not they are active.

The last command to use is the ‘mount’ command. This command will tell you which partitions are currently mounted. To use this command, enter ‘mount -v’. This will give you a list of the partitions that are currently mounted, including their type, size, and whether or not they are active.

Using these three commands, you should be able to easily determine which partition on a particular disk is active. This can be very useful for configuring systems, or for troubleshooting. Keep in mind that the active partition will usually have a ‘boot’ flag set, so you can also use the ‘fdisk’ command to view the flags for each partition.

In summary, it is possible to find out which partition on a particular disk is active by using the ‘fdisk’, ‘parted’, and ‘mount’ commands. These commands will list the partitions on the disk, their type, size, and whether or not they are active. Keep in mind that the active partition usually has the ‘boot’ flag set, so you can also use ‘fdisk’ to view this flag. As an IT administrator, being able to quickly and easily identify which partition on a particular disk is active can be very useful for configuration and troubleshooting.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo