Sujay
Sujay

Reputation: 26

Which linux device driver is responsible for formatting and writing root file system?

I'm getting started with imx6 processors and the procedure involved to bring up the board is to flash u-boot kernel dtb and rootfs which is taken care of by mfg tools provided by nxp. For creating a rootfs partition the command run is

mkfs.ext3 -F -E nodiscard /dev/mmcblk1p2 

and for untaring the rootfs into this partition it is.

pipe tar -jxv -C /mnt/mmcblk1p2

I'd like to know the working of this, which kernel driver is being called for executing these commands? My kernel version is 4.9.88. I did find a few driver files related to mmc in the path

/drivers/mmc/core

but there is nothing related to filesystem reading or writing here. Can anyone explain which driver files are used to create filesystems?

Upvotes: 0

Views: 94

Answers (1)

Erlkoenig
Erlkoenig

Reputation: 2754

Creating the filesystem is done by the userspace program mke2fs (of which mkfs.ext3 is an alias) which is part of the e2fsprogs package. The kernel and drivers have no way of creating filesystems. Therefore, only the block driver for accessing the MMC device is involved, but no file system driver.

Upvotes: 1

Related Questions