diff options
| author | Jan Altenberg <jan@linutronix.de> | 2011-01-24 10:02:59 +0100 |
|---|---|---|
| committer | Jan Altenberg <jan@linutronix.de> | 2011-01-24 10:02:59 +0100 |
| commit | c6e4660a7ea2bbd11fe105af4f650e3c10306e37 (patch) | |
| tree | 4b3247872669814709644429f5d8ac6408e8efce | |
| parent | 482c846744218fb4e6ae3a694c2ad1bea1642439 (diff) | |
New chapter: filesystems
Short overview
| -rw-r--r-- | linux-basics/filesystems/Makefile | 9 | ||||
| -rw-r--r-- | linux-basics/filesystems/pres_filesystems_en.tex | 252 |
2 files changed, 261 insertions, 0 deletions
diff --git a/linux-basics/filesystems/Makefile b/linux-basics/filesystems/Makefile new file mode 100644 index 0000000..4663d52 --- /dev/null +++ b/linux-basics/filesystems/Makefile @@ -0,0 +1,9 @@ +all: + for pdf in `ls -1 *.tex` ; do \ + pdflatex $$pdf; \ + pdflatex $$pdf; \ + done + +clean: + rm -f *.aux *.log *.pdf *.log *.snm *.toc *.vrb *.nav *.out + diff --git a/linux-basics/filesystems/pres_filesystems_en.tex b/linux-basics/filesystems/pres_filesystems_en.tex new file mode 100644 index 0000000..7dd5f57 --- /dev/null +++ b/linux-basics/filesystems/pres_filesystems_en.tex @@ -0,0 +1,252 @@ +\documentclass[11pt]{beamer} + +%\usepackage{ngerman} +\usepackage{times} +\usepackage{graphicx} +\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps} +\usepackage{amsmath,amssymb} +\usepackage[latin1]{inputenc} +\usepackage{listings,color} +\definecolor{lbcolor}{RGB}{255,210,150} +\lstset{ + language=C, + numbers=left, + stepnumber=1, + numbersep=5pt, + numberstyle=\tiny, + breaklines=true, + breakautoindent=true, + postbreak=\space, + tabsize=2, + basicstyle=\ttfamily\footnotesize, + showspaces=false, + showstringspaces=false, + extendedchars=true, + backgroundcolor=\color{lbcolor}, + keywordstyle=\bf , + commentstyle=\color{green}, + stringstyle=\color{red} +} + +\mode<presentation> +{ + \usetheme{linutronix} +} + +% on the following slides, include icon in the left sidebar +\def\lximg{/usr/share/lx/icons/fueller.png} + +\title{Filesystems} +\institute{Linutronix GmbH} + +\begin{document} + +\frame{ \titlepage } + +% stop displaying 'fueller.png' on the following slides +\def\lximg{none} + +\begin{frame} +\frametitle{Filesystem types} +\begin{itemize} +\item Filesystems for block devices +\item Filesystems for flash devices +\item Network filesystems (e.g. NFS) +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Filesystems for block devices} +\begin{itemize} +\item EXT2 +\item EXT3, EXT4 +\item ReiserFS +\item XFS +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Flash filesystems} +\begin{itemize} +\item JFFS2 +\item YAFFS2 +\item LogFS +\item UbiFS +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Journalling Filesystems} +\begin{alertblock}{What is a journalling filesystem?} +A ''Journalling Filesystem'' keeps track of all changes in a special memory area +(the journal). Based on the informations in the journal, files can be +reconstructed if a write access gets interrupted (for example by a system +crash or a power failure). +\end{alertblock} +\end{frame} + +\begin{frame} +\frametitle{Technical terms} +\begin{itemize} +\item Block: Filesystems are usually organised in blocks. Small blocks won't +waste that much memory for small files; large blocks will increase the maximum +size of a filesystem +\item Inode: Stores information about regular files, directories, ... +\item Superblock: The superblock stores all information about the filesystem +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{EXT2} +\begin{itemize} +\item \textbf{N}o journalling filesystem +\item A good choice for ''flash-based block devices'', like SD cards or USB +sticks (ext2 minimizes the number of writes) +\item Supported block sizes: 1kb, 2kb, 4kb, 8kb +\item Max. filesystem size: 32TB (for 8kb blocks) +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{EXT3} +\begin{itemize} +\item \textbf{Journalling} filesystem +\item Three levels of journalling available: journal, ordered, writeback +\item Backward compatible with EXT2 +\item Limited to 32.000 sub-directories +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{EXT4} +\begin{itemize} +\item \textbf{Journalling} filesystem +\item Backward compatible with EXT2 and EXT3 +\item Faster filesystem checking +\item Filesystem size up 1 exabyte +\item Journal checksumming +\item \textbf{No longer} limited to 32.000 sub-directories +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{XFS} +\begin{itemize} +\item \textbf{Journalling} filesystem +\item max. FILESIZE: 8 Exabyte ! +\item Online defragmentation (using xfs\_fsr) +\item Online resizing (using xfs\_growfs) +\item Good choice for servers (e.g. file servers) +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{JFFS2} +\begin{itemize} +\item Flash filesystem +\item Used on top of MTD devices +\item All nodes must be scanned at mount time +\item Mount time and memory consumption linearly depend on the filesystem size +\item \textbf{No} powerfail safety +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{UbiFS} +\begin{itemize} +\item Flash filesystem +\item Used on top of UBI volumes +\item Fast mount time +\item Supports LZO and ZLIB compression +\item Powerfail safety !!! +\end{itemize} +\end{frame} + +\begin{frame} +\frametitle{Recommendations} +\begin{itemize} +\item ''Flash-based block devices'': EXT2 +\item Block devices: EXT3, EXT4 +\item Block devices which are used in server machines (on which huge amounts +of data are stored): XFS +\item Flash devices: UbiFS +\end{itemize} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Creating filesystems} +\begin{lstlisting}[keywordstyle=\ttfamily\footnotesize] +# EXT2 filesystem in a file +$ dd if=/dev/zero of=ext2.img \ + bs=2048 count=1024 +$ /sbin/mkfs.ext2 -b 2048 ext2.img +myext2.img is not a block special device. +Proceed anyway? (y,n) y +Filesystem label= +OS type: Linux +Block size=2048 (log=1) +Fragment size=2048 (log=1) +256 inodes, 1024 blocks +51 blocks (4.98%) reserved for the super user +First data block=0 +1 block group +16384 blocks per group, 16384 fragments per group +256 inodes per group +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Creating filesystems} +\begin{lstlisting}[keywordstyle=\ttfamily\footnotesize] +# EXT2 filesystem on a disk partition +mkfs.ext2 -b 2048 /dev/sdb2 +# Checking an EXT2 filesystem +fsck.ext2 /dev/sdb2 +# Mounting an EXT2 partition +mount -t ext2 /dev/sdb2 /mountpoint +# or just +mount /dev/sdb2 /mountpoint +\end{lstlisting} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Testing filesystems for block devices} +\begin{lstlisting}[keywordstyle=\ttfamily\footnotesize] +# 1) Mounting a filesystem which is located in a file +mount -o loop ext2.imt /mountpoint +# 2) Mounting a specific partition of a complete disk image +$ fdisk -lu bla.img +255 heads, 63 sectors/track, 0 cylinders, total 0 sectors +Units = sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +[...] + Device Boot Start End Blocks Id System +bla.img1 63 64259 32098+ 83 Linux +# Now multiply the start offset (63) with +# the sector size (512) = 32256 +$ mount -o offset=32256 /mountpoint +\end{lstlisting} +\end{frame} + +\begin{frame} +\frametitle{Testing flash filesystems} +\begin{itemize} +\item You can emulate flash devices on your host system, if you want to test +your flash filesystem +\item \textbf{mtdram} can emulate NOR devices +\item \textbf{nandsim} can emulate NAND devices +\item This will be covered in a different chapter +\end{itemize} +\end{frame} + +\section*{sources} +\begin{frame} +\begin{thebibliography}{1} +\bibitem{ext2} http://en.wikipedia.org/wiki/Ext2 +\bibitem{ext3} http://en.wikipedia.org/wiki/Ext3 +\bibitem{ext4} http://en.wikipedia.org/wiki/Ext4 +\bibitem{xfs} http://en.wikipedia.org/wiki/XFS +\bibitem{UBIFS} http://en.wikipedia.org/wiki/UBIFS +\end{thebibliography} +\end{frame} +\end{document} |
