SlideShare une entreprise Scribd logo
1  sur  17
Junior Level Linux Certification
Exam Objectives
Key Knowledge Areas
ext2
ext3
xfs
reiserfs v3
vfat
Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard
Create partitions and filesystems Weight: 2
Terms and Utilities
fdisk
mkfs
mkswap
2
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
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
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
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
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
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
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
Other tools and filesystems
10
cfdisk tool (console based)
Ex:
Create partitions and filesystems
Other tools and filesystems
11
gpart partitioning tool
Ex:
Create partitions and filesystems
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
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
Filesystem Hierarchy Standard
14
Ex:
Create partitions and filesystems
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
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
Fim de sessão
17

Contenu connexe

Tendances

Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
meashi
 
Compression
CompressionCompression
Compression
aswathyu
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
wensheng wei
 

Tendances (20)

Linux
Linux Linux
Linux
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux class 8 tar
Linux class 8   tar  Linux class 8   tar
Linux class 8 tar
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Compression
CompressionCompression
Compression
 
Unix commands in etl testing
Unix commands in etl testingUnix commands in etl testing
Unix commands in etl testing
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Introduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examplesIntroduction to UNIX Command-Lines with examples
Introduction to UNIX Command-Lines with examples
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux
LinuxLinux
Linux
 
Linux commands
Linux commands Linux commands
Linux commands
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 

En vedette

101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems
Acácio Oliveira
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectives
Acácio Oliveira
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot
Acácio Oliveira
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
Acácio Oliveira
 
101 4.6 create and change hard and symbolic links
101 4.6 create and change hard and symbolic links101 4.6 create and change hard and symbolic links
101 4.6 create and change hard and symbolic links
Acácio Oliveira
 
101 4.5 manage file permissions and ownership
101 4.5 manage file permissions and ownership101 4.5 manage file permissions and ownership
101 4.5 manage file permissions and ownership
Acácio Oliveira
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes
Acácio Oliveira
 

En vedette (20)

101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectives
 
101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot101 1.3 runlevels , shutdown, and reboot
101 1.3 runlevels , shutdown, and reboot
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
 
Linux+ certification bible
Linux+ certification bibleLinux+ certification bible
Linux+ certification bible
 
101 4.6 create and change hard and symbolic links
101 4.6 create and change hard and symbolic links101 4.6 create and change hard and symbolic links
101 4.6 create and change hard and symbolic links
 
101 4.5 manage file permissions and ownership
101 4.5 manage file permissions and ownership101 4.5 manage file permissions and ownership
101 4.5 manage file permissions and ownership
 
101 1.1 hardware settings
101 1.1 hardware settings101 1.1 hardware settings
101 1.1 hardware settings
 
Treinamento de AWS - 1° Parte
Treinamento de AWS - 1° ParteTreinamento de AWS - 1° Parte
Treinamento de AWS - 1° Parte
 
101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes101 3.5 create, monitor and kill processes
101 3.5 create, monitor and kill processes
 
AWS IAM -- Notes of 20130403 Doc Version
AWS IAM -- Notes of 20130403 Doc VersionAWS IAM -- Notes of 20130403 Doc Version
AWS IAM -- Notes of 20130403 Doc Version
 
AWS CSA Associate 03-07
AWS CSA Associate 03-07AWS CSA Associate 03-07
AWS CSA Associate 03-07
 
AWS CSA Associate 02-07
AWS CSA Associate 02-07AWS CSA Associate 02-07
AWS CSA Associate 02-07
 
AWS CSA Associate 06-07
AWS CSA Associate 06-07AWS CSA Associate 06-07
AWS CSA Associate 06-07
 
AWS CSA Associate 01-07
AWS CSA Associate 01-07AWS CSA Associate 01-07
AWS CSA Associate 01-07
 
AWS CSA Associate 05-07
AWS CSA Associate 05-07AWS CSA Associate 05-07
AWS CSA Associate 05-07
 
AWS CSA Associate 04-07
AWS CSA Associate 04-07AWS CSA Associate 04-07
AWS CSA Associate 04-07
 
Aws certified solutions_architect_associate_blueprint
Aws certified solutions_architect_associate_blueprintAws certified solutions_architect_associate_blueprint
Aws certified solutions_architect_associate_blueprint
 
AWS Certification Lessons and Tips, AWS Meetup Lehi - April 2016
AWS Certification Lessons and Tips, AWS Meetup Lehi - April 2016AWS Certification Lessons and Tips, AWS Meetup Lehi - April 2016
AWS Certification Lessons and Tips, AWS Meetup Lehi - April 2016
 
V brownbag sept-14-2016
V brownbag sept-14-2016V brownbag sept-14-2016
V brownbag sept-14-2016
 

Similaire à 101 4.1 create partitions and filesystems

Lamp ppt
Lamp pptLamp ppt
Lamp ppt
Reka
 

Similaire à 101 4.1 create partitions and filesystems (20)

Unix Administration 4
Unix Administration 4Unix Administration 4
Unix Administration 4
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
unit 3 ppt file represented system......
unit 3 ppt file represented system......unit 3 ppt file represented system......
unit 3 ppt file represented system......
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
Root file system
Root file systemRoot file system
Root file system
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system administration
 

Plus de Acácio Oliveira

Plus de Acácio Oliveira (20)

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

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

101 4.1 create partitions and filesystems

  • 1. Junior Level Linux Certification
  • 2. Exam Objectives Key Knowledge Areas ext2 ext3 xfs reiserfs v3 vfat Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard Create partitions and filesystems Weight: 2 Terms and Utilities fdisk mkfs mkswap 2
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. Other tools and filesystems 10 cfdisk tool (console based) Ex: Create partitions and filesystems
  • 11. Other tools and filesystems 11 gpart partitioning tool Ex: Create partitions and filesystems
  • 12. 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
  • 13. 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
  • 14. Filesystem Hierarchy Standard 14 Ex: Create partitions and filesystems
  • 15. 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
  • 16. 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