Shared Flashcard Set

Details

Module 3
Vocabs and commands
17
Other
Not Applicable
02/02/2022

Additional Other Flashcards

 


 

Cards

Term
Mounting Disks in Linux
Definition

What can you mount?

  • Hard Drives (IDE, SATA, SCSI)
  • CD/DVD ROM
  • External Drives (Flash, USB HD)
  • Floppy Drives
  • Disk Images (.iso, .dd, .img, .nrg)
  • Network Storage
Term
Working With Disks in Linux
Definition
  • lsblk – lists information about available block devices (Hard Disks, partitions, CDROMs, etc)
  • df – Reports mounted disks
  • du -h (disk utilization)– Shows disk usage of files in a directory
  • /etc/fstab – configuration file that tells the system what to mount at boot
  • mount – Command to mount a disk
  • umount – Command to unmounts a disk
Term
Hard Drives
Definition
  • /dev/hda – Master IDE HDD
  • /dev/hdb – Slave IDE HDD
  • /dev/sda – First scsi/sata HDD
  • /dev/sdb – Second scsi/sata HDD
Term
Partitions
Definition
  • /dev/sda1 – 1st partition on scsi drive
  • /dev/sda2 – 2nd partition on scsi drive
Term
Partitions
Definition
  • Partitions are containers in the file system
  • You must have a partition to be able to write files
  • Each disk can only have 4 primary partitions
  • Extended partitions can be used to create additional logical partitions
  • fdisk – interactive command-line utility to create partitions
Term
File Systems
Definition
  • Controls how data is stored and retrieved
  • Different file systems have their own set of rules for organizing data
  • Different features such as journaling, online/offline defragmentation, file size support
  • mkfs.<type> /dev/sda1 – command to create file system on a partition
Term
Common File Systems
Definition
  • Fat 32 – Legacy Windows
  • NTFS – Windows
  • ReFS – New Windows
  • ext2 – Legacy Linux
  • ext3 – Built on ext2; Commonly used
  • ext4 – Next generation of ext3, added features, larger file sizes
  • rieserFS(3)(4) – Alternative to ext
  • Btrfs “Butters FS” – Next-gen Linux file system; used in SuSE 12
  • xfs – Next-gen Linux file system; used in CentOS 7
Term
Mounting Disks
Definition
  • Auto mount (when working with gui)

/media/<label>

/run/media/~/<label>

  • mount /dev/<device> /<mountpoint>

Mount point directory must already exist

Ex: /dev/sda1 /mnt/point

  • umount /<mointpoint>

Ex: umount /mnt/point

Term
Other Mounting Options
Definition
  • mount – t ntfs /dev/sdc /mnt/ntfs

Mounts drive with ntfs type file system

Other file system types available

  • mount -r – Read Only
Term
Linux Directory Structure
Definition
  • Hierarchical file structure
  • No drive letters
  • All devices (HDD, external media, network storage, etc.) are accessed through the single structure

  /         - root

  /etc

 

  /etc/samba

Term
Directory Branches
Definition
[image]
Term
Commands to know!
Definition
[image]
Term
Commands to know!
Definition
  • / - The root directory. This is where the file system tree starts
  • /bin - Executable programs needed when running in minimal troubleshooting mode
  • /boot - File and directories needed to boot the Linux Kernel
  • /dev - Device files that are used for accessing physical hardware
  • /etc - Contains configuration files that are used by programs and services
  • /home - Used for local user home directories
  • /lib, /lib64 - Shared libraries that are used by programs
  • /media, /mnt - Directories used for mounting devices in the file system tree
  • /opt - Used for optional packages that may be installed on the system
  • /root - The home directory for the root user
  • /sbin - Executable programs for system administration commands. Cannot be used by regular users
  • /srv - Directory that may be used for data used by services like FTP, HTTP, or NFS
  • /tmp - Temporary files that may be deleted without any warning
  • /usr - Subdirectories for program files, libraries for programs, and documentation
  • /var - Contains variable files, such as log files, printer spool files, and mail boxes
Term
Linux File Types
Definition
Normal files

 

  • contain data – can be executable
Directories
  • list the location of other files
Links
  • A shortcut to another file
Block Devices

 

  • disk drives, external media /dev/sda
Term
Linux File Paths
Definition
A path is a unique location of a file
Absolute path – a full path from root (/) directory
  • /home/user/Desktop
Relative Path – The path relative to the PWD
  • ./Desktop

 

~/ - Refers to users home directory
Term
Commands for Managing Directories and Files
Definition
touch
  • Creates an empty normal file
mkdir
  • Creates a directory
cp
  • Copy files
mv
  • Move files
  • Can be used to rename files
rm
  • Remove files
rmdir

 

  • Remove directory
Term
Links
Definition
Hard Link
  • Can be used to give a file multiple names
  • Must exist on the same storage device
  • Cannot link to directories
Symbolic Link
  • More flexible
  • Can link to other devices
  • Can link to directories
  • If linked file is removed, the link becomes invalid
Supporting users have an ad free experience!