I've just learnt about backup and restore on Ubuntu. I have some questions below.
- 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 typedlsblk
and it seems there's a difference in size of/dev/sda2
(extended partition) between two commands. Can I have the explanation? - Does
mkfs
command create a logical partition? I know thatmkfs
means make a file system, but a file system is created when mounting with a partition.
Here some images.
CodePudding user response:
- The difference is because of
extended
partition type ofdev/sda2
device. More explanation is given here - 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 eitherfdisk
orparted
to partition a hard disk intoprimary
orextended
orlogical
type & then usemkfs
to build eitherext4
orext3
orxfs
filesystem or whatever which depends on your need.
CodePudding user response:
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.
You can not use mkfs to partition disk. You can make a filesystem with it once the disk is already partitioned.