Topic 15 – Disk management Flashcards
what is formatting known as within:
- windows
- linux
the “terminology” for this is
- windows
- formatting the disk
- linux
- building a file system
what gain is there for a file system by loading its intermeditae tables into memory
a file system will typically use these to hold the physcal address of eah block for the file
loading this into memory instead of leaving it on disk significantly increases performance
what is the basic syntax to mount a drive using the linux command
mount
for this:
mount -t file-system-type drive-name mount-directory
- -t file-system-type - specifies the file system type (if -t is ommited linux will inspect the partition for the file system type)
- drive-name - specifies the drive name (located in the /dev directory)
- mount-directory - specifies the directory upon which you wish to mount the file system
this disk operation would:
- directory
- same filesystem: A new filename entry is created and the original deleted
- different file system: a copy will be needed if moving to a new file system such as a separate disk drive and then a delete)
- intermediate data structures
- no change
- data blocks
- no change
what effect would a
MOVE disk operation
have on each each of the following
- directory
- intermediate data structures
- data blocks
- directory
- this will hold a file name and a reference to its inode
- inode
- this will hold metadata of the file such as:
- permissions
- ownership
- access time
- will also hold a reference to each block that the file is physically located in
- this will hold metadata of the file such as:
describe the data structure of linux
inodes
describe the linux directory
/dev/block
this linux directory will display all block devices that are currently attached.
The contents will display the block device as its major:minor device id that is used internally by linux.
These files in turn point to there associated file in the /dev directory
to deliver this an OS can use:
- Storing multiple copies of data structures on a disk
- Periodically flushing changes to the data structures held in disk
- i.e updating the data structures before the buffer is ready to make an I/O operation
- Journaling
name 3 methods upon which operating systems implement in order to
deliver a robust file system
explain the difference between a
partition table and a file system on a disk
- partition table
- is created by a partition scheme such as MBR and will reference any created partitions and where they are located
- file system
- this will occupy the disk and partitions it will include its own data structures that are used to reference the location of files
what is
GUID Partition Table (GPT)
a formatting scheme that allows for more flexibility such as a wider range of partition types
what effect would a
RENAME disk operation
have on each each of the following
- directory
- intermediate data structures
- data blocks
this disk operation:
- directory
- The filename entry is updated
- intermediate data structures
- no change
- data blocks
- no change
this is a file that contains details and options for any drives and partitions.
There are many options but a primary use is to configure drives here so they can be mounted on demand or on every boot
note
the option default is configured with many “default” options already set such as auto that means it will be mounted at boot time automatically
describe the linux directory
/etc/fstab
this linux command is used to mount a file system to the root directory hierarchy
describe the linux command
mount
what is the size of an
inode
this has the size of 1 block
(typically 512 bytes)
before taking this action you must create a new directory upon which to perform this on
the reason is that once this action is performed any files or directories within said directory will become inaccessible
what action should you perform
before mounting a file sytem to a directory and why
this is the act of placing a file system onto a disks partition
what is
formatting
this is a record held by the file system that holds changes that will be made
in the event of a power failure or crash this can be referenced in order to start a repair and carry out the tasks that didnt complete
what is
journaling
name 3 methods upon which operating systems implement in order to
deliver a robust file system
to deliver this an OS can use:
- Storing multiple copies of data structures on a disk
- Periodically flushing changes to the data structures held in disk
- i.e updating the data structures before the buffer is ready to make an I/O operation
- Journaling
what is the
Linux virtual file system (VFS)
this is a virtual files system that linux provides
it is a software layer that sits on top of all physical file systems
it provides common operations to the userspace such as open(2), stat(2), chmod(2), and similar system calls and aslo alllows different specific file systems to replace or supplement this with additional functionality
describe the
execution process of using extents
- the directory is looked at for the file name
- the file name holds a reference with it to its intermedite table (inode for linux)
- the intermediate table will reference the start and length of every extent
this has the size of 1 block
(typically 512 bytes)
what is the size of an
inode
within linux what will all attached devices be given and where can these attached devices be found
within linux:
- these are named by the OS
- they can be found within /dev directory
for this:
mount -t file-system-type drive-name mount-directory
- -t file-system-type - specifies the file system type (if -t is ommited linux will inspect the partition for the file system type)
- drive-name - specifies the drive name (located in the /dev directory)
- mount-directory - specifies the directory upon which you wish to mount the file system
what is the basic syntax to mount a drive using the linux command
mount
describe the linux command
mkfs
this stands for make file system and is used to build a file system on a disk or partitions
within linux:
- these are named by the OS
- they can be found within /dev directory
within linux what will all attached devices be given and where can these attached devices be found
describe the data structure of
extents
- directory
- this will hold the file name and its reference to an intermediate table
- intermediate table (inode for linux)
- this will hold the start and the length of every extent on disk
wha is an
extent
this is extent is a run of contigious blocks
these include:
- Mkfs.type disk-location
- Mkfs -t type disk-location
- type -* the type of file system to build on the disk or partition
- disk-location* - the location of the disk which will be located inside the /dev directory
describe two syntaxes for formatting a disk within the linux terminal
using mkfs
this can be mounted to any directory within linux
however the conventional directory is /mnt
what locations can a new file system be mounted to in linux
what is
Contiguous allocation
this is a method of allocating disk blocks to a file in an unbroken sequence
describe the basic sysntax for the linux command
chown
this will be:
Chown user:group file
- user:group - specifies the user and group that ownership is to be transferred to (if group is ommitted it is left unchanged)
- file - specidies the file upon which the action will take place
what is
journaling
this is a record held by the file system that holds changes that will be made
in the event of a power failure or crash this can be referenced in order to start a repair and carry out the tasks that didnt complete
give an example of
journaling in action
if a file is deleted then the first task is to delete the reference in the directory then the second task is to delete its Inode
if a power failure happened between these steps then journaling provides a way of ensuring that the inode is removed if journaling were not used then the inode would remain and disk space has been wasted (storage leak)
this is a CLI utility program within linux that can be used to create and manipulate partition tables on a disk
describe the linux command
fdisk
this includes
- A free space list is created
- Using a FAT based system a FAT table will be created
- A root directory is created using a block from the free space list
- The root directory is recorded in the FAT or inode
- The location of the root directory is recorded in the VBR which itself is held in the first sector of the disk (this means the OS can always get access to the root directory from here)
describe the five steps that take place under the hood when formatting a disk with the FAT file system
what is the linux
naming convention for disk drives
the linux OS will name these in the following way
- name will begin with sd (standing for SCSI drive)
- sd
- the next letter represents the drive and will increment with every drive
- sda
- the next number represents a partition and will increment with every partition on that drive
- sda1
also known as change owner is used to change the ownership of a file
describe the linux command
chown
- advantages
- Files can be allocated disk blocks in any order
- Appending data to a file is trivial
- disadvantages
- Performance can be degraded if files become to fragmented
- as the size of the disk drive grows so to must this table which increases the size needed and the time it takes to read
name 2 advantages and 2 disadvantages of
File Allocation Table (FAT)
name 3 file systems that use
journaling
the file systems that use this are:
- Windows
- new technology file system (NTFS)
- macOS
- apple file system (APFS)
- linux
- extended file system version 4 (EXT4)
describe the linux command
fdisk
this is a CLI utility program within linux that can be used to create and manipulate partition tables on a disk
what is the outcome of typing the linux command
df -T-a
this provides a longer list of mount points
although most will be directories and files that support the /sys direcory and provide information about the system and so take up 0 space
this will display a more detailed list of free space on present file systems such as the type of file system being used
what is the outcome of typing the linux command
df -T
how do the following
mount different file systems such as drives and partitions
- windows
- linux
to accomplish this:
- windows
- will require each new file system to have a drive letter and a new file hierarchy will be created for each file system
- linux
- file systems are named by linux and they will be mounted to a single directory hierarchy
the linux file system that uses this is
Extended File System 2 (EXT2)
which linux file system uses pure
inodes
- this is located at sector 0 of the physical disk meaning that any OS will be able to discover this information without knowing anything about the disk format
- information about the format of the disk such as any partitioning and the location of those partitions
where is the
Master Boot Record (MBR)
located and what information does it hold
describe the data structure of linux
inodes
- directory
- this will hold a file name and a reference to its inode
- inode
- this will hold metadata of the file such as:
- permissions
- ownership
- access time
- will also hold a reference to each block that the file is physically located in
- this will hold metadata of the file such as:
in this case indirect inodes are created
the first inode will reference indirect inodes which then point to the physical block
this is a scalable system that introduces further layers of indirect blocks to accomidate large files
what happens if a files data
exceeds the size of an inode
name 3
advantages of inodes
- advantages
- these are loaded into memory so finding the files next block is faster than finding the block if the reference stayed on disk
- Are flexible and can accommodate files of great size by extending the blocks via indirect blocks
- Data blocks can be kept anywhere on secondary storage
this will store data in an unbroken sequence of blocks on disk
Within the directory there will be a reference to the file:
- with its name
- the start of the block
- how many blocks it has allocated to it
describe the data structure of
Contiguos allocation
including the directory structure
no this behaivour is not default
in order to maintain the mounted drive you must add a listing to the /etc/fstab configuration file
does a mounted file system remain mounted upon a reboot