TCM Security Academy Notes - by syselement
🏠 Home BlogGitHub📚 Buy Me a Book
  • TCM Security Academy Notes
  • Courses
    • TCM - Linux 101
      • 1. Introduction
        • Linux Distributions
        • Installing Linux
      • 2. Command Line
        • Intro to Command Line
        • Getting help on the Command Line
        • Command Line Arguments and Options
        • Reading Text Files
      • 3. File System
        • Filesystem Hierarchy Standard
        • Devices, Partitions and Mounting
        • Absolute and Relative Paths
        • Files and Directories
        • Paths, Filenames and Text Files
        • Filesystem Links
        • Archiving and Searching Files
      • 4. Users and Groups
        • Working with Users and Groups
        • File and Directory Permissions
        • Changing Users and Passwords
      • 5. Installing Software
        • Package Management
      • 6. Shells
        • Common Command Line Shells
        • Environment Variables & Startup Files
        • Input/Output Redirection
        • Command History & Substitution
      • 7. Utilities and File Editors
        • Searching and Processing Text
        • Networking at the Command Line
        • File Transfer
        • Text Editors and Converters
      • 8. Process Management
        • Process Information
        • Foreground and Background Processes
        • Managing Processes
        • Scheduling Processes
      • 9. Regular Expressions
        • Regular Expressions, Searching, Replacing, Building
      • 10. Bash Scripting
        • Bash Scripting Basics, Control Structures, Loops
      • 🌐Linux101 References
    • TCM - Mobile Application Penetration Testing
      • 1. Introduction & Mobile Pentesting
      • 2. Android Security
      • 3. Android Lab Setup
      • 4. Android Static Analysis
      • 5. Android Dynamic Analysis
      • 6. Android Bug Bounty
      • 7. iOS Security
      • 8. iOS Lab Setup
      • 9. iOS Static Analysis
      • 10. iOS Dynamic Analysis
      • 11. iOS Bug Bounty
      • 🌐MAPT References
    • TCM - Practical Ethical Hacking
      • 1. Introduction & Networking
      • 2. Lab Set Up, Linux & Python
        • Intro to Kali Linux
        • Intro to Python
      • 3. The Ethical Hacker Methodology
        • Information Gathering
        • Scanning & Enumeration
        • Vulnerability Scanning with Nessus
        • Exploitation Basics
        • Capstone Practical Labs
      • 4. Active Directory
        • Active Directory Lab
        • AD - Initial Attack Vectors
        • AD - Post-Compromise Enumeration
        • AD - Post-Compromise Attacks
        • AD - Additional Attacks
        • AD - Case Studies
      • 5. Post Exploitation
      • 6. Web Application
        • Web App Lab Setup
        • Web App - SQL Injection
        • Web App - XSS
        • Web App - Command Injection
        • Web App - Insecure File Upload
        • Web App - Authentication Attacks
        • Web App - XXE
        • Web App - IDOR
        • Web App - Capstone Practical Lab
      • 7. Wireless Attacks
      • 8. Legal Documentation & Report Writing
      • 🌐PEH References
  • 🏠syselement's Blog Home
Powered by GitBook
On this page
  • Mounted Devices
  • Mounting Configuration
  • mount
  • df
  • du

Was this helpful?

Edit on GitHub
  1. Courses
  2. TCM - Linux 101
  3. 3. File System

Devices, Partitions and Mounting

PreviousFilesystem Hierarchy StandardNextAbsolute and Relative Paths

Last updated 2 years ago

Was this helpful?

Mounted Devices

  • All the active storages devices in Linux are part of the single file system starting at /.

  • The hard drive is identified by /dev/sda:

    • s identifier indicates that it is a sata drive

    • a indicates that it is the first drive (/dev/sdb would the the second drive if present)

    • the drive is divided into different volumes/partitions, each with its own ID mounted at a different location in the file system

      • First partition is /dev/sda1

      • Second partition is /dev/sda2, mounted at /boot/efi

      • Third partition is /dev/sda3, mounted at filesystem root /

    • Every file or directory that isn't in one of the subdirectory mount points, resides on the /dev/sda3 partition since it is at the filesystem root.

  • The virtual dvd drive is identified by the read-only /dev/sr0

Mounting Configuration

cat /etc/fstab
	# /etc/fstab: static file system information.
	#
	# Use 'blkid' to print the universally unique identifier for a
	# device; this may be used with UUID= as a more robust way to name devices
	# that works even if disks are added and removed. See fstab(5).
	#
	# <file system> <mount point>   <type>  <options>       <dump>  <pass>
	# / was on /dev/sda3 during installation
	UUID=2b17aaa3-594a-43eb-9c65-3b89ebb0bc05 /               ext4    errors=remount-ro 0       1
	# /boot/efi was on /dev/sda2 during installation
	UUID=4704-6965  /boot/efi       vfat    umask=0077      0       1
	/swapfile                                 none            swap    sw              0       0
  • Each partition has a unique identifier UUID that the system uses.

mount

  • mount - command used to mount partitions, or shows the current mounted devices

mount
	sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
	proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
	udev on /dev type devtmpfs (rw,nosuid,relatime,size=1975416k,nr_inodes=493854,mode=755,inode64)
	devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
	tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=402020k,mode=755,inode64)
	/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro)
	securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
	tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
	tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
	cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
	pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
	bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
	systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=15742)
	tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
	debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
	mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
	hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
	fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
	configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
	none on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
	[...]

df

  • df - displays the disk file system space usage of all the mounted partitions

df -h
# Print sizes in a human-readable format
	Filesystem      Size  Used Avail Use% Mounted on
	tmpfs           393M  1,6M  392M   1% /run
	/dev/sda3        24G  8,6G   15G  38% /
	tmpfs           2,0G     0  2,0G   0% /dev/shm
	tmpfs           5,0M  4,0K  5,0M   1% /run/lock
	/dev/sda2       512M  5,3M  507M   2% /boot/efi
	tmpfs           393M  2,4M  391M   1% /run/user/1000

du

  • du - display the disk usage of given files or directories

  • It can be combined with other commands with pipes.

du -sh ~
# Summarize the total disk usage of the directory and print in a human-readable format
	148M	/home/user