w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
/proc/partitions major and minor numbers to detect physical disk and partitions

It looks like you don't differentiate well between the primary and secondary partitions:

Partitions generally can be of type primary (maximum four), extended (maximum one) or logical (contained within the extended partition). Each partition has a type field that contains a code. This determines the computers operating system or the partitions file system.

Primary (max 4) 1-4, Extended (max 1) 1-4, Logical 5-

When it comes to the partitions naming, you usually see that hard disk devices are named /dev/hdx or /dev/sdx with x depending on the hardware configuration.

The partition number, starting the count at 1. Hence the four (possible) primary partitions are numbered 1 to 4. Logical partition counting always starts at 5. Thus /dev/hda2 is the second partition on the first ATA hard disk device, and /dev/hdb5 is the first logical partition on the second ATA hard disk device. Same for SCSI, /dev/sdb3 is the third partition on the second SCSI disk.

For you to create new partitions on disks, fdisk shall always be your friend and you just add the space starting from the last taken block, where you can always check them either through fdisk -l, or #cat /proc/partitions

If you can't create devices using fdisk or parted tools, just mentioned it?!

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.