SlideShare una empresa de Scribd logo
1 de 63
Descargar para leer sin conexión
Team Emertxe
File Systems
Introduction
File Systems
Contents
● Introduction
● Contents
● Types
● Partitions
Introduction
File Systems
Introduction
● File system is an approach on how the data can be
organized in order to have a meaningful read or write in a
system
● File systems provides a very easy way of identifying data
like where it begins and ends
● The group of such data can be called as “Files”
● The method used to manage these groups of data can be
called as “File systems”
File Systems
Introduction
●
There are several kinds file system having different structure and
logic, properties of speed, flexibility, security, size and more
●
The most commonly used media to store the data are
– Storage Devices
●
Magnetic Tapes
●
Hard Drive
●
Optical Discs
●
Flash Memories
●
RAM (Temporary)
– Network like NFS
– Virtual like procfs
File Systems
Introduction
● An OS can support more than one file system
● In this topic we are going to concentrate on Unix and
Unix like file systems
● File systems can be discussed in the following context
– Contents
– Types
– Partitions
File System Contents
Linux Directory Structure
File System Contents
Linux Directory Structure
● When it is the matter of data, different operating system
uses different approaches to organize it
● In Unix and Unix like systems, applications and users see a
single global hierarchy of files and directories, which can
be composed of several file systems.
● The access of the data are done using a process called as
mounting
● The location on where the data should be located called as
mount point is to be informed to the OS.
● The following slides discuss about the Linux Directory
Structure
File System Contents
Linux Directory Structure
● The left side of the slide shows the
most important files in Linux system
● The organization of a Linux root file
system in terms of directories is well
defined by the Filesystem Hierarchy
Standard
● Most Linux systems conform to this
specification
– Applications expect this organization
– It makes it easier for developers and
users as the file system organization is
similar in all systems
tmp
sys
usr
var
/
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Place for most commonly used
terminal commands
● Common Linux commands you
need to use in single-user modes
are located under this directory.
● Commands used by all the users of
the system are located here.
● Examples:
– ls
– ping
– grep
– cp
bin
tmp
sys
usr
var
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Contains files needed to start up
the system, including the Linux
kernel, a RAM disk image and
bootloader configuration files
● Kernel image (only when the
kernel is loaded from a file
system, not common on non-x86
architectures)
boot
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Device files
● These include terminal
devices, usb, or any device
attached to the system.
● Examples:
– /dev/tty1
– /dev/usbmon0
dev
tmp
sys
usr
var
bin
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Contains configuration files
required by all programs.
● This also contains startup and
shutdown shell scripts used to
start/stop individual programs.
● Examples:
– /etc/resolv.conf
– /etc/logrotate.conf
etc
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Home directories for all users to
store their personal files.
● Example:
– /home/arun
– /home/adil
home
tmp
sys
usr
var
bin
dev
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Contains library files that supports
the binaries located under /bin
and /sbin
● Library file names are either ld* or
lib*.so.*
● Examples:
– ld-2.11.1.so
– libncurses.so.5.7
lib
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
boot
etc
mnt
root
File System Contents
Linux Directory Structure
● Temporary mount directory for
removable devices.
● Examples:
– /media/cdrom
– /media/floppy
– /media/cdrecorder
media
tmp
sys
usr
var
bin
dev
home
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Temporary mount directory where
sysadmins can mount file systems.
mnt
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
boot
etc
lib
root
File System Contents
Linux Directory Structure
● Contains information about system
process.
● This is a pseudo file system
contains information about running
process. For example: /proc/{pid}
directory contains information
about the process with that
particular pid.
● This is a virtual file system with
text information about system
resources. Examples:
– /proc/uptime
proc
tmp
sys
usr
var
bin
dev
home
media
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Root user's home directory
root
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
File System Contents
Linux Directory Structure
● Just like /bin, /sbin also contains
binary executables
● But, the Linux commands located
under this directory are used
typically by system administrator,
for system maintenance purpose.
● Examples:
– iptables
– reboot
– fdisk
– ifconfig
– swapon
sbin
tmp
sys
usr
var
bin
dev
home
media
proc
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Mount point of the sysfs virtual file
system
sys
tmp
usr
var
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● Directory that contains temporary
files created by system and users.
● Files under this directory are
deleted when system is rebooted.
tmp
sys
usr
var
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
●
Contains binaries, libraries, documentation,
and source-code for second level programs.
●
/usr/bin contains binary files for user
programs. If you can’t find a user binary
under /bin, look under /usr/bin. For
Examples: at, awk, cc, less, scp
●
/usr/sbin contains binary files for system
administrators. If you can’t find a system
binary under /sbin, look under /usr/sbin. For
Examples: atd, cron, sshd, useradd, userdel
●
/usr/lib contains libraries for /usr/bin
and /usr/sbin
●
/usr/local contains users programs that you
install from source. For example, when you
install apache from source, it goes under
/usr/local/apache2usr
tmp
sys
var
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Contents
Linux Directory Structure
● var stands for variable files.
● Content of the files that are
expected to grow can be found
under this directory.
● This includes —
– /var/log - system log files
– /var/lib - packages and database files
– /var/mail - emails
– /var/spool - print queues
– /var/lock - lock files
– /var/tmp - temp files needed across
reboots
var
tmp
sys
usr
bin
dev
home
media
proc
sbin
boot
etc
lib
mnt
root
File System Types
File System Types
Introduction
● Variety of choices available based on
– Speed
– Size
– Reliability
– Access restrictions
● Some types are specifically targeted based on the storage
media
● The following slide discuss some of the most commonly
used types
File System Types
Introduction
●
RAM File Systems
– initrd
– initramfs
●
Disk File Systems
– ext2
– ext3
– ext4
– Flash File Systems
●
Intro to MTD
●
JFFS2
File System Formats
Variants
● Distributed File Systems
– NFS
● Special Purpose File Systems
– squashfs
File System Types
RAM File Systems
File System Types
RAM File Systems - initrd
● Abbreviated as initial RAM disk
● RAM based block device with fixed size formatted and
mounted like disk at /dev/ram
● The size problem
– Sometimes might be a waste of space if its not fully utilized
– You can extend the limit later on run time as it has to be
reformatted
● Requires a file system driver compiled statically into
kernel to interpret data at run time
● ext2 format mostly used for creation
File System Types
RAM File Systems - initrd
● Typical boot process using initrd is as followed
– Bootloader loads the kernel and initrd into ram
– Kernel converts the initrd into a normal RAM disk and frees the
memory used by initrd
– initrd is mounted as read write as root
– /linuxrc is executed (could be a executable, shell script)
– linuxrc mounts the real root file system
– linuxrc places the root file system at the root directory using the
pivot_root system call
– The normal boot is done on the root file system (run /sbin/init)
– Initrd file system is removed
File System Types
RAM File Systems - initramfs
● Abbreviated as initial RAM file system
● Successor of initrd, with an advantage of flexible size
which can grow and shrink and does not need a driver
● Gets integrated with kernel image
● cpio archive of initial file system that gets loaded into
memory during Linux startup process
● Kernel mounts the file system and starts init
● Faster booting as the it is loaded at boot time, hence
applications can start faster
File System Types
RAM File Systems - initramfs
● Could be used as intermediate stage before loading real
file system
● The path of file system to be included has to be set while
kernel configuration
● The kernel build process would take care of integrating it
with the kernel image
● Just search INITRAMFS on the configuration menu to know
where to set the path
● Just build the kernel once the path is set
File System Types
Disk File Systems
File System Types
Disk (Block) File System
● Has ability to store data randomly at addresses in a short
amount of time
● Multiple users (or processes) access to various data on the
disk without regard to the sequential location of the data
● Disk file systems are usually block-oriented.
● Files in a block-oriented file system are sequences of
blocks, often featuring fully random-access read, write,
and modify operations
● No erasing required before write
File System Types
Disk (Block) File System
● Examples
– Hard drives, floppys, RAM Disks
– Compact Flash, SD Cards
● Though this device are based of flash devices, the
integrated controllers take care of the low level
handling of data like block devices
File System Types
Disk (Block) File System - ext2
● Abbreviated as Second Extended File System
● Matured and stable GNU/Linux file system
●
Does not support journaling support or barriers
● Not recommend as for / and /home partitions since it take
long time for file system check
● Most compatible choice for /boot partition
● Recommend for very small partitions (say < 5 MB), because
other file system types need more space for metadata
● Used to be the default file system in several Linux
distribution
File System Types
Disk (Block) File System - ext2
● ext2 is still preferred choice of flash based storage due
the absence of journal
File System Types
Disk (Block) File System – ext3
● Abbreviated as Third Extended File System
● An extension of ext2 with journaling support and write
barriers
● Backward compatible with ext2 and extremely stable
● ext2 can be converted to ext3 directly without backup
File System Types
Disk (Block) File System – ext4
●
Abbreviated as Fourth Extended File System
●
Compatible with both ext2 and ext3 and used as default file
system in many distributions
●
Supports huge individual file data and overall file system size
●
ext4 allows unlimited number of sub directories compared to
ext3
●
Has many new features like
– Journal checksum
– Fast fsck etc.
●
Can turn off the Journal feature if required
File System Types
Disk (Block) File System - Flash File System
●
Flash file system is designed for storing files on flash
memory–based storage devices
●
They are optimized for the nature and characteristics of
flash memory for the following reasons
– Erasing blocks
– Random access
– Wear leveling
●
Examples
– NAND and NOR Flashes
●
In Linux the flash memories use a device file called MTD for
interaction
File System Types
Flash File System - MTD
● MTD stands form Memory Technology Device
● Created to have abstraction layer between the hardware
specific device drivers and higher-level applications
● MTD helps to use the same API with different flash types
and technologies
● MTD does not deal with block devices like MMC, eMMC,
SD, Compact Flash etc., Since these are no raw flashes
but they have Flash Translation layer. The FTL make these
devices look like block devices
File System Types
Flash File System - MTD
File System Types
Flash File System - MTD
● MTD devices can be looked at /proc/mtd
● Two types of drivers created
– mtdchar drivers
● Can be seen in /dev as mtd<n> or mtd<n>ro with major
number 90
● Even minor number for rw type and odd minor number for ro
type
– mtdblock drivers
● Can be seen in /dev as mtdblock<n> allowing rw in block
level
● Does not handle bad block check and any wear-leveling
File System Types
Flash File System - MTD
● MTD device are usually partitioned
● These partitions can be used fro different purposes like
boot code area, kernel image, data partitions etc
● The MTD partitions can be described by
– Specifying in board device tree
– In kernel code (Hard code)
– Through kernel command line (Modification)
● Each partition becomes a separate MTD device
File System Types
Flash File System – MTD - Partitions
● Using Device Tree
File System Types
Flash File System – JFFS2
● Abbreviated as Journalling Flash File System 2
● Standard filesystem for MTD flash
● Compression support for zlib, rubin, rtime and lzo
● Better performance, power down reliability, wear
leveling and ECC
File System Types
Distributed File Systems
File System Types
Distributed File System
● A network file system is a file system that acts as a client
for a remote file access protocol, providing access to files
on a server.
● Data accessed by all users can be kept on a central host,
with clients mounting this directory at boot time
● Data consuming large amounts of disk space may be kept
on a single host
File System Types
Special Purpose File Systems
File System Types
Special Purpose File System
● Sometimes the way we handle data might depend on the
requirements
● There some file system types which can offer different
features like
– Compressions
– Backups
– Access etc.
File System Types
Special Purpose File System - squashfs
● Read-only compressed file system for block devices
● Can be used for read only data like binaries, kernel etc
● Very good compression rate and read access performance
● Mostly used in live CDs and live USB distros
● Can support compressions like
– gzip
– LZMA
– LZO etc
File System Partitions
File System Partitions
● Logically dividing the available storage space into
sections that can be accessed independently to one
another for
– File management
– Multiple users
– Data Security
– Efficiency and reliability etc.,
● Entire storage can be created as a single partition if
required, But multiple partition can help in number of
way like dual or multiboot system, swap etc.
File System Partitions
Linux System
● Two major partitions
– Data partition – Linux data partition
● A root partition and one pr more data partition
– Swap partition - Expansion of physical memory, extra
memory on storage (like virtual RAM)
● Rarely used in embedded system because of the nature
of the storage devices used
File System Partitions
Mount Points
● All partitions are attached to the system via a Mount
Point
● A mount point defines the place of a particular data set
in a file system
● Usually all the partitions are connected through the root
(/) partition
● The / will have empty directories which will be the
starting point of partitions
● Some core partitions can be mounted on startup by
describing it in /etc/fstab
File System Partitions
Schemes – Desktop – Example 1
● One possible Desktop
scheme is shown here
● Simplest and standard
one to have
● Partition for OS which get
mounted as / (root)
● Data partition mounted
as /home
● Augment to RAM,
referred and mounted as
swap
/
(root)
/home
swap
HardDrive
File System Partitions
Schemes - Desktop – Example 2
● Similar to previous
one with a separate
boot partition which
will contain the boot
images
/
(root)
/home
swap
/boot
HardDrive
File System Partitions
Schemes - Embedded – Example 1
● The partition scheme
in embedded systems
depends on the
system architecture
● This scheme shows
two stages of boot
loaders each in
different memories
● Rest all the sections
goes in other memory
Bootloader 1
Kernel Image
RFS Image
Bootloader 2
Memory1Memory2Memory3
Data
File System Partitions
Schemes - Embedded – Example 2
● This scheme shows
stage 1 of boot loader
in different memory
● Rest all the sections
including stage 2 boot
loader goes in other
memory
Bootloader 1
Kernel Image
RFS Image
Bootloader 2
Memory1Memory2
Data
File System Partitions
Schemes - Embedded – Example 3
● This scheme shows all
the contents share in
a single memory
Bootloader 1
Kernel Image
RFS Image
Bootloader 2
Memory1
Data
Thank You

Más contenido relacionado

La actualidad más candente

U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driverVandana Salve
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot) Omkar Rane
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_BootingRashila Rr
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoSherif Mousa
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overviewRajKumar Rampelli
 

La actualidad más candente (20)

BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
Bootloaders (U-Boot)
Bootloaders (U-Boot) Bootloaders (U-Boot)
Bootloaders (U-Boot)
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
GCC, GNU compiler collection
GCC, GNU compiler collectionGCC, GNU compiler collection
GCC, GNU compiler collection
 
Embedded Linux from Scratch to Yocto
Embedded Linux from Scratch to YoctoEmbedded Linux from Scratch to Yocto
Embedded Linux from Scratch to Yocto
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 

Destacado

Destacado (20)

Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded Linux - Building toolchain
Embedded Linux - Building toolchainEmbedded Linux - Building toolchain
Embedded Linux - Building toolchain
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Emertxe : Linux training portfolio
Emertxe : Linux training portfolioEmertxe : Linux training portfolio
Emertxe : Linux training portfolio
 
Interview preparation workshop
Interview preparation workshopInterview preparation workshop
Interview preparation workshop
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Getting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded LinuxGetting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded Linux
 
Emertxe : Training portfolio
Emertxe : Training portfolioEmertxe : Training portfolio
Emertxe : Training portfolio
 
Introduction to Embedded Systems
Introduction to Embedded Systems Introduction to Embedded Systems
Introduction to Embedded Systems
 
Data Structures & Algorithm design using C
Data Structures & Algorithm design using C Data Structures & Algorithm design using C
Data Structures & Algorithm design using C
 
Embedded C - Optimization techniques
Embedded C - Optimization techniquesEmbedded C - Optimization techniques
Embedded C - Optimization techniques
 
Emertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment systemEmertxe Certified Embedded Professional (ECEP): Assessment system
Emertxe Certified Embedded Professional (ECEP): Assessment system
 
Resume Preparation - Workshop
Resume Preparation - WorkshopResume Preparation - Workshop
Resume Preparation - Workshop
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Linux File System
Linux File SystemLinux File System
Linux File System
 

Similar a File systems for Embedded Linux

Linux fs structure (1)
Linux fs structure (1)Linux fs structure (1)
Linux fs structure (1)E. Rahul Naidu
 
File system discovery
File system discovery File system discovery
File system discovery DevMix
 
Access Methods and File System Mounting.pptx
Access Methods and File System Mounting.pptxAccess Methods and File System Mounting.pptx
Access Methods and File System Mounting.pptxlaiba29012
 
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxUNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxLeahRachael
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6Meenakshi Paul
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and DeadlocksRohit Jain
 
Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management Duressa Teshome
 
Lecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemLecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemAlchemist095
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Ahmed El-Arabawy
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control YuvrajWadavale
 
LinuxTraining_26_Sept_2021.ppt
LinuxTraining_26_Sept_2021.pptLinuxTraining_26_Sept_2021.ppt
LinuxTraining_26_Sept_2021.pptmuraridesai2
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 

Similar a File systems for Embedded Linux (20)

9781111306366 ppt ch11
9781111306366 ppt ch119781111306366 ppt ch11
9781111306366 ppt ch11
 
Unix File System
Unix File SystemUnix File System
Unix File System
 
Linux fs structure (1)
Linux fs structure (1)Linux fs structure (1)
Linux fs structure (1)
 
Unix file system.pptx
Unix file system.pptxUnix file system.pptx
Unix file system.pptx
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
 
File system discovery
File system discovery File system discovery
File system discovery
 
Access Methods and File System Mounting.pptx
Access Methods and File System Mounting.pptxAccess Methods and File System Mounting.pptx
Access Methods and File System Mounting.pptx
 
9781111306366 ppt ch4
9781111306366 ppt ch49781111306366 ppt ch4
9781111306366 ppt ch4
 
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxUNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management
 
Lecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemLecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file system
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
Windowsforensics
WindowsforensicsWindowsforensics
Windowsforensics
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 
LinuxTraining_26_Sept_2021.ppt
LinuxTraining_26_Sept_2021.pptLinuxTraining_26_Sept_2021.ppt
LinuxTraining_26_Sept_2021.ppt
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Basic orientation to Linux
Basic orientation to LinuxBasic orientation to Linux
Basic orientation to Linux
 

Más de Emertxe Information Technologies Pvt Ltd

Más de Emertxe Information Technologies Pvt Ltd (20)

premium post (1).pdf
premium post (1).pdfpremium post (1).pdf
premium post (1).pdf
 
Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
10_isxdigit.pdf
 
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
01_student_record.pdf
 
02_swap.pdf
02_swap.pdf02_swap.pdf
02_swap.pdf
 
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
01_sizeof.pdf
 
07_product_matrix.pdf
07_product_matrix.pdf07_product_matrix.pdf
07_product_matrix.pdf
 
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
06_sort_names.pdf
 
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
05_fragments.pdf
 
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

File systems for Embedded Linux

  • 3. File Systems Contents ● Introduction ● Contents ● Types ● Partitions
  • 5. File Systems Introduction ● File system is an approach on how the data can be organized in order to have a meaningful read or write in a system ● File systems provides a very easy way of identifying data like where it begins and ends ● The group of such data can be called as “Files” ● The method used to manage these groups of data can be called as “File systems”
  • 6. File Systems Introduction ● There are several kinds file system having different structure and logic, properties of speed, flexibility, security, size and more ● The most commonly used media to store the data are – Storage Devices ● Magnetic Tapes ● Hard Drive ● Optical Discs ● Flash Memories ● RAM (Temporary) – Network like NFS – Virtual like procfs
  • 7. File Systems Introduction ● An OS can support more than one file system ● In this topic we are going to concentrate on Unix and Unix like file systems ● File systems can be discussed in the following context – Contents – Types – Partitions
  • 8. File System Contents Linux Directory Structure
  • 9. File System Contents Linux Directory Structure ● When it is the matter of data, different operating system uses different approaches to organize it ● In Unix and Unix like systems, applications and users see a single global hierarchy of files and directories, which can be composed of several file systems. ● The access of the data are done using a process called as mounting ● The location on where the data should be located called as mount point is to be informed to the OS. ● The following slides discuss about the Linux Directory Structure
  • 10. File System Contents Linux Directory Structure ● The left side of the slide shows the most important files in Linux system ● The organization of a Linux root file system in terms of directories is well defined by the Filesystem Hierarchy Standard ● Most Linux systems conform to this specification – Applications expect this organization – It makes it easier for developers and users as the file system organization is similar in all systems tmp sys usr var / bin dev home media proc sbin boot etc lib mnt root
  • 11. File System Contents Linux Directory Structure ● Place for most commonly used terminal commands ● Common Linux commands you need to use in single-user modes are located under this directory. ● Commands used by all the users of the system are located here. ● Examples: – ls – ping – grep – cp bin tmp sys usr var dev home media proc sbin boot etc lib mnt root
  • 12. File System Contents Linux Directory Structure ● Contains files needed to start up the system, including the Linux kernel, a RAM disk image and bootloader configuration files ● Kernel image (only when the kernel is loaded from a file system, not common on non-x86 architectures) boot tmp sys usr var bin dev home media proc sbin etc lib mnt root
  • 13. File System Contents Linux Directory Structure ● Device files ● These include terminal devices, usb, or any device attached to the system. ● Examples: – /dev/tty1 – /dev/usbmon0 dev tmp sys usr var bin home media proc sbin boot etc lib mnt root
  • 14. File System Contents Linux Directory Structure ● Contains configuration files required by all programs. ● This also contains startup and shutdown shell scripts used to start/stop individual programs. ● Examples: – /etc/resolv.conf – /etc/logrotate.conf etc tmp sys usr var bin dev home media proc sbin boot etc lib mnt root
  • 15. File System Contents Linux Directory Structure ● Home directories for all users to store their personal files. ● Example: – /home/arun – /home/adil home tmp sys usr var bin dev media proc sbin boot etc lib mnt root
  • 16. File System Contents Linux Directory Structure ● Contains library files that supports the binaries located under /bin and /sbin ● Library file names are either ld* or lib*.so.* ● Examples: – ld-2.11.1.so – libncurses.so.5.7 lib tmp sys usr var bin dev home media proc sbin boot etc mnt root
  • 17. File System Contents Linux Directory Structure ● Temporary mount directory for removable devices. ● Examples: – /media/cdrom – /media/floppy – /media/cdrecorder media tmp sys usr var bin dev home proc sbin boot etc lib mnt root
  • 18. File System Contents Linux Directory Structure ● Temporary mount directory where sysadmins can mount file systems. mnt tmp sys usr var bin dev home media proc sbin boot etc lib root
  • 19. File System Contents Linux Directory Structure ● Contains information about system process. ● This is a pseudo file system contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid. ● This is a virtual file system with text information about system resources. Examples: – /proc/uptime proc tmp sys usr var bin dev home media sbin boot etc lib mnt root
  • 20. File System Contents Linux Directory Structure ● Root user's home directory root tmp sys usr var bin dev home media proc sbin boot etc lib mnt
  • 21. File System Contents Linux Directory Structure ● Just like /bin, /sbin also contains binary executables ● But, the Linux commands located under this directory are used typically by system administrator, for system maintenance purpose. ● Examples: – iptables – reboot – fdisk – ifconfig – swapon sbin tmp sys usr var bin dev home media proc boot etc lib mnt root
  • 22. File System Contents Linux Directory Structure ● Mount point of the sysfs virtual file system sys tmp usr var bin dev home media proc sbin boot etc lib mnt root
  • 23. File System Contents Linux Directory Structure ● Directory that contains temporary files created by system and users. ● Files under this directory are deleted when system is rebooted. tmp sys usr var bin dev home media proc sbin boot etc lib mnt root
  • 24. File System Contents Linux Directory Structure ● Contains binaries, libraries, documentation, and source-code for second level programs. ● /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For Examples: at, awk, cc, less, scp ● /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For Examples: atd, cron, sshd, useradd, userdel ● /usr/lib contains libraries for /usr/bin and /usr/sbin ● /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2usr tmp sys var bin dev home media proc sbin boot etc lib mnt root
  • 25. File System Contents Linux Directory Structure ● var stands for variable files. ● Content of the files that are expected to grow can be found under this directory. ● This includes — – /var/log - system log files – /var/lib - packages and database files – /var/mail - emails – /var/spool - print queues – /var/lock - lock files – /var/tmp - temp files needed across reboots var tmp sys usr bin dev home media proc sbin boot etc lib mnt root
  • 27. File System Types Introduction ● Variety of choices available based on – Speed – Size – Reliability – Access restrictions ● Some types are specifically targeted based on the storage media ● The following slide discuss some of the most commonly used types
  • 28. File System Types Introduction ● RAM File Systems – initrd – initramfs ● Disk File Systems – ext2 – ext3 – ext4 – Flash File Systems ● Intro to MTD ● JFFS2
  • 29. File System Formats Variants ● Distributed File Systems – NFS ● Special Purpose File Systems – squashfs
  • 30. File System Types RAM File Systems
  • 31. File System Types RAM File Systems - initrd ● Abbreviated as initial RAM disk ● RAM based block device with fixed size formatted and mounted like disk at /dev/ram ● The size problem – Sometimes might be a waste of space if its not fully utilized – You can extend the limit later on run time as it has to be reformatted ● Requires a file system driver compiled statically into kernel to interpret data at run time ● ext2 format mostly used for creation
  • 32. File System Types RAM File Systems - initrd ● Typical boot process using initrd is as followed – Bootloader loads the kernel and initrd into ram – Kernel converts the initrd into a normal RAM disk and frees the memory used by initrd – initrd is mounted as read write as root – /linuxrc is executed (could be a executable, shell script) – linuxrc mounts the real root file system – linuxrc places the root file system at the root directory using the pivot_root system call – The normal boot is done on the root file system (run /sbin/init) – Initrd file system is removed
  • 33. File System Types RAM File Systems - initramfs ● Abbreviated as initial RAM file system ● Successor of initrd, with an advantage of flexible size which can grow and shrink and does not need a driver ● Gets integrated with kernel image ● cpio archive of initial file system that gets loaded into memory during Linux startup process ● Kernel mounts the file system and starts init ● Faster booting as the it is loaded at boot time, hence applications can start faster
  • 34. File System Types RAM File Systems - initramfs ● Could be used as intermediate stage before loading real file system ● The path of file system to be included has to be set while kernel configuration ● The kernel build process would take care of integrating it with the kernel image ● Just search INITRAMFS on the configuration menu to know where to set the path ● Just build the kernel once the path is set
  • 35. File System Types Disk File Systems
  • 36. File System Types Disk (Block) File System ● Has ability to store data randomly at addresses in a short amount of time ● Multiple users (or processes) access to various data on the disk without regard to the sequential location of the data ● Disk file systems are usually block-oriented. ● Files in a block-oriented file system are sequences of blocks, often featuring fully random-access read, write, and modify operations ● No erasing required before write
  • 37. File System Types Disk (Block) File System ● Examples – Hard drives, floppys, RAM Disks – Compact Flash, SD Cards ● Though this device are based of flash devices, the integrated controllers take care of the low level handling of data like block devices
  • 38. File System Types Disk (Block) File System - ext2 ● Abbreviated as Second Extended File System ● Matured and stable GNU/Linux file system ● Does not support journaling support or barriers ● Not recommend as for / and /home partitions since it take long time for file system check ● Most compatible choice for /boot partition ● Recommend for very small partitions (say < 5 MB), because other file system types need more space for metadata ● Used to be the default file system in several Linux distribution
  • 39. File System Types Disk (Block) File System - ext2 ● ext2 is still preferred choice of flash based storage due the absence of journal
  • 40. File System Types Disk (Block) File System – ext3 ● Abbreviated as Third Extended File System ● An extension of ext2 with journaling support and write barriers ● Backward compatible with ext2 and extremely stable ● ext2 can be converted to ext3 directly without backup
  • 41. File System Types Disk (Block) File System – ext4 ● Abbreviated as Fourth Extended File System ● Compatible with both ext2 and ext3 and used as default file system in many distributions ● Supports huge individual file data and overall file system size ● ext4 allows unlimited number of sub directories compared to ext3 ● Has many new features like – Journal checksum – Fast fsck etc. ● Can turn off the Journal feature if required
  • 42. File System Types Disk (Block) File System - Flash File System ● Flash file system is designed for storing files on flash memory–based storage devices ● They are optimized for the nature and characteristics of flash memory for the following reasons – Erasing blocks – Random access – Wear leveling ● Examples – NAND and NOR Flashes ● In Linux the flash memories use a device file called MTD for interaction
  • 43. File System Types Flash File System - MTD ● MTD stands form Memory Technology Device ● Created to have abstraction layer between the hardware specific device drivers and higher-level applications ● MTD helps to use the same API with different flash types and technologies ● MTD does not deal with block devices like MMC, eMMC, SD, Compact Flash etc., Since these are no raw flashes but they have Flash Translation layer. The FTL make these devices look like block devices
  • 44. File System Types Flash File System - MTD
  • 45. File System Types Flash File System - MTD ● MTD devices can be looked at /proc/mtd ● Two types of drivers created – mtdchar drivers ● Can be seen in /dev as mtd<n> or mtd<n>ro with major number 90 ● Even minor number for rw type and odd minor number for ro type – mtdblock drivers ● Can be seen in /dev as mtdblock<n> allowing rw in block level ● Does not handle bad block check and any wear-leveling
  • 46. File System Types Flash File System - MTD ● MTD device are usually partitioned ● These partitions can be used fro different purposes like boot code area, kernel image, data partitions etc ● The MTD partitions can be described by – Specifying in board device tree – In kernel code (Hard code) – Through kernel command line (Modification) ● Each partition becomes a separate MTD device
  • 47. File System Types Flash File System – MTD - Partitions ● Using Device Tree
  • 48. File System Types Flash File System – JFFS2 ● Abbreviated as Journalling Flash File System 2 ● Standard filesystem for MTD flash ● Compression support for zlib, rubin, rtime and lzo ● Better performance, power down reliability, wear leveling and ECC
  • 50. File System Types Distributed File System ● A network file system is a file system that acts as a client for a remote file access protocol, providing access to files on a server. ● Data accessed by all users can be kept on a central host, with clients mounting this directory at boot time ● Data consuming large amounts of disk space may be kept on a single host
  • 51. File System Types Special Purpose File Systems
  • 52. File System Types Special Purpose File System ● Sometimes the way we handle data might depend on the requirements ● There some file system types which can offer different features like – Compressions – Backups – Access etc.
  • 53. File System Types Special Purpose File System - squashfs ● Read-only compressed file system for block devices ● Can be used for read only data like binaries, kernel etc ● Very good compression rate and read access performance ● Mostly used in live CDs and live USB distros ● Can support compressions like – gzip – LZMA – LZO etc
  • 55. File System Partitions ● Logically dividing the available storage space into sections that can be accessed independently to one another for – File management – Multiple users – Data Security – Efficiency and reliability etc., ● Entire storage can be created as a single partition if required, But multiple partition can help in number of way like dual or multiboot system, swap etc.
  • 56. File System Partitions Linux System ● Two major partitions – Data partition – Linux data partition ● A root partition and one pr more data partition – Swap partition - Expansion of physical memory, extra memory on storage (like virtual RAM) ● Rarely used in embedded system because of the nature of the storage devices used
  • 57. File System Partitions Mount Points ● All partitions are attached to the system via a Mount Point ● A mount point defines the place of a particular data set in a file system ● Usually all the partitions are connected through the root (/) partition ● The / will have empty directories which will be the starting point of partitions ● Some core partitions can be mounted on startup by describing it in /etc/fstab
  • 58. File System Partitions Schemes – Desktop – Example 1 ● One possible Desktop scheme is shown here ● Simplest and standard one to have ● Partition for OS which get mounted as / (root) ● Data partition mounted as /home ● Augment to RAM, referred and mounted as swap / (root) /home swap HardDrive
  • 59. File System Partitions Schemes - Desktop – Example 2 ● Similar to previous one with a separate boot partition which will contain the boot images / (root) /home swap /boot HardDrive
  • 60. File System Partitions Schemes - Embedded – Example 1 ● The partition scheme in embedded systems depends on the system architecture ● This scheme shows two stages of boot loaders each in different memories ● Rest all the sections goes in other memory Bootloader 1 Kernel Image RFS Image Bootloader 2 Memory1Memory2Memory3 Data
  • 61. File System Partitions Schemes - Embedded – Example 2 ● This scheme shows stage 1 of boot loader in different memory ● Rest all the sections including stage 2 boot loader goes in other memory Bootloader 1 Kernel Image RFS Image Bootloader 2 Memory1Memory2 Data
  • 62. File System Partitions Schemes - Embedded – Example 3 ● This scheme shows all the contents share in a single memory Bootloader 1 Kernel Image RFS Image Bootloader 2 Memory1 Data