week 6 - L6 - File System Flashcards

1
Q

catching

  • what does it improve?
  • example of when Linux uses it
  • what’s it used for?
  • what does Linux keep in memory?
A
  • Linux relies heavily on caching to improve performance

o For example when it tries to retrive a file from the file system

  • Linux keeps in memory:
    o Recently accessed disk blocks
    o The inode of each open file in the file system
    o A cache of recent name to inode mappings
    o A directory offset cache
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Disk encryption

  • what is it
  • what does it use to do it
  • why is it used
  • what is Full Disk Encryption (FDE)
  • which areas are not encrypted
A
  • Disk encryption is a technology which protects information by converting it into unreadable code that cannot be deciphered easily by unauthorised people
  • Disk encryption uses disk encryption software or hardware to encrypt every bit of data that goes on a disk or disk volume
  • It’s used to prevent unauthorised access to data storage
  • Expressions full disk encryption (FDE) or whole disk encryption signify the everything on disk is encrypted

o But the master boot record MBR or similar area of bootable disk, with code that starts the operating system loading sequence is not encrypted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Logical volume management LVM

  • where can a file system be?
  • what does it need to spam on different hard drives?
A

Logical volume management LVM

  • A filesystem can be made directly on top of a partition, or it can span over several partitions, possibly on different hard drives, with the aid of an intermediate logical volume management LVM layer
  • LVM introduces a greater level of flexibility into storage management than partitioning alone
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Device mapper

  • what does it create? out of what?
  • what does it map?
A
  • In Linux the device mapper creates new block (storage) devices out of other nodes
  • It is a framework provided by the Linux kernel for mapping physical block devices onto higher-level virtual block devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In memory data structures

  • what does the kernel maintin?
  • what do the entries contain?
  • what table does each process contain(not the page table)? and what does it describe?
  • what do these entries point to
  • what mark does a process have?
A
  • The kernel maintains a system-wide table that describes open files
  • Each entry contains
    o The read/write MARK which indicates where the next data block is to be read
    o A pointer to an entry in the active inode table, so that the access times can be modified efficiently
  • Each process maintains a user file table that describes the files opened by the process

o Entries in the user file table point to system-wide file table

  • A process can have its own private read/write mark or it can share a read/write mark as it’s the case when a new process is created via fork)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Mount table

  • what is it?
  • what do the entries contain?
  • WHAT DOES THE KERNEL DO WHEN TRANSLATING A PATHNAME?
A
  • Internally the Linux kernel maintains a mount table that keeps information about the mounted file systems
  • Each entry on the table contains:
    o The device number of the partition that has been mounted
    o A pointer to the buffer containing the super block for the file system
    o A pointer to the root inode of the file system
    o A pointer to the inode of the directory in which the file system is mounted (pointer to the parent directory)

As the kernel is translating a path name, it consults the mount table as needed

To show the mount table use cat/proc/mounts or the bare mount command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Mount File Systems

  • what directory is often used to mount a file system?
  • can other directories be used for mounting file systems?
  • what commands does the mount command take?
A
  • The Linux filesystem hierarchy is a tree
    o It consists of the root file system “/”, together with other (optional) file systems mounted at “grafted points” in the root tree
  • In order to access a file system it must be mounted
  • The /mnt directory is often used to mount a file system temporarily but any directory can be used (existing hierarchy below the mount point becomes hidden
  • The mount command is used to attach a file system found on some device to the larger file system tree and takes in two arguments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

mount table

  • what information does it keep?
  • what does an entry contain?
  • when is it consulted?
  • what command should be used to show the mount table?
A
  • Internally the Linux kernel maintains a mount table that keeps information about the mounted file systems
  • Each entry on the table contains:
    o The device number of the partition that has been mounted
    o A pointer to the buffer containing the super block for the file system
    o A pointer to the root inode of the file system
    o A pointer to the inode of the directory in which the file system is mounted (pointer to the parent directory)

As the kernel is translating a path name, it consults the mount table as needed

To show the mount table use cat/proc/mounts or the bare mount command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Listing inode numbers

  • what is a directory
  • command to see directory details
A

Listing inode numbers
A directory is a list of file names and inode numbers
To show this use ls - i command inside a directory to list the file names and inode numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Hard vs Symbolic Links

A

Hard vs Symbolic Links
- Each file in a filesystem is identified by a number called an inode
- Two types of links can be made to a file:
o Hard link
o Soft or symbolic link

  • Hard link
    o Let’s you assign a different name to a file in a different location but essentially is the same file
    o The key that links the files together is the inode number
    • A new hard link just creates a reference to the same underlying inode of a given file
    • When you delete a file it removes that link
  • A symbolic link
    o Is like a shortcut from one file to another ( like the shortcuts on desktop on windows)
    • The benefit of a symbolic/short link is that you can link to files on different partitions and on other devices
    • Symbolic links can span filesystems, and the file pointed to need not exist, at which point the symbolic link is “dangling”
    • A symbolic link point to another file by name not inode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

hard link

A
  • Hard link
    o Let’s you assign a different name to a file in a different location but essentially is the same file
    o The key that links the files together is the inode number
  • A new hard link just creates a reference to the same underlying inode of a given file
  • When you delete a file it removes that link
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  • A symbolic link
A
  • A symbolic link
    o Is like a shortcut from one file to another ( like the shortcuts on desktop on windows)
  • The benefit of a symbolic/short link is that you can link to files on different partitions and on other devices
  • Symbolic links can span filesystems, and the file pointed to need not exist, at which point the symbolic link is “dangling”
  • A symbolic link point to another file by name not inode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The Inodes( Handle to File)

  • what structure is it?
  • what does it hold?
  • what information does it contain?
A
The Inodes( Handle to File)
-	Is an on-disk data structure 
  • Holds all the metadata about a file (other than naming)
  • It contains the following information
    o File access permission
    o File ownership indication
    o File type
    o Time of last access and modified
    o Number of links ( aliases to the file)
    o Pointers to the data blocks for the file
    o Size of file in bytes (for regular files) major and minor device numbers for special devices
  • An inode does not contain short or full path name of the file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Linux filesystem organization

  • the four elements
  • what do they contain
A
  • Boot block
    o Located in the first few sectors of a filesystem which contains the initial bootstrap program used to load the operating system
  • Super block
    o Describes the state of a file system i.e. the total size of the partition, the block size, pointers to a list of free blocks, the inode number of the root directory
  • Inodes
    o A linear array of inodes
    o Inodes = index nodes
    o Linux thinks of files in terms of inodes
    o There is a one to one mapping from files to inodes, and vice versa
  • Data blocks
    o Contains the actual data of the files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Master Boot Record

  • where is it
  • what does it contain
  • what special code does it contain
  • what’s the limit of a MBR in terms of maximum storage and primary partitions
A
  • A master boot record(MBR) is a special type of boot sector at the beginning of partitioned storage device
  • The MBR contains information about how the partitions containing the file systems are organised on that medium
  • The first stage of the MBR also contains executable code to function as a loader (bootstrapping a chain of actions) for the installed operating system
  • The organization of the partition table in the master boot record limits the maximum addressable storage to 2TiB with 4 primary partitions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Information about the partitions MBR

  • what does MBR store
  • how many partitions do MBR based disks have
  • how big are they
  • what can happen to have more partitions
  • what does UEFI do
  • how many partitions does the alternative have
A

In many Linux system information about the partitions is stored in a small sector at the beginning of the disk called the Master Boot record (MBR)

  • MBR based disks can only have 4 primary partitions (sectors at offsets greater than 2tb are not addressable with this scheme)
  • One MBR primary partition can be substitute for an extended partition in which up to 16 logical partitions can be created which are organised using a linked list
  • The Unified Extensible Firmware Interface (UEFI) defines a new format for specifying partition information known as globally Unique Identified (GUID)
  • In this case we have
    o Partition Table (GPT) allowing up to 128 partitions on disk. GPT disks are beginning to replace MBR based disks
  • There are several utilities for creating and configuring partitions including fdisk (for MBR partitions) and gdisk (for GPT partitions)
17
Q

File system – the physical structure

  • what does the OS do?
  • what can a file be split in?
  • how do these things sit?
  • what’s handled by the OS?
A

Handled by the operating system

  • Find enough space to store files (not necessarily contiguous)
  • Active data transfer
  • Updates the appropriate tables to be able to recover files
  • A file can be split int different blocks
  • Blocks do not need to sit next to each other
18
Q
  • how is the hard drive divided
  • what are they
  • example of linux partition and how it works
A
  • Hard drives are divided into contiguous ranges of sectors called partitions
  • Partitioning the disk refers to breaking up the hard drive into sections
    o Each section being independent of others
  • For example with Linux, one partition will be used as swap space which is space on the hard drive that can be used as virtual memory allowing the OS to run large programs even if it does not have enough physical RAM to do so
19
Q

Filesystem - where does it reside?

  • Example of block device
  • what does a storage device consists of
  • how does a partition work
  • block size of floppy disc and CDROM
A
  • In general, a filesystem resides on a block device which consists of a sequence of storage blocks but is generally random access
  • The simplest example of a block device is a hard disk partition
    o where you read and write one block of data at a time
    o but more complex block devices can be constructed such as RAID, LVM and encrypted devices
  • The underlying block size is associated with a storage medium
    o 512 bytes with magnetic devices (floppy drivers)
    o 2048 bytes with optical drivers( CDROM)
  • Many Linux tools such as df(disk filesystem) will produce output in terms of 1KB(1024bytes) block size which is translated from physical block sizes
20
Q

Directory structure

  • how to represent the root in Linux and Windows?
  • what does the root contain?
  • what is Linux?
  • what does each user receive?
  • to who is a directory accessible?
A

Root(/)
- The root of the file system is represented by a forward slash (/) and is the top of the directory tree containing the OS installation
/home

  • Linux is a multi user environment
  • Each user is assigned a specific directory
    o (user home directory such as /home/alan)o This is accessible only to them and the system administrator
    o Contains user specific files
21
Q

File system – Visualisation

  • windows paths
  • windows disk
  • Linux paths
  • Linux disks
A
  • Desktop – uses folders and files
  • Each O.S. shows the file system in their own way:
  • In windows
    o The root is the desktop
    o The nodes in the pathname are separated by “\”
    o Each disk has a device letter (C,D etc)
  • In Linux
    o The root start from the root directory, it is shown with “/”
    o The nodes in the pathname are separated with “/”
    o The hard disks are hidden In the file system
22
Q

Pathname absolute and relative

A

Pathname absolute and relative
- A file can be specified in :
o Full – absolute pathname, from the root
o. relative - from the current folder

23
Q

File system – Pathname

A
  • The path ( or pathname) is the order of the folder names (separated by “\”) that must be opened to reach the file
    o
  • Along with the name, uniquely identifies a file because each file system file is identified based on its position in the tree, that is, the path that must be followed to reach it from the root
    o For example you can have two files with the same name, in 2 different locations, because the path to them is different
24
Q

file hierachicarchy

- Linux vs windows

A

The file system has a hierarchical tree structure in which the systems starts from a root, and the data files are at the end(leaves)

  • No single directory where the entire structure is headed (called root) the highest level of the hierarchy
  • In Windows, the disk drives on which they reside folders root (basically C, D or those)
25
Q

Files needs to be changed

os needs to provide mean for the OS to:

A

Files need to be changed, so the OS needs to provide means to:

  • Create
  • Write
  • Read
  • Reposition within file (seek)
  • Delete
  • Truncate
  • Open (load into memory)
  • Close (store to disk)
26
Q

what attributes does a file have

A
File attributes and operations
A file has the following identifiers 
-	Name 
-	Identifier
-	Type
-	Location 
-	Size
-	Protection
-	Time, date
-	Extended attributes
27
Q

File system
access permission definition
permissions for different people

A
  • In some of the file systems there are access permissions (user speciied that creates the file
    o This include what an user can do (read, write, execute)
-	Access permissions to files:
o	Read (R) – indicates whether the contents of a file or folder can be read 
o	Write (W) – indicates whether you can edit the contents of a file or folder 
o	Execute (X) – indicates whether you can run a file or position within a folder 
  • You can set access permissions separately for the file’s owner for users belonging to the same group and for the remaining users
    o (basically different users can have different access permission conditions)
28
Q

File

  • what are they
  • what must happen to interpret the contents of a file correctly
  • format
  • endings
  • are the endings needed
  • how does the os know the file type
  • how must the encoding be
  • how must the information be inside files
  • what does the format of a file depend on
A

File

  • The information is stored on those statements in “containers” called files or documents
  • Programs manipulate information stored on file so they can be reused in subsequent sessions
  • To interpret the contents of a file correctly, a program must recognise and interpret the format
  • The format of a file is made explicit by adding the right extension to the name (So basically file then format (document.doc))
  • The extension is composed of 3 or 4 characters
  • The use of extensions is only a convention
    o Comfort for the user (for example when we have multiple files with the same name)
    o The OS uses the information on the nature of the file at the start of the file
     The OS doesn’t need it. It’s just for the user
  • The FORMAT of the files depends on the nature of information
  • The information contained in a file are all uniform size
    o You can not have binary and text together
    o Encoding must be homogeneous
     Same type of info
    o Each byte contained in a text file is interpreted as a character according to a particular encoding
     (for example number and letters are all characters)
  • They are shown with a generic editor
  • Programs that use files provide specific extension, such as
    o .java to the code of a program written in java
    o .c to the code of C
    o Html for web pages
29
Q

file system

  • what is it?
  • what are its functions?
  • what types of mass memory are generally present in a system?
  • what are the names for the units in Linux and Windows?
A

FILE SYSTEM is the O.S. component that provides the management of information residing on storage devices

It has the following functions:

  • Retention
  • Updating
  • Cancellation

In a system are generally present several types of mass memories
- HD, Floppy, CD/DVD, flashy disk

Different operating systems use different names for units
In the windows environment it uses a letter followed by a colon
- C:\ D:\ E:\
In UNIX/LINUX use / followed by the names of the standard devices
- / is root