A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.

August 12, 2018

17.4.a Disk Geometry I - example syntax incorrect.

The lead-in to the example state the screenshot will show how we can view the geomtery with fdisk. This is then followed with a screenshot NOT showing the geometry using the the command "sudo fdisk -l /dev/sda".

I confirmed in 16.04 and 18.04 Ubuntu installs that this is not correct. Last this command worked were in 16.04 (I only work on LTS version so cannot comment on other versions.

The correct way to view this is with "sudo fdisk -l -u=cyliners /dev/sda"

as per man fdisk:

 

       -u[=unit]
              When listing partition tables, show sizes  in  'sectors'  or  in
              'cylinders'.   The  default  is  to  show sizes in sectors.  For
              backward compatibility, it is possible to use the option without
              the <units> argument -- then the default is used.  Note that the
              optional <unit> argument cannot be separated from the -u  option
              by a space, the correct form is for example '-u=cylinders'.

 

sudo fdisk -l -u=cylinders /dev/sde

Disk /dev/sde: 55.9 GiB, 59961769984 bytes, 117112832 sectors

Geometry: 255 heads, 63 sectors/track, 7289 cylinders

Units: cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

 

Click Here!