• Uncategorized

About linux : Partitions-in-Linux

Question Detail

I’ve just learnt about backup and restore on Ubuntu. I have some questions below.

  1. When we’ve set up Ubuntu successfully, how many partitions have been created? I checked on Terminal by using parted -l and see that there’re 3 parts. I typed lsblk and it seems there’s a difference in size of /dev/sda2 (extended partition) between two commands. Can I have the explanation?
  2. Does mkfs command create a logical partition? I know that mkfs means make a file system, but a file system is created when mounting with a partition.

Here some images.

Question Answer

  1. The difference is because of extended partition type of dev/sda2 device. More explanation is given here
  2. By definition, mkfs says mkfs is used to build a Linux file system on a device, usually a hard disk partition. This means, you have to use either fdisk or parted to partition a hard disk into primary or extended or logical type & then use mkfs to build either ext4 or ext3 or xfs filesystem or whatever which depends on your need.
  1. Software people calculate disk size as multiples of 1024. But some use multiples of 1000. In your case, parted is probably using 1000 while lsblk is using 1024.

  2. You can not use mkfs to partition disk. You can make a filesystem with it once the disk is already partitioned.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.