What are Logical block size and Physical block size and How to find it ?

In simple words, logical block size is the unit used by the  ‘kernel’ for read/write operations.. Physical block sizes are the ones which ‘disk controllers’ use for read/write operations.

Is there any way to display logical/ physical block sizes in your system?

Yep, there are:

1) Fetch this information from the ‘sysfs’:

‘sda’ is the example device

[terminal]
[root@humbles-lap ]# cat /sys/block/sda/queue/logical_block_size
512
[root@humbles-lap ]# cat /sys/block/sda/queue/physical_block_size
512
[root@humbles-lap ]#

[/terminal]

2) Use ‘blockdev’ command to display the same information.

[terminal]
[root@humbles-lap ]# rpm -qf `which blockdev`
util-linux-XXXX
[root@humbles-lap ]#

–getss get logical block (sector) size
–getpbsz get physical block (sector) size

[root@humbles-lap ]# blockdev –getss /dev/sda
512
[root@humbles-lap ]# blockdev –getpbsz /dev/sda
512
[root@humbles-lap ]#

[/terminal]

Physical Volume label contains UUID, LABELONE string..etc in it..

LVM tools scans first 2048 bytes of physical volume to get physical volume label. Physical volume label starts with a string called “LABELONE” , also it contains physical volume UUID ..etc information in this region.. I took copy of this area and read it : 0000000000  |…………….| 0000000016  |…………….| 0000000032  |…………….| 0000000048  |…………….| 0000000432  |…………….| …

Read more

Why we fear when we hear about LVM metadata ?

It is very common that, people get scared as soon as they hear about LVM metadata.. I really dont know the reason, but I believe it is mainly because they think ‘metadata’ is not in human readable form ? , could be.. Any way, first of all let me tell you that, LVM metadata is …

Read more