SlideShare a Scribd company logo
Gaurav Mishra
<gmishx@gmail.com>
Linux - 8
Disk Quota, sys and proc directory
Unrestricted
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
Disk Quota
• Disk quota helps in setting disk usage
limits/caps on users/groups in Linux
environment.
• The free space on disk is a shared
resource and can be used by any user.
• It is helpful in shared environments to
restrict users consuming all of the
space.
• Disk quota are applied on a file system
on a disk partition.
• It can be soft or hard limit.
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
Disk Quota
To use disk quota on a Linux system, you need to follow these steps.
1. Install quota
a) sudo apt-get install quota
2. Inform system about quota
a) Edit /etc/fstab
a) Append defaults,[usrquota][,grpqouta] 1 1
3. Remount the disk
a) mount -o remount /home
4. Create the quota database
a) quotacheck -c<u/g> filesystem
5. Assign the quotas
a) Assign per user or per group quotas
a) edquota -<u/g>
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
Disk Quota tools
• quotacheck
▫ It scan a filesystem for disk usage, create, check and repair quota files.
▫ Creating new quota database for a partition
 quotacheck -c<u/g> /dev/sda1
• edquota
▫ It access and modify user quota on a quota database for a partition
▫ Creating limit for a user
 edquota [-ugpt] optimus
• quotaon
▫ Turn file system quota ON.
• quotaoff
▫ Turn file system quota OFF.
• repqouta
▫ Prints a summary of the disc usage and quotas for the specified file systems
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
PROCFS
• The proc filesystem (procfs) is a
special filesystem in Unix-like
operating systems.
• It provides and interface between
kernel and user space.
• It presents information about
processes and other system
information in a hierarchical file-like
structure.
• No need for direct access to kernel
memory for kernel related
information.
• It is mapped to a mount point named
/proc at boot time.
• It can be used to obtain information
about the system and to change
certain kernel parameters at runtime.
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
PROCFS files
File Description
/proc/bus/ Directory of available system bus like input/PCI/USB
/proc/cmdline Boot time options passed to kernel
/proc/cpuinfo Information about CPU like vendor, speed, etc.
/proc/devices List of character and block devices with link in /dev
/proc/filesystems List of filesystems supported by kernel at the time of listing
/proc/diskstats Information about logical disks installed
/proc/meminfo Information about the memory management done by kernel
/proc/modules List of loaded kernel modules
/proc/net/ Directory containing information about network stack
/proc/swaps List of active swap partitions
/proc/tty Contains information about current terminals
/proc/version Contains kernel version, gcc used to compile kernel, etc.
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
Process info
File Description
/proc/PID/cmdline Command used to start the process
/proc/PID/cwd Sym link to current working directory of the process
/proc/PID/environ Name and values of the process environment
/proc/PID/exe Sym link to original executable file (if it exists)
/proc/PID/fd/ Directory with sym link for each open file descriptor
/proc/PID/fdinfo/ Directory with information about each file descriptor
/proc/PID/maps Contains information about mapped files and blocks like heap
/proc/PID/root Sym link to root for the current process (generally /)
/proc/PID/status Basic information about the process
/proc/PID/task Hard link to tasks started by current process
Information of each process is stored in /proc/<PID>/
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
Sample screenshot
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
SYSFS
• sysfs is a pseudo file system by the Linux kernel which exports information about
various kernel subsystems, hardware devices, and associated device drivers from the
kernel's device model to user space through virtual files.
• These virtual files are also used for their configuring.
• sysfs is mounted under the /sys mount point.
28-02-2018
Gaurav Mishra <gmishx@gmail.com>
SYSFS directories
Directory Description
/sys/block Contains symbolic links to block devices in /sys/devices
/sys/bus List of physical bus available each with their devices and drivers
/sys/class List of device classes in kernel and devices as a symbolic link
/sys/dev List of devices categorized as block or character
/sys/devices Global list of devices discovered by kernel in a hierarchical format
/sys/firmware List of firmware objects interfaces
/sys/fs List of filesystems supported and their respective attributes
/sys/kernel Every kernel related parameters in hierarchical format
/sys/module Contains subdirectory of each loaded kernel module
/sys/power Files related to power subsystem
28-02-2018

More Related Content

What's hot (20)

PPT
Storage area network
Neha Agarwal
 
PPT
Firewall Architecture
Yovan Chandel
 
PPTX
Cisco ASA Firepower
Anwesh Dixit
 
PPT
BIG IP F5 GTM Presentation
PCCW GLOBAL
 
PDF
5 g core network and the cloud - A standards perspective
Sridhar Bhaskaran
 
PDF
Distributed Systems for Blockchain using Cloud
Hridyesh Bisht
 
PDF
Presentation f5 – beyond load balancer
xKinAnx
 
PPT
Storage Area Network (San)
sankcomp
 
PPTX
Virtual Private Network
Rajendra Dangwal
 
PDF
Juniper bti packet optical training
Muhammad Denis Iqbal
 
PPTX
What is active directory
Adeel Khurram
 
PPTX
Wireshark
Sourav Roy
 
PPTX
Get Hands-On with NGINX and QUIC+HTTP/3
NGINX, Inc.
 
PDF
Public Key Authentication With SSH
Don Norwood
 
PPT
Blue1
raminenihemu418
 
PPTX
Wireshark
antivirusspam
 
PPTX
Cloud computing stack
Pedro Alexander Romero Tortosa
 
PPT
Virtual Private Network main
Kanika Gupta
 
PPT
Palo alto networks next generation firewalls
Castleforce
 
PDF
Beginners: Open RAN Terminology – Virtualization, Disaggregation & Decomposition
3G4G
 
Storage area network
Neha Agarwal
 
Firewall Architecture
Yovan Chandel
 
Cisco ASA Firepower
Anwesh Dixit
 
BIG IP F5 GTM Presentation
PCCW GLOBAL
 
5 g core network and the cloud - A standards perspective
Sridhar Bhaskaran
 
Distributed Systems for Blockchain using Cloud
Hridyesh Bisht
 
Presentation f5 – beyond load balancer
xKinAnx
 
Storage Area Network (San)
sankcomp
 
Virtual Private Network
Rajendra Dangwal
 
Juniper bti packet optical training
Muhammad Denis Iqbal
 
What is active directory
Adeel Khurram
 
Wireshark
Sourav Roy
 
Get Hands-On with NGINX and QUIC+HTTP/3
NGINX, Inc.
 
Public Key Authentication With SSH
Don Norwood
 
Wireshark
antivirusspam
 
Cloud computing stack
Pedro Alexander Romero Tortosa
 
Virtual Private Network main
Kanika Gupta
 
Palo alto networks next generation firewalls
Castleforce
 
Beginners: Open RAN Terminology – Virtualization, Disaggregation & Decomposition
3G4G
 

Similar to Disk quota and sysd procd (20)

PDF
File systems for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
PDF
Course 102: Lecture 28: Virtual FileSystems
Ahmed El-Arabawy
 
PPTX
CSA-lecture 6.pptx
UsmanAshraf656960
 
PPT
101 4.1 create partitions and filesystems
Acácio Oliveira
 
PPTX
Linux file system
Md. Tanvir Hossain
 
PDF
linuxfilesystem-180727181106 (1).pdf
ShaswatSurya
 
PDF
The sysfs Filesystem
Jeff Yana
 
PDF
Linux Internals Part - 1
SysPlay eLearning Academy for You
 
PPTX
Disk and File System Management in Linux
Henry Osborne
 
PPT
Linux filesystemhierarchy
Dr. C.V. Suresh Babu
 
PPTX
Files and directories in Linux 6
Meenakshi Paul
 
PDF
Linux.pdf
MohammedNasser364522
 
PDF
Linux Kernel
Ahmed Abdel-Hameed
 
DOCX
Linux File System.docx
BhuvanaR13
 
PPTX
Linux fundamentals
Raghu nath
 
PPTX
Week6 filesystem
Gagah Arifianto
 
PDF
File system discovery
DevMix
 
PDF
Linux fundamental - Chap 10 fs
Kenny (netman)
 
PPTX
Network and System Administration Power Point
kemal678348
 
PPTX
11 linux filesystem copy
Shay Cohen
 
File systems for Embedded Linux
Emertxe Information Technologies Pvt Ltd
 
Course 102: Lecture 28: Virtual FileSystems
Ahmed El-Arabawy
 
CSA-lecture 6.pptx
UsmanAshraf656960
 
101 4.1 create partitions and filesystems
Acácio Oliveira
 
Linux file system
Md. Tanvir Hossain
 
linuxfilesystem-180727181106 (1).pdf
ShaswatSurya
 
The sysfs Filesystem
Jeff Yana
 
Linux Internals Part - 1
SysPlay eLearning Academy for You
 
Disk and File System Management in Linux
Henry Osborne
 
Linux filesystemhierarchy
Dr. C.V. Suresh Babu
 
Files and directories in Linux 6
Meenakshi Paul
 
Linux Kernel
Ahmed Abdel-Hameed
 
Linux File System.docx
BhuvanaR13
 
Linux fundamentals
Raghu nath
 
Week6 filesystem
Gagah Arifianto
 
File system discovery
DevMix
 
Linux fundamental - Chap 10 fs
Kenny (netman)
 
Network and System Administration Power Point
kemal678348
 
11 linux filesystem copy
Shay Cohen
 
Ad

More from Gaurav Mishra (11)

PPTX
FOSSology and OSS-Tools for License Compliance and Automation
Gaurav Mishra
 
PPTX
FOSSology & GSOC Journey
Gaurav Mishra
 
PPTX
Block Chain - Merkel and Key exchange
Gaurav Mishra
 
PPTX
Block Chain - Introduction
Gaurav Mishra
 
PPTX
Backup using rsync
Gaurav Mishra
 
PPTX
Linux User Management
Gaurav Mishra
 
PPTX
Apache, cron and proxy
Gaurav Mishra
 
PPTX
Linux Run Level
Gaurav Mishra
 
PPTX
Firewall and IPtables
Gaurav Mishra
 
PPTX
Linux securities
Gaurav Mishra
 
PPTX
wget, curl and scp
Gaurav Mishra
 
FOSSology and OSS-Tools for License Compliance and Automation
Gaurav Mishra
 
FOSSology & GSOC Journey
Gaurav Mishra
 
Block Chain - Merkel and Key exchange
Gaurav Mishra
 
Block Chain - Introduction
Gaurav Mishra
 
Backup using rsync
Gaurav Mishra
 
Linux User Management
Gaurav Mishra
 
Apache, cron and proxy
Gaurav Mishra
 
Linux Run Level
Gaurav Mishra
 
Firewall and IPtables
Gaurav Mishra
 
Linux securities
Gaurav Mishra
 
wget, curl and scp
Gaurav Mishra
 
Ad

Recently uploaded (20)

PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
The Future of Artificial Intelligence (AI)
Mukul
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 

Disk quota and sysd procd

  • 1. Gaurav Mishra <[email protected]> Linux - 8 Disk Quota, sys and proc directory Unrestricted 28-02-2018
  • 2. Gaurav Mishra <[email protected]> Disk Quota • Disk quota helps in setting disk usage limits/caps on users/groups in Linux environment. • The free space on disk is a shared resource and can be used by any user. • It is helpful in shared environments to restrict users consuming all of the space. • Disk quota are applied on a file system on a disk partition. • It can be soft or hard limit. 28-02-2018
  • 3. Gaurav Mishra <[email protected]> Disk Quota To use disk quota on a Linux system, you need to follow these steps. 1. Install quota a) sudo apt-get install quota 2. Inform system about quota a) Edit /etc/fstab a) Append defaults,[usrquota][,grpqouta] 1 1 3. Remount the disk a) mount -o remount /home 4. Create the quota database a) quotacheck -c<u/g> filesystem 5. Assign the quotas a) Assign per user or per group quotas a) edquota -<u/g> 28-02-2018
  • 4. Gaurav Mishra <[email protected]> Disk Quota tools • quotacheck ▫ It scan a filesystem for disk usage, create, check and repair quota files. ▫ Creating new quota database for a partition  quotacheck -c<u/g> /dev/sda1 • edquota ▫ It access and modify user quota on a quota database for a partition ▫ Creating limit for a user  edquota [-ugpt] optimus • quotaon ▫ Turn file system quota ON. • quotaoff ▫ Turn file system quota OFF. • repqouta ▫ Prints a summary of the disc usage and quotas for the specified file systems 28-02-2018
  • 5. Gaurav Mishra <[email protected]> PROCFS • The proc filesystem (procfs) is a special filesystem in Unix-like operating systems. • It provides and interface between kernel and user space. • It presents information about processes and other system information in a hierarchical file-like structure. • No need for direct access to kernel memory for kernel related information. • It is mapped to a mount point named /proc at boot time. • It can be used to obtain information about the system and to change certain kernel parameters at runtime. 28-02-2018
  • 6. Gaurav Mishra <[email protected]> PROCFS files File Description /proc/bus/ Directory of available system bus like input/PCI/USB /proc/cmdline Boot time options passed to kernel /proc/cpuinfo Information about CPU like vendor, speed, etc. /proc/devices List of character and block devices with link in /dev /proc/filesystems List of filesystems supported by kernel at the time of listing /proc/diskstats Information about logical disks installed /proc/meminfo Information about the memory management done by kernel /proc/modules List of loaded kernel modules /proc/net/ Directory containing information about network stack /proc/swaps List of active swap partitions /proc/tty Contains information about current terminals /proc/version Contains kernel version, gcc used to compile kernel, etc. 28-02-2018
  • 7. Gaurav Mishra <[email protected]> Process info File Description /proc/PID/cmdline Command used to start the process /proc/PID/cwd Sym link to current working directory of the process /proc/PID/environ Name and values of the process environment /proc/PID/exe Sym link to original executable file (if it exists) /proc/PID/fd/ Directory with sym link for each open file descriptor /proc/PID/fdinfo/ Directory with information about each file descriptor /proc/PID/maps Contains information about mapped files and blocks like heap /proc/PID/root Sym link to root for the current process (generally /) /proc/PID/status Basic information about the process /proc/PID/task Hard link to tasks started by current process Information of each process is stored in /proc/<PID>/ 28-02-2018
  • 9. Gaurav Mishra <[email protected]> SYSFS • sysfs is a pseudo file system by the Linux kernel which exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. • These virtual files are also used for their configuring. • sysfs is mounted under the /sys mount point. 28-02-2018
  • 10. Gaurav Mishra <[email protected]> SYSFS directories Directory Description /sys/block Contains symbolic links to block devices in /sys/devices /sys/bus List of physical bus available each with their devices and drivers /sys/class List of device classes in kernel and devices as a symbolic link /sys/dev List of devices categorized as block or character /sys/devices Global list of devices discovered by kernel in a hierarchical format /sys/firmware List of firmware objects interfaces /sys/fs List of filesystems supported and their respective attributes /sys/kernel Every kernel related parameters in hierarchical format /sys/module Contains subdirectory of each loaded kernel module /sys/power Files related to power subsystem 28-02-2018