File Systems

Anil Kumar Pugalia
Anil Kumar PugaliaLinux Geek and Open Source Hardware & Software Freak, Corporate Trainer, Entrepreneur in Automation
File Systems 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 
All Rights Reserved.
What to Expect? 
W's of File System 
Building a Root File System 
Building the BusyBox 
Creating Ramdisk 
Booting Through NFS 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 2 
All Rights Reserved.
What is a File System? 
Place to store Data in form of Files 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 3 
All Rights Reserved.
File System in the 3 Spaces 
Three things at three levels 
Hardware Space – The Physical Organization 
of Data on the Storage Devices 
Kernel Space – Drivers to decode & access 
the data from the Physical Organization 
User Space – All what you see from / - The 
User View 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 4 
All Rights Reserved.
Do we need one in ES? 
Let's observe the Desktop Environment 
Where & Which are the File Systems 
there? 
Where: Hard Disk, CDROM, Pen Drive, … 
Which: FAT, FAT32, NTFS, iso9600, ext3, … 
What are they for? 
For (Operating) System's Data 
For your Data 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 5 
All Rights Reserved.
So, do we need FS in ES? 
Answer is in the following two Questions 
Do we need to have a Operating System running on it? 
Do we need to store our data on it? 
First one is definitely yes 
Second is requirement based 
But the needs & the storage medium for the two 
could be different 
And accordingly, we have a wide variety of File 
Systems to choose from 
Let's understand 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 6 
All Rights Reserved.
FS for Operating System 
Also referred as the Root File System (RFS) 
A Minimal RFS should contain the following 
Binaries (/bin, /sbin) 
Libraries (/lib) 
Devices (/dev) 
Configurations (/etc) 
Virtual File Systems (/proc, /sys) 
Application Temporary File (/tmp) 
Variable Data from Daemons & Utilities (/var) 
User Data (/root, /home) – optional 
Mount points (/mnt, /media) – optional 
Additional software (/usr, /opt) - optional 
Bootloader files (/boot) – optional 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 7 
All Rights Reserved.
Building a Root File System 
Involves 
Creating & Populating the complete directory structure, appropriately 
Putting that in the desired FS type 
Either on the host & then transferring it to the target, or directly on the target 
Various sources 
Binaries – Application Sets (busybox, ...) 
Libraries – Toolchain Libraries (glibc, uClibc, …) 
Devices – Create by Hand, Or Device package 
Virtual & Temporary Files – Create by Hand 
Configuration & Variable – Created as required 
Many a times, a more easier way is 
Start with a reference RFS 
Add-on whatever needed 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 8 
All Rights Reserved.
busybox – A special mention 
busybox is so-called a Swiss Knife 
Contains reduced size versions of the most commonly 
used Unix utilities, all in a single executable 
Shell environment being just the starting point 
It provides 
init system as per System V standard 
Startup applications & Service daemons 
mdev: Light-weight udev implementation 
TinyLogin: Set of logging utilities 
… 
Building it is similar to any other OSS 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 9 
All Rights Reserved.
Building the busybox 
Untar the busybox 
Get into its folder 
make menuconfig 
Select the required options 
make 
make CONFIG_PREFIX=<path_to_rootfs> 
install 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 10 
All Rights Reserved.
Creating the Root Filesystem 
Add the required directories 
dev, dev/pts, etc, etc/init.d, lib, mnt, opt 
Update the fstab to have proc and /dev/pts filesystems mounted 
automatically 
proc /proc proc defaults 0 0 
none /dev/pts devpts mode=0622 0 0 
Add the files required by the login utilities 
Add root:x:0:root in etc/group 
Add root:0:0:0:/root:/bin/ash in /etc/passwd 
Add 127.0.0.1 localhost in etc/hosts 
Copy the following from Templates/CreatingRootFs/Target/etc/ (available 
from Downloads section of http://sysplay.in) 
Add the inittab file 
Add the init.d/rcS 
Add the mdev.conf file 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 11 
All Rights Reserved.
Adding the shared Libraries 
cd lib 
cp – r /usr/local/angstrom/arm/arm-angstrom- 
linux-gnueabi/lib/ * 
arm-linux-strip * 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 12 
All Rights Reserved.
Creating the Ram Disk 
Create the 16M file of 'zero' 
dd if=/dev/zero of=rd-ext2.bin bs=1k count=16384 
Create the empty filesystem 
mke2fs -F -m 0 -b 1024 rd-ext2.bin 
Fill the filesytem with contents 
mount -t ext2 rd-ext2.bin /mnt -o loop 
tar -C Target -cf - . | tar -C /mnt -xf - 
Arguments to be passed to the Kernel 
root = /dev/ram0 rw ramdisk_size=16384 
initrd=0x90000000,16M 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 13 
All Rights Reserved.
Choosing RFS Types 
initramfs – For initial board bringup cycles 
nfs – For initial development 
squashfs – For read only storage 
jffs2 – For flash-based storage 
ext* - For large size storage 
… 
Please note that, we can't use any of fat, vfat, ntfs, … 
As they do not support device & special files on them 
ext3 supports 7 different types of files 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 14 
All Rights Reserved.
HOWTO of a Read Only FS 
Most of the Embedded System FS are 
Created on the Host, as images 
And then transferred to the Target 
Let's take an Example: squashfs 
Creating (on Host) 
mksquashfs [options] <rfs_dir> <img_file> 
Transferring (on Target) 
dd if=<img_file> of=<part_for_fs> 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 15 
All Rights Reserved.
Creating initramfs 
Done during Kernel Building 
Before building the Kernel, configure the 
following 
Under “General setup” 
Enable “Initial RAM filesystem … support” 
Set the “Initramfs source file(s)” to the RFS dir 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 16 
All Rights Reserved.
Root File System over NFS 
Enable NFS mount of the RFS directory on the 
host 
Update the Target's Kernel image with 
Root over NFS feature enabled 
On the target, add the following to the 
bootargs, before booting 
root=/dev/nfs 
nfsroot=<host_ip>:<rfs_dir_on_host> 
Argument for assigning an IP address 
Boot the target to use the RFS over NFS 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 17 
All Rights Reserved.
What about swap partition? 
Purposes of swap partition (on Desktop) 
Process Swapping in case Memory is less 
Hibernation 
Embedded Systems 
Has less Memory. So, if there is swap, it would 
be used frequently. But where? Flash??? What 
about its write cycles, write levelling? 
Typically, no Hibernation needed 
Hence, no swap on Embedded Systems 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 18 
All Rights Reserved.
Other File Systems 
/ → Root File System → One particular FS 
However, subdirectories under / could be 
On other Partitions, Or 
Even other File Systems 
Examples: 
/ → initramfs; /home → jffs2 
/ → squashfs; /var & /tmp → tmpfs 
/ → jffs2; /home → ext2 or fat 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 19 
All Rights Reserved.
Feature-specific File Systems 
Journalizing FS: ext2 vs ext3 
Read-only FS vs Mounting Read-only 
Compressed FS: cramfs, squashfs 
Flash-Specific FS: jffs2 
Temporary Storage: ramfs, tmpfs, ... 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 20 
All Rights Reserved.
What all have we learnt? 
W's of File System 
Building a Root File System 
Building the BusyBox 
Creating Ramdisk 
Booting Through NFS 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 21 
All Rights Reserved.
Any Queries? 
© 2010-14 SysPlay Workshops <workshop@sysplay.in> 22 
All Rights Reserved.
1 of 22

Recommended

Linux Memory Management by
Linux Memory ManagementLinux Memory Management
Linux Memory ManagementAnil Kumar Pugalia
27.7K views15 slides
File System Modules by
File System ModulesFile System Modules
File System ModulesAnil Kumar Pugalia
25K views27 slides
Character Drivers by
Character DriversCharacter Drivers
Character DriversAnil Kumar Pugalia
56.7K views22 slides
File System Modules by
File System ModulesFile System Modules
File System ModulesAnil Kumar Pugalia
21K views37 slides
BeagleBoard-xM Bootloaders by
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersSysPlay eLearning Academy for You
7.3K views17 slides
Introduction to Linux by
Introduction to LinuxIntroduction to Linux
Introduction to LinuxAnil Kumar Pugalia
11.2K views32 slides

More Related Content

What's hot

System Calls by
System CallsSystem Calls
System CallsAnil Kumar Pugalia
9.7K views14 slides
Embedded Storage Management by
Embedded Storage ManagementEmbedded Storage Management
Embedded Storage ManagementAnil Kumar Pugalia
4.1K views16 slides
Linux File System by
Linux File SystemLinux File System
Linux File SystemAnil Kumar Pugalia
24.5K views33 slides
BeagleBone Black Bootloaders by
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black BootloadersSysPlay eLearning Academy for You
4K views27 slides
Embedded Software Design by
Embedded Software DesignEmbedded Software Design
Embedded Software DesignAnil Kumar Pugalia
7K views29 slides
Architecture Porting by
Architecture PortingArchitecture Porting
Architecture PortingAnil Kumar Pugalia
5K views12 slides

What's hot(20)

Viewers also liked

Platform Drivers by
Platform DriversPlatform Drivers
Platform DriversSysPlay eLearning Academy for You
17.6K views12 slides
Xfs file system for linux by
Xfs file system for linuxXfs file system for linux
Xfs file system for linuxAjay Sood
2K views20 slides
Dbms by
DbmsDbms
Dbmssevtap87
30.8K views43 slides
Dbms by
DbmsDbms
Dbmsharleenmahajan
5.2K views26 slides
Ch 1-final-file organization from korth by
Ch 1-final-file organization from korthCh 1-final-file organization from korth
Ch 1-final-file organization from korthRupali Rana
3.2K views41 slides
File organization 1 by
File organization 1File organization 1
File organization 1Rupali Rana
14.9K views40 slides

Viewers also liked(20)

Xfs file system for linux by Ajay Sood
Xfs file system for linuxXfs file system for linux
Xfs file system for linux
Ajay Sood2K views
Dbms by sevtap87
DbmsDbms
Dbms
sevtap8730.8K views
Ch 1-final-file organization from korth by Rupali Rana
Ch 1-final-file organization from korthCh 1-final-file organization from korth
Ch 1-final-file organization from korth
Rupali Rana3.2K views
File organization 1 by Rupali Rana
File organization 1File organization 1
File organization 1
Rupali Rana14.9K views
Database management system by RizwanHafeez
Database management systemDatabase management system
Database management system
RizwanHafeez83.6K views
Database Management Systems (DBMS) by Dimara Hakim
Database Management Systems (DBMS)Database Management Systems (DBMS)
Database Management Systems (DBMS)
Dimara Hakim38.8K views
Management Information System (MIS) by Navneet Jingar
Management Information System (MIS)Management Information System (MIS)
Management Information System (MIS)
Navneet Jingar239.9K views

Similar to File Systems

Advanced Level Training on Koha / TLS (ToT) by
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Ata Rehman
951 views52 slides
Hadoop installation by
Hadoop installationHadoop installation
Hadoop installationAnkit Desai
1.1K views47 slides
Linux System by
Linux SystemLinux System
Linux SystemSysPlay eLearning Academy for You
854 views25 slides
Ch12 system administration by
Ch12 system administration Ch12 system administration
Ch12 system administration Raja Waseem Akhtar
789 views45 slides
Dru lavigne servers-tutorial by
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorialDru Lavigne
976 views23 slides
Shell Scripting by
Shell ScriptingShell Scripting
Shell ScriptingAnil Kumar Pugalia
6.2K views27 slides

Similar to File Systems(20)

Advanced Level Training on Koha / TLS (ToT) by Ata Rehman
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
Ata Rehman951 views
Hadoop installation by Ankit Desai
Hadoop installationHadoop installation
Hadoop installation
Ankit Desai1.1K views
Dru lavigne servers-tutorial by Dru Lavigne
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorial
Dru Lavigne976 views
UNIX(Essential needs of administration) by Papu Kumar
UNIX(Essential needs of administration)UNIX(Essential needs of administration)
UNIX(Essential needs of administration)
Papu Kumar163 views
Andresen 8 21 02 by FNian
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
FNian469 views
Problem Reporting and Analysis Linux on System z -How to survive a Linux Crit... by IBM India Smarter Computing
Problem Reporting and Analysis Linux on System z -How to survive a Linux Crit...Problem Reporting and Analysis Linux on System z -How to survive a Linux Crit...
Problem Reporting and Analysis Linux on System z -How to survive a Linux Crit...
Linux conf-admin by badamisri
Linux conf-adminLinux conf-admin
Linux conf-admin
badamisri912 views
Linux conf-admin by badamisri
Linux conf-adminLinux conf-admin
Linux conf-admin
badamisri1.5K views
Writing file system in CPython by delimitry
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
delimitry209 views

More from Anil Kumar Pugalia

Kernel Debugging & Profiling by
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & ProfilingAnil Kumar Pugalia
6K views14 slides
Processes by
ProcessesProcesses
ProcessesAnil Kumar Pugalia
7K views33 slides
Playing with R L C Circuits by
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C CircuitsAnil Kumar Pugalia
2.8K views17 slides
Audio Drivers by
Audio DriversAudio Drivers
Audio DriversAnil Kumar Pugalia
20.8K views11 slides
Video Drivers by
Video DriversVideo Drivers
Video DriversAnil Kumar Pugalia
23.4K views38 slides
Mobile Hacking using Linux Drivers by
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
6K views33 slides

More from Anil Kumar Pugalia(18)

Recently uploaded

Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
55 views46 slides
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
41 views73 slides
Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
26 views45 slides
Unit 1_Lecture 2_Physical Design of IoT.pdf by
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdfStephenTec
12 views36 slides
Future of Indian ConsumerTech by
Future of Indian ConsumerTechFuture of Indian ConsumerTech
Future of Indian ConsumerTechKapil Khandelwal (KK)
21 views68 slides
Piloting & Scaling Successfully With Microsoft Viva by
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft VivaRichard Harbridge
12 views160 slides

Recently uploaded(20)

Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf by Dr. Jimmy Schwarzkopf
STKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdfSTKI Israeli Market Study 2023   corrected forecast 2023_24 v3.pdf
STKI Israeli Market Study 2023 corrected forecast 2023_24 v3.pdf
AMAZON PRODUCT RESEARCH.pdf by JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta26 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada136 views

File Systems

  • 1. File Systems © 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved.
  • 2. What to Expect? W's of File System Building a Root File System Building the BusyBox Creating Ramdisk Booting Through NFS © 2010-14 SysPlay Workshops <workshop@sysplay.in> 2 All Rights Reserved.
  • 3. What is a File System? Place to store Data in form of Files © 2010-14 SysPlay Workshops <workshop@sysplay.in> 3 All Rights Reserved.
  • 4. File System in the 3 Spaces Three things at three levels Hardware Space – The Physical Organization of Data on the Storage Devices Kernel Space – Drivers to decode & access the data from the Physical Organization User Space – All what you see from / - The User View © 2010-14 SysPlay Workshops <workshop@sysplay.in> 4 All Rights Reserved.
  • 5. Do we need one in ES? Let's observe the Desktop Environment Where & Which are the File Systems there? Where: Hard Disk, CDROM, Pen Drive, … Which: FAT, FAT32, NTFS, iso9600, ext3, … What are they for? For (Operating) System's Data For your Data © 2010-14 SysPlay Workshops <workshop@sysplay.in> 5 All Rights Reserved.
  • 6. So, do we need FS in ES? Answer is in the following two Questions Do we need to have a Operating System running on it? Do we need to store our data on it? First one is definitely yes Second is requirement based But the needs & the storage medium for the two could be different And accordingly, we have a wide variety of File Systems to choose from Let's understand © 2010-14 SysPlay Workshops <workshop@sysplay.in> 6 All Rights Reserved.
  • 7. FS for Operating System Also referred as the Root File System (RFS) A Minimal RFS should contain the following Binaries (/bin, /sbin) Libraries (/lib) Devices (/dev) Configurations (/etc) Virtual File Systems (/proc, /sys) Application Temporary File (/tmp) Variable Data from Daemons & Utilities (/var) User Data (/root, /home) – optional Mount points (/mnt, /media) – optional Additional software (/usr, /opt) - optional Bootloader files (/boot) – optional © 2010-14 SysPlay Workshops <workshop@sysplay.in> 7 All Rights Reserved.
  • 8. Building a Root File System Involves Creating & Populating the complete directory structure, appropriately Putting that in the desired FS type Either on the host & then transferring it to the target, or directly on the target Various sources Binaries – Application Sets (busybox, ...) Libraries – Toolchain Libraries (glibc, uClibc, …) Devices – Create by Hand, Or Device package Virtual & Temporary Files – Create by Hand Configuration & Variable – Created as required Many a times, a more easier way is Start with a reference RFS Add-on whatever needed © 2010-14 SysPlay Workshops <workshop@sysplay.in> 8 All Rights Reserved.
  • 9. busybox – A special mention busybox is so-called a Swiss Knife Contains reduced size versions of the most commonly used Unix utilities, all in a single executable Shell environment being just the starting point It provides init system as per System V standard Startup applications & Service daemons mdev: Light-weight udev implementation TinyLogin: Set of logging utilities … Building it is similar to any other OSS © 2010-14 SysPlay Workshops <workshop@sysplay.in> 9 All Rights Reserved.
  • 10. Building the busybox Untar the busybox Get into its folder make menuconfig Select the required options make make CONFIG_PREFIX=<path_to_rootfs> install © 2010-14 SysPlay Workshops <workshop@sysplay.in> 10 All Rights Reserved.
  • 11. Creating the Root Filesystem Add the required directories dev, dev/pts, etc, etc/init.d, lib, mnt, opt Update the fstab to have proc and /dev/pts filesystems mounted automatically proc /proc proc defaults 0 0 none /dev/pts devpts mode=0622 0 0 Add the files required by the login utilities Add root:x:0:root in etc/group Add root:0:0:0:/root:/bin/ash in /etc/passwd Add 127.0.0.1 localhost in etc/hosts Copy the following from Templates/CreatingRootFs/Target/etc/ (available from Downloads section of http://sysplay.in) Add the inittab file Add the init.d/rcS Add the mdev.conf file © 2010-14 SysPlay Workshops <workshop@sysplay.in> 11 All Rights Reserved.
  • 12. Adding the shared Libraries cd lib cp – r /usr/local/angstrom/arm/arm-angstrom- linux-gnueabi/lib/ * arm-linux-strip * © 2010-14 SysPlay Workshops <workshop@sysplay.in> 12 All Rights Reserved.
  • 13. Creating the Ram Disk Create the 16M file of 'zero' dd if=/dev/zero of=rd-ext2.bin bs=1k count=16384 Create the empty filesystem mke2fs -F -m 0 -b 1024 rd-ext2.bin Fill the filesytem with contents mount -t ext2 rd-ext2.bin /mnt -o loop tar -C Target -cf - . | tar -C /mnt -xf - Arguments to be passed to the Kernel root = /dev/ram0 rw ramdisk_size=16384 initrd=0x90000000,16M © 2010-14 SysPlay Workshops <workshop@sysplay.in> 13 All Rights Reserved.
  • 14. Choosing RFS Types initramfs – For initial board bringup cycles nfs – For initial development squashfs – For read only storage jffs2 – For flash-based storage ext* - For large size storage … Please note that, we can't use any of fat, vfat, ntfs, … As they do not support device & special files on them ext3 supports 7 different types of files © 2010-14 SysPlay Workshops <workshop@sysplay.in> 14 All Rights Reserved.
  • 15. HOWTO of a Read Only FS Most of the Embedded System FS are Created on the Host, as images And then transferred to the Target Let's take an Example: squashfs Creating (on Host) mksquashfs [options] <rfs_dir> <img_file> Transferring (on Target) dd if=<img_file> of=<part_for_fs> © 2010-14 SysPlay Workshops <workshop@sysplay.in> 15 All Rights Reserved.
  • 16. Creating initramfs Done during Kernel Building Before building the Kernel, configure the following Under “General setup” Enable “Initial RAM filesystem … support” Set the “Initramfs source file(s)” to the RFS dir © 2010-14 SysPlay Workshops <workshop@sysplay.in> 16 All Rights Reserved.
  • 17. Root File System over NFS Enable NFS mount of the RFS directory on the host Update the Target's Kernel image with Root over NFS feature enabled On the target, add the following to the bootargs, before booting root=/dev/nfs nfsroot=<host_ip>:<rfs_dir_on_host> Argument for assigning an IP address Boot the target to use the RFS over NFS © 2010-14 SysPlay Workshops <workshop@sysplay.in> 17 All Rights Reserved.
  • 18. What about swap partition? Purposes of swap partition (on Desktop) Process Swapping in case Memory is less Hibernation Embedded Systems Has less Memory. So, if there is swap, it would be used frequently. But where? Flash??? What about its write cycles, write levelling? Typically, no Hibernation needed Hence, no swap on Embedded Systems © 2010-14 SysPlay Workshops <workshop@sysplay.in> 18 All Rights Reserved.
  • 19. Other File Systems / → Root File System → One particular FS However, subdirectories under / could be On other Partitions, Or Even other File Systems Examples: / → initramfs; /home → jffs2 / → squashfs; /var & /tmp → tmpfs / → jffs2; /home → ext2 or fat © 2010-14 SysPlay Workshops <workshop@sysplay.in> 19 All Rights Reserved.
  • 20. Feature-specific File Systems Journalizing FS: ext2 vs ext3 Read-only FS vs Mounting Read-only Compressed FS: cramfs, squashfs Flash-Specific FS: jffs2 Temporary Storage: ramfs, tmpfs, ... © 2010-14 SysPlay Workshops <workshop@sysplay.in> 20 All Rights Reserved.
  • 21. What all have we learnt? W's of File System Building a Root File System Building the BusyBox Creating Ramdisk Booting Through NFS © 2010-14 SysPlay Workshops <workshop@sysplay.in> 21 All Rights Reserved.
  • 22. Any Queries? © 2010-14 SysPlay Workshops <workshop@sysplay.in> 22 All Rights Reserved.