Skip to content
/ palign Public

[mirror] check optimal hard drive partition alignment by "logical sector size" and "physical sector size" using "bash"

License

Notifications You must be signed in to change notification settings

keks24/palign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

palign checks, if hard drive partitions are aligned optimally by logical block size and physical block size using bash.

Prerequisites

  • The path /usr/local/bin/ exists in the ${PATH} variable:
$ echo "${PATH//:/\n}"
/home/ramon/bin
/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin
/usr/local/games
/usr/games
/usr/lib/llvm/6/bin
/opt/bin
  • sysfs is configured properly
    • /sys/block/<some_device_name>/queue/ and /sys/block/<some_device_name>/<some_device_partition_name>/ are accessable

Installation

Clone the repository into your current working directory:

$ git clone "https://codeberg.org/keks24/palign.git"

Copy all necessary files:

$ cd "palign/"
$ cp "usr/local/bin/palign" "/usr/local/bin/"
$ chmod 755 "/usr/local/bin/palign"

Usage

$ palign [device_name...]

Examples

$ palign
/dev/sda:
    /dev/sda1
        Start sector size (2048 Sectors, 1048576 Byte)
            Divided by 'Logical block size' (512 Byte):         4.000000 Sectors        Partition alignment optimal.
            Divided by 'Physical block size' (4096 Byte):       0.000000 Sectors        Partition not aligned!
$ palign sda sdb sdc sdd
/dev/sda:
    /dev/sda1
        Start sector size (2048 Sectors, 1048576 Byte)
            Divided by 'Logical block size' (512 Byte):         4.000000 Sectors        Partition alignment optimal.
            Divided by 'Physical block size' (4096 Byte):       0.000000 Sectors        Partition not aligned!

/dev/sdb:
    /dev/sdb1
        Start sector size (2048 Sectors, 1048576 Byte)
            Divided by 'Logical block size' (512 Byte):         4.000000 Sectors        Partition alignment optimal.
            Divided by 'Physical block size' (512 Byte):        4.000000 Sectors        Partition alignment optimal.
    /dev/sdb2
        Start sector size (20973568 Sectors, 10738466816 Byte)
            Divided by 'Logical block size' (512 Byte):         40964.000000 Sectors    Partition alignment optimal.
            Divided by 'Physical block size' (512 Byte):        40964.000000 Sectors    Partition alignment optimal.

/dev/sdc:
    /dev/sdc1
        Start sector size (2048 Sectors, 1048576 Byte)
            Divided by 'Logical block size' (512 Byte):         4.000000 Sectors        Partition alignment optimal.
            Divided by 'Physical block size' (512 Byte):        4.000000 Sectors        Partition alignment optimal.
    /dev/sdc2
        Start sector size (6144 Sectors, 3145728 Byte)
            Divided by 'Logical block size' (512 Byte):         12.000000 Sectors       Partition alignment optimal.
            Divided by 'Physical block size' (512 Byte):        12.000000 Sectors       Partition alignment optimal.
    /dev/sdc3
        Start sector size (268288 Sectors, 137363456 Byte)
            Divided by 'Logical block size' (512 Byte):         524.000000 Sectors      Partition alignment optimal.
            Divided by 'Physical block size' (512 Byte):        524.000000 Sectors      Partition alignment optimal.

/dev/sdd:
    /dev/sdd1
        Start sector size (40 Sectors, 20480 Byte)
            Divided by 'Logical block size' (512 Byte):         0.000000 Sectors        Partition not aligned!
            Divided by 'Physical block size' (512 Byte):        0.000000 Sectors        Partition not aligned!

Parameters

Multiple device names can be analysed.

About

[mirror] check optimal hard drive partition alignment by "logical sector size" and "physical sector size" using "bash"

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages