29c3 The Lanyard Filesystem

22
Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 1 The Lanyard File System Dan Luedtke CCC Munich Master's Thesis Project: LanyFS

Transcript of 29c3 The Lanyard Filesystem

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 1

The Lanyard File System

Dan LuedtkeCCC Munich

Master's Thesis Project: LanyFS

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 2

About LanyFS

The Lanyard file system (LanyFS) was designed for removable storage devices, particularly those small gadgets one would carry around using a lanyard. LanyFS Specification v1.4

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 3

Challenge

● Which file system would you use?● Is it supported by the computer (read/write)● Is it supported by the TV (read)● Does it support file sizes >4 GiB

● How would you avoid file ownership problems?● Which file permissions would you set for...

● User? Group? Other?

Store an 8 GiB HD movie file on a removable storage device, plug the device into your multimedia TV and open the file for watching.

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 4

Problem

● File Systems are... ● Easy to implement● Free of weird licensing● Widely deployed

● Pick up to two, you cannot have all :)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 5

LanyFS Design Principles

● Simplicity● Avoid complexity● “Would a drunken monkey be

able to implement this?”● Interoperability

● Provide the minimum consensus● Drop OS-specific features

● Flexibility● Format small flash cells as well as multi-TiB

external hard drives

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 6

Features

● rooted binary trees for fast searching● write counters for non-data blocks● block addresses of variable length● different block sizes● creation time● modification time● optional attributes (flags)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 7

Features

● LanyFS lacks of...● access time● distinction between change and modification

time● ownership information● access control lists● traditional UNIX permissions

● Yes, we call this a list of features, too!

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 9

Device

Block-based

● Everything is a block● Superblock● File Block● Directory Block● Raw Data Block● and a few more...

Block 0 Block 1 Block 2 Block n-2 Block n-1...

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 10

Adding logic

x Block

Other Block

y Block

● Structure of stored data is represented by linking the blocks

● Examples● Superblock pointing to the root directory● File block (indirectly) pointing to data blocks

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 12

State of Affairs

● Experimental Linux Kernel driver● FreeBSD-driver is being worked on● TODO

● Create liblany● Create resizefs.lany● Improve -v mode of mkfs.lany● Create a r0cket driver :)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 13

Get involed!

Dan Luedtke

@ [email protected]

t danrlde

U muCCC assembly 0x0a

www.nonattached.net/lanyfs

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 1

The Lanyard File System

Dan LuedtkeCCC Munich

Master's Thesis Project: LanyFS

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 2

About LanyFS

The Lanyard file system (LanyFS) was designed for removable storage devices, particularly those small gadgets one would carry around using a lanyard. LanyFS Specification v1.4

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 3

Challenge

● Which file system would you use?● Is it supported by the computer (read/write)● Is it supported by the TV (read)● Does it support file sizes >4 GiB

● How would you avoid file ownership problems?● Which file permissions would you set for...

● User? Group? Other?

Store an 8 GiB HD movie file on a removable storage device, plug the device into your multimedia TV and open the file for watching.

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 4

Problem

● File Systems are... ● Easy to implement● Free of weird licensing● Widely deployed

● Pick up to two, you cannot have all :)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 5

LanyFS Design Principles

● Simplicity● Avoid complexity● “Would a drunken monkey be

able to implement this?”● Interoperability

● Provide the minimum consensus● Drop OS-specific features

● Flexibility● Format small flash cells as well as multi-TiB

external hard drives

LanyFS was designed with three principles in mind:

o Simplicity. LanyFS avoids any unnecessary complexity whithout loosing track of scalability. It deals with the limited capabilities of embedded hardware as well as with the power of state-of-the-art computing systems. Simplicity is seen as the key to not loosing one party or another.

o Interoperability. LanyFS was designed to unite those features which are common on most operating systems and not to

accumulate all specific features in one big filesystem. Making the stored data available to the mounting system has precedence over protecting it from being read or modified. All information, including file and directory metadata, is stored in the most purposive format without honoring the habits of any particular operating system.

o Flexibility. LanyFS adapts to the underlying storage device by adjusting its parameters accordingly. It can address block devices starting from 4 KiB up to 64 ZiB with minimal overhead by parameterizing the filesystem at formatting time.

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 6

Features

● rooted binary trees for fast searching● write counters for non-data blocks● block addresses of variable length● different block sizes● creation time● modification time● optional attributes (flags)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 7

Features

● LanyFS lacks of...● access time● distinction between change and modification

time● ownership information● access control lists● traditional UNIX permissions

● Yes, we call this a list of features, too!

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 9

Device

Block-based

● Everything is a block● Superblock● File Block● Directory Block● Raw Data Block● and a few more...

Block 0 Block 1 Block 2 Block n-2 Block n-1...

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 10

Adding logic

x Block

Other Block

y Block

● Structure of stored data is represented by linking the blocks

● Examples● Superblock pointing to the root directory● File block (indirectly) pointing to data blocks

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 12

State of Affairs

● Experimental Linux Kernel driver● FreeBSD-driver is being worked on● TODO

● Create liblany● Create resizefs.lany● Improve -v mode of mkfs.lany● Create a r0cket driver :)

Dan Luedtke <[email protected]> ● www.nonattached.net/lanyfs ● Fri, December 28, 2012 ● 29C3 Hamburg ● Slide 13

Get involed!

Dan Luedtke

@ [email protected]

t danrlde

U muCCC assembly 0x0a

www.nonattached.net/lanyfs