1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block filesystems Michael.

Slides:



Advertisements
Similar presentations
Linux Installation LINUX INSTALLATION. Download LINUX Linux Installation To install Red Hat, you will need to download the ISO images (CD Images) of the.
Advertisements

GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Week:#14 Windows Recovery
Welcome Thank you for attending this special Computer Club event Day 2 of the 4 Day Linux Tutorial –Linux Installation.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
Objectives Learn what a file system does
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Tutorial 11 Installing, Updating, and Configuring Software
Computers in the real world Objectives Understand what is meant by memory Difference between RAM and ROM Look at how memory affects the performance of.
Boot Diskettes, Bootable USB Keys and Live CDs Used when the computer can't start for some reason, as a diagnostic, repair and recovery tool. Boot diskettes.
Chapter Fourteen Windows XP Professional Fault Tolerance.
Seminar on Linux-based embedded systems
Ch 6. Performance Rating Windows 7 adjusts itself to match the ability of the hardware –Aero Theme v. Windows Basic –Gaming features –TV recording –Video.
Please Note: Information contained in this document is considered LENOVO CONFIDENTIAL For Lenovo Internal Use Only Do Not Copy or Distribute!! For Lenovo.
From UEFI Shell to Linux - UEFI Linux BootLoader Zhang Rui Software Engineer Sep 28 th 2011.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
1 Objectives Manage and install new file systems.
WINDOWS XP PROFESSIONAL AUTOMATING THE WINDOWS XP INSTALLATION Bilal Munir Mughal Chapter-2 1.
Guide to MCSE , Second Edition, Enhanced 1 File Storage Basics Basic storage Centers on partitioning physical disk Dynamic storage New method supported.
Computer Systems Week 14: Memory Management Amanda Oddie.
Journaled Component Files John Scholes and Richard Smith 13 October, 2008 Or – How to never see FILE DAMAGED again!
Linux+ Guide to Linux Certification Chapter Six Linux Filesystem Administration.
Chapter 11 – File-System Implementation (Pgs )
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
| nectar.org.au NECTAR TRAINING Module 9 Backing up & Packing up.
Page 1 of 38 Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Please Note: Information contained in.
Implementation Method Linux-USB Gadget Framework –The Linux-USB Gadget Framework makes it easy for peripherals and other devices embedding GNU/Linux system.
XIP – eXecute In Place Jiyong Park. 2 Contents Flash Memory How to Use Flash Memory Flash Translation Layers (Traditional) JFFS JFFS2 eXecute.
Linux Filesystem Administration
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux Conference.
Installing Linux: Partitioning and File System Considerations Kevin O'Brien Washtenaw Linux Users Group
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Free Electrons Introduction.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux Conference.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux system development.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Scratchbox The Scratchbox.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block filesystems Michael.
1 Remote Installation Service Windows 2003 Server Prof. Abdul Hameed.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com SSH Thomas Petazzoni Free.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux Training System.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux Conference.
Boot Diskettes, Bootable USB Keys and Live CDs Used when the computer can't start for some reason, as a diagnostic, repair and recovery tool. Boot diskettes.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
Windows Vista Configuration MCTS : Maintenance and Optimization.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
By Ganesan Alagu Ganesh Feb 26, 2008
Implementation of Embedded OS
Ottawa Linux Symposium 2007
Lesson 22: Configuring System Recovery
Free Transactions with Rio Vista
Guide to Linux Installation and Administration, 2e
Computer System Laboratory
Memory Key Revision Points.
By Ganesan Alagu Ganesh Feb 21, 2008
UBUNTU INSTALLATION
Chapter 12: File System Implementation
Linux device driver development
Penguin Weight Watchers
File Management.
Operating System Module 1: Linux Installation
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
IS3440 Linux Security Unit 7 Securing the Linux Kernel
Free Transactions with Rio Vista
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
2.C Memory GCSE Computing Langley Park School for Boys.
Computer System Laboratory
Instructor Materials Chapter 5: Windows Installation
Presentation transcript:

1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block filesystems Michael Opdenacker Thomas Petazzoni Free Electrons © Copyright , Free Electrons. Creative Commons BY-SA 3.0 license Latest update: 10/2/2016, Document sources, updates and translations: Corrections, suggestions, contributions and translations are welcome!

2 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Block vs. flash Storage devices are classified in two main types : block devices and flash devices They are handled by different subsystems and different filesystems Block devices can be read and written to on a per-block basis, without erasing, and do not wear out when being used for a long time Hard disks, floppy disks, RAM disks USB keys, Compact Flash, SD card, these are based on flashes, but have an integrated controller that emulates a block device Flashe devices can be read, but writing requires erasing, and often occurs on a larger size than the “block” size NOR flash, NAND flash

3 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Traditional block filesystems Traditional filesystems Can be left in a non-coherent state after a system crash or sudden power-off, which requires a full filesystem check after reboot. ext2: traditional Linux filesystem (repair it with fsck.ext2) vfat: traditional Windows filesystem (repair it with fsck.vfat on GNU/Linux or Scandisk on Windows)

4 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Journaled filesystems Designed to stay in a correct state even after system crashes or a sudden power-off All writes are first described in the journal before being committed to files Write an entry in the journal Write to file Application Write to file User- space Kernel space (filesystem) Clear journal entry

5 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Filesystem recovery after crashes Reboot Journal empty? Execute journal Filesystem OK Yes Thanks to the journal, the filesystem is never left in a corrupted state Recently saved data could still be lost Discard incomplete journal entries No

6 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Journaled block filesystems Journaled filesystems ext3: ext2 with journal extension ext4: the new generation with many improvements. Ready for production. They are the default filesystems for all Linux systems in the world. The Linux kernel supports many other filesystems: reiserFS, JFS, XFS, etc. Each of them have their own characteristics, but are more oriented towards server or scientific workloads btrfs (“Butter F S”) The next generation. In mainline but still experimental.

7 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Creating ext2/ext3 volumes To create an empty ext2/ext3 filesystem on a block device or inside an already-existing image file mkfs.ext2 /dev/hda3 mkfs.ext3 /dev/sda2 mkfs.ext2 disk.img To create a filesystem image from a directory containing all your files and directions Use the genext2fs tool, from the package of the same name genext2fs -d rootfs/ rootfs.img Your image is then ready to be transferred to your block device

8 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Squashfs Squashfs: Read-only, compressed filesystem for block devices> Fine for parts of a filesystem which can be read-only (kernel, binaries...) Great compression rate and read access performance Used in most live CDs and live USB distributions Supports LZO compression for better performance on embedded systems with slow CPUs (at the expense of a slightly degraded compression rate) Available in mainstream Linux since version Patches available for all earlier versions. Benchmarks: (roughly 3 times smaller than ext3, and 2-4 times faster)

9 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Squashfs - How to use Need to install the squashfs-tools package Creation of the image On your workstation, create your filesystem image: mksquashfs rootfs/ rootfs.sqfs Caution: if the image already exists remove it first, or use the -noappend option. Installation of the image Let's assume your partition on the target is in /dev/sdc1 On your target, copy the filesystem image on the device (CAUTION: don't run this on your workstation! You could destroy critical system partitions.) dd if=rootfs.sqfs of=/dev/sdc1 Mount your filesystem: mount -t squashfs /dev/sdc1 /mnt/root

10 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com tmpfs Useful to store temporary data in RAM: system log files, connection data, temporary files... Don't use ramdisks! They have many drawbacks: fixed in size, Remaining space not usable as RAM, files duplicated in RAM (in the block device and file cache)! tmpfs configuration: File systems -> Pseudo filesystems Lives in the Linux file cache. Doesn't waste RAM: grows and shrinks to accommodate stored files. Saves RAM: no duplication; can swap out pages to disk when needed. How to use: choose a name to distinguish the various tmpfs instances you could have. Examples: mount -t tmpfs varrun /var/run mount -t tmpfs udev /dev See Documentation/filesystems/tmpfs.txt in kernel sources.Documentation/filesystems/tmpfs.txt

11 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Mixing read-only and read-write filesystems Good idea to split your block storage into A compressed read-only partition (Squashfs) Typically used for the root filesystem (binaries, kernel...). Compression saves space. Read-only access protects your system from mistakes and data corruption. A read-write partition with a journaled filesystem (like ext3) Used to store user or configuration data. Guarantees filesystem integrity after power off or crashes. Ram storage for temporary files (tmpfs) Squashfs read-only compressed root filesystem ext3 read-write user and configuration data tmpfs read-write volatile data Block Storage RAM

12 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Practical lab – Block filesystems Creating partitions on your block storage Booting your system with a mix of filesystems: SquashFS for applications, ext3 for configuration and user data, and tmpfs for temporary system files.