Site icon

Linux File System Continue … File system Creation from Scratch

This article discuss about Redirection, Search and Linux File Creation From Scratch

I discussed about lsof and ps(process status) commands in the  last blog post. I strongly recommend you to read earlier blogs for better understanding . If you find something missing, Please provide feedback in comment box so that I can take corrective action.

I will be using redirection wherever it requires.

Redirection

Q: Standard Output i.e. stdout(FD=1) is Monitor screen , What can be Standard Input i.e. stdin(FD=0)  ? …You know that

Search

As we observed that the root filesystem itself has a number of utilities and libraries for supporting linux based applications. The next requirement is to understand the search options. The most frequently used commands are :

How can I create a Filesystem from scratch ?

Since Kernel takes care of resource management and the software architecture has flexibility to pick necessary utilities for Filesystem, There should be a method to design the entire filesystem from scratch. Following is the method to achieve the same :

sanjay@sanjay-VirtualBox:~/linux_day5$ dd if=/dev/zero of=myfile1.img bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.248331 s, 422 MB/s
sanjay@sanjay-VirtualBox:~/linux_day5$ mke2fs myfile1.img -
sudo mount myfile1.img tmp/ -o loop

If we create partition table in the file image above, It will become virtual hard disk image. Loop device is a pseudo device which makes a filesystem appear as a block device. After mounting the filesystem, we can copy the required files inside this.

As I discussed earlier /dev directory nodes provide device access to user space application . However there is another directory /sys which provides device configuration and status specific information.  /proc provides information related to kernel running status.

References

This particular article is discussed at  Linux File System Creation

Thanks for reading till end. I am trying to improve usability of my  site. Did you find this discussion helpful ? If so,  Please subscribe to YouTube channel Embedkari as well for additional embedded related stuff. 

Exit mobile version