SlideShare a Scribd company logo
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Linux Essenciais and System Administration
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Key Knowledge Areas
ext2
Ext3-4
xfs
reiserfs v3
vfat
Devices, Linux Filesystems, Filesystem Hierarchy Standard
Create partitions and filesystems
Terms and Utilities
fdisk
mkfs
mkswap
2
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
File Systems
3
FILE SYSTEM
is the methods and data structures that an operating system uses to keep track of files on disk or partition
or, the way the files are organized on disk
Linux Filesystems can be created with the mkfs command.
Cmd is a front end to several filesystem-specific commands (such as mkfs.ext3 for ext3 and mkfs.reiserfs for ReiserFS)
To view what filesystem-specific support is installed on the system use: ls /sbin/mk* command.
Linux Swapspaces are created with the mkswap command.
Ex: yourname@yourcomp~> ls /sbin/mk*
/sbin/mkdosfs /sbin/mkfs.ext2 /sbin/mkfs.ntfs
/sbin/mke2fs /sbin/mkfs.ext3 /sbin/mkfs.vfat
/sbin/mkfs /sbin/mkfs.ext4 /sbin/mkfs.xfs
/sbin/mkfs.btrfs /sbin/mkfs.ext4dev /sbin/mkhomedir_helper
/sbin/mkfs.cramfs /sbin/mkfs.msdos /sbin/mkswap
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
File Systems
4
Linux Swapspaces and Filesystems can be created with fdisk
Ex: yourname@yourcomp~> fdisk -v
fdisk (util-linux-ng 2.16)
yourname@yourcomp~> sudo fdisk /dev/sdb
[sudo] password for:
The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000404d6
Device Boot Start End Blocks Id System
/dev/sdb1 1 25 200781 83 Linux
/dev/sdb2 26 12965 103940550 83 Linux
/dev/sdb3 12966 30401 140054670 83 Linux
Command (m for help):
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Creating a swap space
5
swap space from other partition with mkswap
Ex: yourname@yourcomp~> mkswap /dev/sda4
Setting up swapspace version 1, size = 4192960 KiB
no label, UUID=8f5a3a05-73ef-4c78-bc56-0e9b1bcc7fdb
mkswap doesnt check if file or partition isn't used.
It can overwrite important files and partitions
swap space is part of hard disk that is used as virtual memory
Linux can use a normal file in filesystem or separate partition for swap space.
used as a raw partition, and will not contain any filesystem. type 82 (Linux swap);
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Creating a swap space
6
Ex: yourname@yourcomp~> dd if=/dev/zero of=/extra-swap bs=1024
count=1024
1024+0 records in
1024+0 records out
/extra-swap is the name of the swap file and the size of is given after the count=.
yourname@yourcomp~> mkswap /extra-swap 1024
Setting up swapspace, size = 1044480 bytes
After created a swap file or swap partition, you need to write a signature to its beginning;
contains administrative information used by kernel. command to do is mkswap
Ex:
the swap space is still not in use: it will exist, but the kernel does not use it to provide virtual memory.
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Creating a swap space
7
initialized swap space is used with swapon.
tells kernel that swap space can be used and path to swap space is given as argument
Ex:
yourname@yourcomp~> swapon /extra-swap
to start swapping on temporary swap file use the following command:
/dev/hda8 none swap sw 0 0
/swapfile none swap sw 0 0
startup scripts will run command swapon -a, which will start swapping on all the swap spaces listed in /etc/fstab
Ex:
Swap spaces can be used automatically by listing them in /etc/fstab file
swap space can be removed with swapoff
swap used automatically with swapon -a can be removed from with swapoff -a; it looks at /etc/fstab to find what to
remove
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Creating a swap space
8
monitor swap with free or top or in /proc/meminfo
View enabled swap devices use swapon –s or with cat /proc/swaps
yourname@yourcomp~> swapon –s
Filename Type Size Used Priority
/dev/sdb1 partition 514044 0 -1
/dev/sdb5 partition 4192928 0 -2
yourname@yourcomp~> cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb1 partition 514044 0 -1
/dev/sdb5 partition 4192928 0 -2
Ex:
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Creating an ext3 filesystem
9
Ex: yourname@yourcomp~> mkfs -t ext3 /dev/sda8
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2624496 inodes, 10488429 blocks
524421 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
321 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
• To add journal to an existing ext2, use tune2fs with -j option.
• To display or set label for ext2 or ext3, use e2label. Labels limited to 16 characters.
• To display UUID (Universally Unique Identifier) for the formatted partition, use blkid cmd
Linux filesystems generate UUID when the filesystem is formatted - 128-bit identifier displayed as 32 hexadecimal digit and four
hyphens
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Other tools and filesystems
10
cfdisk tool (console based)
Ex:
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Other tools and filesystems
11
gpart partitioning tool
Ex:
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Linux file system
12
Linux filesystem contains files arranged on a block storage device in directories.
Linux filesystem is a single tree with the / directory as its root directory.
Ex:
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
File system Hierarchy Standard
13
Directories required in / by the Filesystem Hierarchy Standard
Set of requirements and guidelines for file and directory placement under UNIX-like operating systems.
Directory Description
bin Essential command binaries
boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
lib Essential shared libraries and kernel modules
media Mount point for removable media
mnt Mount point for mounting a filesystem temporarily
opt Add-on application software packages
sbin Essential system binaries
srv Data for services provided by this system
tmp Temporary files
usr Secondary hierarchy
var Variable data
http://www.pathname.com/fhs/
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Filesystem Hierarchy Standard
14
Ex:
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Linux file system
15
A simple description of UNIX system, applicable to Linux, is:
"On a UNIX system, everything is a file; if something is not a file, it is a process.”
• Regular files: Contain normal data. Ex. text files, executable files or progs, input for or output from a program.
• Directories: Files that are lists of other files.
• Special files: The mechanism used for input and output. Most special files are in /dev
• Links: System to make a file or directory visible in multiple parts of the system's file tree.
• Domain sockets: Special file type (similar to TCP/IP sockets) providing inter-process networking protected by the file
system's access control.
• Named pipes: More or less like sockets. Form a way for processes to communicate with each other, without using
network socket semantics.
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Linux file system
16
The -l option to ls cmd displays the file type, using the first character of each input line
Good options are with -F and --color combined:
Ex: yourname@yourcomp~> ls -l
total 80
-rw-rw-r-- 1 jaime jaime 31744 Feb 21 17:56 intro Linux.doc
-rw-rw-r-- 1 jaime jaime 41472 Feb 21 17:56 Linux.doc
drwxrwxr-x 2 jaime jaime 4096 Feb 25 11:50 course
File types in ls -long list
Symbol Meaning
•- Regular file
•d Directory
•l Link
•c Special file
•s Socket
•p Named pipe
•b Block device
File types in ls –F
suffixes to non-standard file name. For mono-color use and printing
Character File type
•nothing Regular file
•/ Directory
•* Executable file
•@ Link
•= Socket
•| Named pipe
View info coreutils ls
Create partitions and filesystems
CoreLinuxforRedHatandFedoralearningunderGNUFreeDocumentationLicense-Copyleft(c)AcácioOliveira2012
Everyoneispermittedtocopyanddistributeverbatimcopiesofthislicensedocument,changingisallowed
Fim de sessão
17

More Related Content

PPT
4.1 create partitions and filesystems
PPT
1.2 boot the system v2
PPT
101 apend. backups
PPT
101 4.1 create partitions and filesystems
PPT
4.8 apend backups
PPT
101 2.1 design hard disk layout
PPT
101 3.3 perform basic file management
PPT
101 2.4 use debian package management
4.1 create partitions and filesystems
1.2 boot the system v2
101 apend. backups
101 4.1 create partitions and filesystems
4.8 apend backups
101 2.1 design hard disk layout
101 3.3 perform basic file management
101 2.4 use debian package management

What's hot (20)

PPTX
Linux training
PPT
4.2 maintain the integrity of filesystems
PPTX
Linux Survival Kit for Proof of Concept & Proof of Technology
PDF
Basic shell commands by Jeremy Sanders
PDF
Linux Security Quick Reference Guide
PDF
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
PDF
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
PDF
Linux fundamental - Chap 02 perm
PDF
One Page Linux Manual
PDF
Rh202 q&a-demo-cert magic
PPT
Unit 7
PDF
Linux fundamental - Chap 03 file
PDF
Unix Command Line Productivity Tips
PDF
Archiving in linux tar
PPT
101 3.4 use streams, pipes and redirects
DOC
Some basic unix commands
PDF
Linuxbasiccommands
PPT
Compression Commands in Linux
Linux training
4.2 maintain the integrity of filesystems
Linux Survival Kit for Proof of Concept & Proof of Technology
Basic shell commands by Jeremy Sanders
Linux Security Quick Reference Guide
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Linux fundamental - Chap 02 perm
One Page Linux Manual
Rh202 q&a-demo-cert magic
Unit 7
Linux fundamental - Chap 03 file
Unix Command Line Productivity Tips
Archiving in linux tar
101 3.4 use streams, pipes and redirects
Some basic unix commands
Linuxbasiccommands
Compression Commands in Linux
Ad

Viewers also liked (18)

PDF
PPTX
Tintín.
PPT
Victoria
PPT
cantantes de regaeton
PDF
Aravind_Jayasankar_Master_Thesis
PPTX
Eruviel Ávila Villegas, candidato del PRI gobernador del Estado de México 2011
PDF
Dr. Guha Sarkar CSR testimony
PDF
8/11-12 CAOCチラシ
PPS
Productividad Celestial
PPTX
Cloudy with SaaS shine
PDF
TFM Encuesta docentes
DOC
8.1.1.ficha.cap.5.cide
PPTX
Corrosion
PPTX
Внедрение Continuous UX в производственный цикл IT-компании
PPTX
CP04 Formación del profesorado en competencias digitales
PDF
INFO XXI Tercer Trimestre de 2016 de Plena inclusión Región de Murcia
PDF
Investigación de Bancos
Tintín.
Victoria
cantantes de regaeton
Aravind_Jayasankar_Master_Thesis
Eruviel Ávila Villegas, candidato del PRI gobernador del Estado de México 2011
Dr. Guha Sarkar CSR testimony
8/11-12 CAOCチラシ
Productividad Celestial
Cloudy with SaaS shine
TFM Encuesta docentes
8.1.1.ficha.cap.5.cide
Corrosion
Внедрение Continuous UX в производственный цикл IT-компании
CP04 Formación del profesorado en competencias digitales
INFO XXI Tercer Trimestre de 2016 de Plena inclusión Región de Murcia
Investigación de Bancos
Ad

Similar to 101 4.1 create partitions and filesystems (20)

PPT
101 4.2 maintain the integrity of filesystems
PPT
101 4.2 maintain the integrity of filesystems
PPT
101 2.1 design hard disk layout v2
PPT
2.1 design hard disk layout v2
PPT
101 4.3 control mounting and unmounting of filesystems v2
PPT
101 4.4 manage disk quotas
PPT
101 4.4 manage disk quotas
PPT
4.3 control mounting and unmounting of filesystems v2
PPT
4.4 manage disk quotas
PPT
101 1.2 boot the system
PPT
101 4.3 control mounting and unmounting of filesystems
PPT
Top ESXi command line v2.0
PPT
101 3.3 perform basic file management
PPT
101 3.3 perform basic file management
PDF
Inspection and maintenance tools (Linux / OpenStack)
PPT
Linux filesystemhierarchy
PPT
3.3 perform basic file management
PPT
101 4.5 manage file permissions and ownership
PPT
101 2.5 use rpm and yum package management
PPT
101 2.5 use rpm and yum package management
101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystems
101 2.1 design hard disk layout v2
2.1 design hard disk layout v2
101 4.3 control mounting and unmounting of filesystems v2
101 4.4 manage disk quotas
101 4.4 manage disk quotas
4.3 control mounting and unmounting of filesystems v2
4.4 manage disk quotas
101 1.2 boot the system
101 4.3 control mounting and unmounting of filesystems
Top ESXi command line v2.0
101 3.3 perform basic file management
101 3.3 perform basic file management
Inspection and maintenance tools (Linux / OpenStack)
Linux filesystemhierarchy
3.3 perform basic file management
101 4.5 manage file permissions and ownership
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management

More from Acácio Oliveira (20)

PPTX
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
PPTX
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
PPTX
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
PPTX
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
PPTX
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
PPTX
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
PPTX
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
PPTX
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
PPTX
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
PPTX
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
PPTX
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
PPTX
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
PPTX
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
PPTX
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
PPTX
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
PPTX
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
PPTX
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
PPTX
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
PPTX
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
PPTX
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptx

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
Cloud computing and distributed systems.
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Modernizing your data center with Dell and AMD
Cloud computing and distributed systems.
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing

101 4.1 create partitions and filesystems