SlideShare a Scribd company logo
1 of 42
Cloud Solution Architect
Recap
Module 2 - Lecture 5
• Bourne-Again Shell (bash)
• Linux Kernel
• User Management
• System Administration
Learning Objectives
Module 2 - Lecture 6
• Linux Permissions
• Disk Partition / Logical Volume Management
• Run levels / init / systemd
Linux permissions
• User (u): Owner of the file or directory
• Group (g): Group of users added to have similar permissions
• Others (o): anyone else other than owner and the group
Linux permission Types
• Read (r): Read the contents of a file
• Write (w): Write and edit the contents of a file or a directory
• Execute (x): Execute a program that is written in a file or
directory
• Read has value 4
• Write has value 2
• Execute has value 1
Linux permission Types
• 10 characters in Linux Permission String (output of ls -al)
⚬ First Character is the type of the file,
⚬ The first three characters of the remaining nine
characters are permissions for the user
⚬ The middle three characters are permissions for group
⚬ Last three characters are permissions for others
Linux permission String
Linux permission Matrix
Linux permission Symbolic
• User => u
• Group => g
• Others => o
• All => a
• read => r
• write => w
• execute => x
• + => add
• - => remove
• = => set
Linux permission Symbolic
chmod - Change Mode
• chmod command is used to change the permissions of a file or
directory
⚬ chmod [permissions] [filename]
⚬ chmod -R [permissions] [directoryname]
chown - Change Ownership
• chown command is used to change the ownership of a file or
directory
⚬ chown [user:group] [filename]
⚬ chown -R [user:group] [directoryname]
chown - Change Ownership
Disk Partition - Linux
• Creation of one or more regions on secondary storage
• Created to manage regions separately
• The first step of preparing a newly installed disk
• Done before creating file system
Disk Partition - Linux
• data partition: normal Linux system data, including the root partition
containing all data to start up and run the system
• swap partition: expansion of computer's physical memory, extra
memory on hard disk.
parted
• sudo parted -l //list the devices
• list contain
⚬ model of the storgae device
⚬ Name and size of the disk
⚬ logical and physical size of the disk
⚬ Type of partition table
⚬ information about size, type, file system, and flags
• Select disk that needs to be partitioned
⚬ sudo fdisk /dev/sdb
parted
• if not selected the right disk, use the 'select' command in parted
interface
• mklabel gpt //select the partition table as shown in parted -l
• 'print' to confirm the selection
• mkpart primary ext4 1MB 1855MB
⚬ This will create a primary partition of 1854 MB with an ext4
file system
• partition can be
⚬ primary: Hold OS files. Max 4 partitions
⚬ extended: Special partitions, can be more than 4
⚬ logical: Partition inside extended partition
fdisk
• creating and manipulating disk partition table
• Partition functions
⚬ view
⚬ create
⚬ delete
⚬ change
⚬ resize
⚬ copy
⚬ move
fdisk
• fdisk -l //list the partition table
• fdisk -l /dev/sdb //specific disk
• fdisk /dev/sdb //to open command interface for fdisk
⚬ m //list the fdisk commands
⚬ p //print the partition table for specific disk
⚬ d //delete partition
⚬ w //write the partition table after changes
⚬ n //new partition
■ p //primary
■ e //extended
• fdisk -s partition //check size of a partition
fdisk
• Format partition when created
• mkfs.ext4 newly-created-partition
• Partition:
⚬ physical subset of a disk
• filesystem:
⚬ logical hierarchy of directories and files
File Systems
• NTFS (New Technology File System)
⚬ Partition can extend upto 16EB (16 million TB)
⚬ Files stored can be as large as the partition
⚬ ocassionally becomes fragemented and should be
defragmented every one to two months
⚬ read from and write to Windows and linux, whereas read
from MacOS X. However, can written using NTFS-3G
driver
File Systems
• FAT (File Allocation Table)
⚬ Cannot exceed 2TB
■ (Windows cannot form larger than 32GB, Mac OS X can)
⚬ partitions larger than 32GB are not recommended
⚬ Files stored cannot exceed 4GB
⚬ need to be defragmented often to maintain reasonable
performance
File Systems
• exFAT (Extended File Allocation Table)
⚬ partitions can extend up extremely large, max 512TiB
(Tebibyte)
⚬ Files up to 16EiB can be stored
⚬ not compatible with Linux/Unix
⚬ should be defragmented often
⚬ cannot pre-allocate disk space
File Systems
• HFS Plus (Hierarchical File System)
⚬ Max Volume is 8EB
⚬ Files can be as large as the partition
⚬ Windows users can read but not write
⚬ Drivers are available that allows Linux users to read and
write in HFS+ volumes.
File Systems
• EXT (extended file system)
⚬ was created to be used with the Linux kernel
⚬ ext4 is the most recent version
⚬ max volume up to 1 EiB
⚬ 16 TB max file size
⚬ XFS is recommended by RedHat for voluume over 100TB
⚬ ext4 is backward compatible with ext3 and ext2
⚬ can preallocate space
⚬ windows and mac OS cannot read ext file system
Logical Volume Manager (LVM)
• Logical Volume Manager or LVM
• A method of flexible disk space management
• Ability to add disk space to a logical volume and its filesystem
while the filesystem is mounted and active.
• Allows multiple physical hard drives into a single volume group
• Volume groups can be partitioned into logical volumes
Logical Volume Manager (LVM)
• commands
⚬ fdisk -l //disk partition information
⚬ pvs //physical volumes information
⚬ vgs //volume group information
⚬ lvs //logical volume information
⚬ lsblk //available block devices
• pvcreate newdisk //to add disk
• vgextend vg_name newdisk //add added disk to Volume Group
• lvextend -l +100%FREE vg_name //create logical volume on free space
Init
• Stands for Initialization
• The first process started during the booting of the computer
system
• daemon process that continues running until the system is
shutdown
• A direct or indirect ancestor of all other processes
• automatically adopts all orphaned processes
• PID or Process ID is 1
• create processes from a script stored in /etc/inittab
⚬ configuration file used by initialization system
⚬ last step of kernel boot sequence
Init
• Init script initializes the service
• responsible for initializing the system
• init scripts are also called rc scripts (run command scripts)
• Also used in UNIX
Init - services
• Start a service
⚬ service [service-name] start
• Stop a service
⚬ service [service-name] stop
• restart a service
⚬ service [service-name] restart
• reload a service
⚬ service [service-name] reload
• service status
⚬ service [service-name] status
Init - services
• Restart service if already running
⚬ service [service-name] condrestart
• enable service at startup
⚬ chkconfig [service-name] on
• disable service at startup
⚬ chkconfig [service-name] off
• check if service is enabled at startup
⚬ chkconfig [service-name]
• create new service file or modify configuration
⚬ chkconfig [service-name] add
Run-levels
• State of init
• group of processes are defined to start at the startup of OS
• Mode of operation in the computer operating system
• Each run level has a certain number of services started or
stopped
Run-levels
• Seven Run levels exist ($ runlevel digit or $ init digit)
⚬ 0: Shuts down the system
⚬ 1: single-user mode
⚬ 2: multi-user mode without networking
⚬ 3: multi-user mode with networking (with CLI)
⚬ 4: user-definable
⚬ 5: multi-user mode with networking (with GUI)
⚬ 6: reboots the system to restart it
Run-levels
• By default, Linux based systems boot on runlevel 3 or 5
• user can modify preset runlevels
• create new ones according to the requirements
• Runlevel 2 and 4 are used for user defined runlevels
• runlevel 0 and 6 aur used for shutdown and reboot the system
Systemd
• Systemd is the new init framework
• system and service manager for Linux operating systems
• new distros are moving to systemd
• managing services with systemd
⚬ systemctl: control system and services
⚬ journalctl: manage journal, systemd's logging system
⚬ hostnamectl: control hostname
⚬ localectl: configure locale and keyboard layout
⚬ timedatectl: set time and date
⚬ systemd-cgls: shows cgroup contents
⚬ systemadm: front-end for systemctl
Systemd - services
• see all services (running or not)
⚬ systemctl list-units --type service --all
• Start a service
⚬ systemctl start [service-name]
• Stop a service
⚬ systemctl stop [service-name]
• restart a service
⚬ systemctl restart [service-name]
• reload a service
⚬ systemctl reload [service-name]
Systemd - services
• see service status
⚬ systemctl status [service-name]
• Restart a service if already running
⚬ systemctl condrestart [service-name]
• Enable service at startup
⚬ systemctl enable [service-name]
• Disable service at startup
⚬ systemctl disable [service-name]
• check if service is enable at start up
⚬ systemctl is-enabled [service-name]
Systemd - services
• create new serivce file or modify configuration
⚬ systemctl daemon-reload
• systemctl halt
• systemctl poweroff
• systemctl reboot
Learning Objectives
Module 2 - Lecture 6
• Linux Permissions
• Disk Partition / Logical Volume Management
• Run levels / init / systemd
Next Lecture
Module 2 - Lecture 7
• Advanced commands
Ask Questions!!

More Related Content

Similar to CSA-lecture 6.pptx

Linux administration training
Linux administration trainingLinux administration training
Linux administration trainingiman darabi
 
KMSUnix and Linux.pptx
KMSUnix and Linux.pptxKMSUnix and Linux.pptx
KMSUnix and Linux.pptxGanesh Bhosale
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
 
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 filesystemsAcácio Oliveira
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1sdiviney
 
12-introductiontolinuxos-190907073928
12-introductiontolinuxos-19090707392812-introductiontolinuxos-190907073928
12-introductiontolinuxos-190907073928SahilNegi60
 
12 introduction to Linux OS
12 introduction to Linux OS12 introduction to Linux OS
12 introduction to Linux OSHameda Hurmat
 
File system discovery
File system discovery File system discovery
File system discovery DevMix
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_bMohammad Reza Beygi
 

Similar to CSA-lecture 6.pptx (20)

Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
 
Linux administration training
Linux administration trainingLinux administration training
Linux administration training
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
4. Centos Administration
4. Centos Administration4. Centos Administration
4. Centos Administration
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
KMSUnix and Linux.pptx
KMSUnix and Linux.pptxKMSUnix and Linux.pptx
KMSUnix and Linux.pptx
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
3. introduction of centos
3. introduction of centos3. introduction of centos
3. introduction of centos
 
Linux
LinuxLinux
Linux
 
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
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1
 
9781111306366 ppt ch11
9781111306366 ppt ch119781111306366 ppt ch11
9781111306366 ppt ch11
 
Daemons
DaemonsDaemons
Daemons
 
Linux commands
Linux commandsLinux commands
Linux commands
 
12-introductiontolinuxos-190907073928
12-introductiontolinuxos-19090707392812-introductiontolinuxos-190907073928
12-introductiontolinuxos-190907073928
 
12 introduction to Linux OS
12 introduction to Linux OS12 introduction to Linux OS
12 introduction to Linux OS
 
File system discovery
File system discovery File system discovery
File system discovery
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Unix _linux_fundamentals_for_hpc-_b
Unix  _linux_fundamentals_for_hpc-_bUnix  _linux_fundamentals_for_hpc-_b
Unix _linux_fundamentals_for_hpc-_b
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

CSA-lecture 6.pptx

  • 2. Recap Module 2 - Lecture 5 • Bourne-Again Shell (bash) • Linux Kernel • User Management • System Administration
  • 3. Learning Objectives Module 2 - Lecture 6 • Linux Permissions • Disk Partition / Logical Volume Management • Run levels / init / systemd
  • 4. Linux permissions • User (u): Owner of the file or directory • Group (g): Group of users added to have similar permissions • Others (o): anyone else other than owner and the group
  • 5. Linux permission Types • Read (r): Read the contents of a file • Write (w): Write and edit the contents of a file or a directory • Execute (x): Execute a program that is written in a file or directory
  • 6. • Read has value 4 • Write has value 2 • Execute has value 1 Linux permission Types
  • 7. • 10 characters in Linux Permission String (output of ls -al) ⚬ First Character is the type of the file, ⚬ The first three characters of the remaining nine characters are permissions for the user ⚬ The middle three characters are permissions for group ⚬ Last three characters are permissions for others Linux permission String
  • 9. Linux permission Symbolic • User => u • Group => g • Others => o • All => a • read => r • write => w • execute => x • + => add • - => remove • = => set
  • 11. chmod - Change Mode • chmod command is used to change the permissions of a file or directory ⚬ chmod [permissions] [filename] ⚬ chmod -R [permissions] [directoryname]
  • 12. chown - Change Ownership • chown command is used to change the ownership of a file or directory ⚬ chown [user:group] [filename] ⚬ chown -R [user:group] [directoryname]
  • 13. chown - Change Ownership
  • 14. Disk Partition - Linux • Creation of one or more regions on secondary storage • Created to manage regions separately • The first step of preparing a newly installed disk • Done before creating file system
  • 15. Disk Partition - Linux • data partition: normal Linux system data, including the root partition containing all data to start up and run the system • swap partition: expansion of computer's physical memory, extra memory on hard disk.
  • 16. parted • sudo parted -l //list the devices • list contain ⚬ model of the storgae device ⚬ Name and size of the disk ⚬ logical and physical size of the disk ⚬ Type of partition table ⚬ information about size, type, file system, and flags • Select disk that needs to be partitioned ⚬ sudo fdisk /dev/sdb
  • 17. parted • if not selected the right disk, use the 'select' command in parted interface • mklabel gpt //select the partition table as shown in parted -l • 'print' to confirm the selection • mkpart primary ext4 1MB 1855MB ⚬ This will create a primary partition of 1854 MB with an ext4 file system • partition can be ⚬ primary: Hold OS files. Max 4 partitions ⚬ extended: Special partitions, can be more than 4 ⚬ logical: Partition inside extended partition
  • 18. fdisk • creating and manipulating disk partition table • Partition functions ⚬ view ⚬ create ⚬ delete ⚬ change ⚬ resize ⚬ copy ⚬ move
  • 19. fdisk • fdisk -l //list the partition table • fdisk -l /dev/sdb //specific disk • fdisk /dev/sdb //to open command interface for fdisk ⚬ m //list the fdisk commands ⚬ p //print the partition table for specific disk ⚬ d //delete partition ⚬ w //write the partition table after changes ⚬ n //new partition ■ p //primary ■ e //extended • fdisk -s partition //check size of a partition
  • 20. fdisk • Format partition when created • mkfs.ext4 newly-created-partition • Partition: ⚬ physical subset of a disk • filesystem: ⚬ logical hierarchy of directories and files
  • 21. File Systems • NTFS (New Technology File System) ⚬ Partition can extend upto 16EB (16 million TB) ⚬ Files stored can be as large as the partition ⚬ ocassionally becomes fragemented and should be defragmented every one to two months ⚬ read from and write to Windows and linux, whereas read from MacOS X. However, can written using NTFS-3G driver
  • 22. File Systems • FAT (File Allocation Table) ⚬ Cannot exceed 2TB ■ (Windows cannot form larger than 32GB, Mac OS X can) ⚬ partitions larger than 32GB are not recommended ⚬ Files stored cannot exceed 4GB ⚬ need to be defragmented often to maintain reasonable performance
  • 23. File Systems • exFAT (Extended File Allocation Table) ⚬ partitions can extend up extremely large, max 512TiB (Tebibyte) ⚬ Files up to 16EiB can be stored ⚬ not compatible with Linux/Unix ⚬ should be defragmented often ⚬ cannot pre-allocate disk space
  • 24. File Systems • HFS Plus (Hierarchical File System) ⚬ Max Volume is 8EB ⚬ Files can be as large as the partition ⚬ Windows users can read but not write ⚬ Drivers are available that allows Linux users to read and write in HFS+ volumes.
  • 25. File Systems • EXT (extended file system) ⚬ was created to be used with the Linux kernel ⚬ ext4 is the most recent version ⚬ max volume up to 1 EiB ⚬ 16 TB max file size ⚬ XFS is recommended by RedHat for voluume over 100TB ⚬ ext4 is backward compatible with ext3 and ext2 ⚬ can preallocate space ⚬ windows and mac OS cannot read ext file system
  • 26. Logical Volume Manager (LVM) • Logical Volume Manager or LVM • A method of flexible disk space management • Ability to add disk space to a logical volume and its filesystem while the filesystem is mounted and active. • Allows multiple physical hard drives into a single volume group • Volume groups can be partitioned into logical volumes
  • 27. Logical Volume Manager (LVM) • commands ⚬ fdisk -l //disk partition information ⚬ pvs //physical volumes information ⚬ vgs //volume group information ⚬ lvs //logical volume information ⚬ lsblk //available block devices • pvcreate newdisk //to add disk • vgextend vg_name newdisk //add added disk to Volume Group • lvextend -l +100%FREE vg_name //create logical volume on free space
  • 28.
  • 29. Init • Stands for Initialization • The first process started during the booting of the computer system • daemon process that continues running until the system is shutdown • A direct or indirect ancestor of all other processes • automatically adopts all orphaned processes • PID or Process ID is 1 • create processes from a script stored in /etc/inittab ⚬ configuration file used by initialization system ⚬ last step of kernel boot sequence
  • 30. Init • Init script initializes the service • responsible for initializing the system • init scripts are also called rc scripts (run command scripts) • Also used in UNIX
  • 31. Init - services • Start a service ⚬ service [service-name] start • Stop a service ⚬ service [service-name] stop • restart a service ⚬ service [service-name] restart • reload a service ⚬ service [service-name] reload • service status ⚬ service [service-name] status
  • 32. Init - services • Restart service if already running ⚬ service [service-name] condrestart • enable service at startup ⚬ chkconfig [service-name] on • disable service at startup ⚬ chkconfig [service-name] off • check if service is enabled at startup ⚬ chkconfig [service-name] • create new service file or modify configuration ⚬ chkconfig [service-name] add
  • 33. Run-levels • State of init • group of processes are defined to start at the startup of OS • Mode of operation in the computer operating system • Each run level has a certain number of services started or stopped
  • 34. Run-levels • Seven Run levels exist ($ runlevel digit or $ init digit) ⚬ 0: Shuts down the system ⚬ 1: single-user mode ⚬ 2: multi-user mode without networking ⚬ 3: multi-user mode with networking (with CLI) ⚬ 4: user-definable ⚬ 5: multi-user mode with networking (with GUI) ⚬ 6: reboots the system to restart it
  • 35. Run-levels • By default, Linux based systems boot on runlevel 3 or 5 • user can modify preset runlevels • create new ones according to the requirements • Runlevel 2 and 4 are used for user defined runlevels • runlevel 0 and 6 aur used for shutdown and reboot the system
  • 36. Systemd • Systemd is the new init framework • system and service manager for Linux operating systems • new distros are moving to systemd • managing services with systemd ⚬ systemctl: control system and services ⚬ journalctl: manage journal, systemd's logging system ⚬ hostnamectl: control hostname ⚬ localectl: configure locale and keyboard layout ⚬ timedatectl: set time and date ⚬ systemd-cgls: shows cgroup contents ⚬ systemadm: front-end for systemctl
  • 37. Systemd - services • see all services (running or not) ⚬ systemctl list-units --type service --all • Start a service ⚬ systemctl start [service-name] • Stop a service ⚬ systemctl stop [service-name] • restart a service ⚬ systemctl restart [service-name] • reload a service ⚬ systemctl reload [service-name]
  • 38. Systemd - services • see service status ⚬ systemctl status [service-name] • Restart a service if already running ⚬ systemctl condrestart [service-name] • Enable service at startup ⚬ systemctl enable [service-name] • Disable service at startup ⚬ systemctl disable [service-name] • check if service is enable at start up ⚬ systemctl is-enabled [service-name]
  • 39. Systemd - services • create new serivce file or modify configuration ⚬ systemctl daemon-reload • systemctl halt • systemctl poweroff • systemctl reboot
  • 40. Learning Objectives Module 2 - Lecture 6 • Linux Permissions • Disk Partition / Logical Volume Management • Run levels / init / systemd
  • 41. Next Lecture Module 2 - Lecture 7 • Advanced commands