[Becoming SE] What is Disk? (1)

DaBeen Yi
2 min readMay 25, 2021

Ok..I’m so overwhelmed by concept of disk. It seems like there are so many things to know. But well.. there is no way to out. Let’s check one by one.

Warning: This post can be very disorganized. 😐

First of all, I think it would be better to *clearly* understand each definitions down below.

  1. Drive: Physical device to store data. It contains disks.
  2. Disk: Physical storage device. Various size of volumes can be contained.
  3. Partition: Just chunk of a disk. Almost same as volume.
  4. Volume: Compare with partition, it has name and file system. And it also contains data. (So obviously)

Disk partitioning

We have to do disk partitioning before we can use a disk drive. And there are 2 ways to do this. Each method defines how to store disk partition information on a driver.

  1. GPT (GUID Partition Table)
  2. MBR (Master Boot Record)

GPT is a new standard that gradually replaces MBR. (Because MBR has limitation.)

According to few posts about disk partitioning, experts suggest to use GPT if a driver is bigger than 2 TB.

In my case, I create volumes for operating system and data(or log) individually and choose MBR for OS volume and GPT for data(or log) volume.

Some useful commands

Format Disk

: Format disk in xfs and set block size as 4k

mkfs.xfs -f -b size=4096 /dev/(volume name)

Check Block size

blockdev --getbsz /dev/(volume name)

Sector size vs block size

When I performed above commands, I wonder what a difference between sector size and block size is.

And here is a simple version of what I found through a research.

  1. Sector size: The smallest individual reference-able regions on a disk. (Physical)
  2. Block size: A group of sectors that the operating system can address. A block might be one sector or more. (Logical)

In one sentence, those 2 words are totally different but can have same value.

After I did some research, I found out above contents are quite old fashioned.

(Especially, terms are based on HDD which is barely used nowadays.)

But I do believe these ‘old but basic’ concepts give me better understand about disk.

Hope it can help someone like me.

Ok, then.. I’ll wrap this post here and get back with more useful information.

🍰

--

--