title: Why fdisk and lsblk show different partition size?
body: <p>If we see the size of sdb2 is 39.5GB in fdisk whereas 1k in the lsblk output. What can be the reason for this?</p>
  <pre><code>Disk /dev/sdb: 300 GiB, 322122547200 bytes, 629145600 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0x674589c1
  
  Device     Boot   Start      End  Sectors  Size Id Type
  /dev/sdb1  *       2048   999423   997376  487M 83 Linux
  /dev/sdb2       1001470 83884031 82882562 39.5G  5 Extended
  /dev/sdb5       1001472 83884031 82882560 39.5G 8e Linux LVM
  
  
  root@ubuntu1604:~# lsblk
  NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  fd0                         2:0    1    4K  0 disk
  sda                         8:0    0  300G  0 disk
  sdb                         8:16   0  300G  0 disk
  ├─sdb1                      8:17   0  487M  0 part /boot
  ├─sdb2                      8:18   0    1K  0 part
  └─sdb5                      8:21   0 39.5G  0 part
    ├─ubuntu1604--vg-root   252:0    0 35.5G  0 lvm  /
    └─ubuntu1604--vg-swap_1 252:1    0    4G  0 lvm  [SWAP]
  sr0                        11:0    1 1024M  0 rom
  root@ubuntu1604:~#
  </code></pre>