SlideShare a Scribd company logo
1 of 16
Download to read offline
Configuring Local Storage
& Filesystems
PRINCE BAJAJ 1
Objectives
❖List, create, delete partitions on MBR and GPT disks
❖Create and remove physical volumes
❖Assign physical volumes to volume groups
❖Create and delete logical volumes
❖Configure systems to mount file systems at boot by universally unique ID (UUID) or label
❖Add new partitions and logical volumes, and swap to a system non-destructively
❖Create and configure file systems
❖Create, mount, unmount, and use vfat, ext4, and xfs file systems
❖Mount and unmount network file systems using NFS
❖Extend existing logical volumes
❖Create and configure set-GID directories for collaboration
PRINCE BAJAJ 2
Introducing Standard Partitions and Filesystems
Step1 : Create partition(fdisk)
Step2: Create filesystem(mkfs)
Step3 : Mount filesystem(mount or fstab entry for persistent mount)
PRINCE BAJAJ
Partition1
ext2
Partition2
ext3
Partition3
ext4
Partition3
ext4
Partition1
ext2
Partition2
ext3
Mount Point Directory Dir1
Mount Point Directory Dir3
Mount Point Directory Dir2
Step 1 & 2
Step 3
MBR Partitioning Layout - 15 Partitions (3 Primary, 12 Logical)
GPT Partitioning Layout - 128 Partitions 3
Introducing Logical Volumes (LVM’s)
Step1 – Create physical volume from disks or partitions (pvcreate)
Step2- Create volume group using physical volume(s)(vgcreate)
Step3 – Create logical volume (lvcreate)
Step4- Create filesystem on logical volume (mkfs)
Step5- Mount file system on mount point(mount or fstab entry for persistent mount)
PRINCE BAJAJ
/dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4
Volume Group – VG1 Volume Group- VG2
Logical Vol1 Logical Vol2
Physical Volume1 Physical volume2
4
❑ Create a standard disk partition of 1 GiB size and mount this on /mnt/partition directory.
• Partition should use xfs file system.
• Mount should be persistent.
PRINCE BAJAJ
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n , Second input : e , Two times Enter(To assign remaining
space for Logical partitions) ,Third input : n , Enter (Default First
sector),Fourth input: +1G ,wq (to save and quit)
To create container for extended partition (Container) and to create
logical partition of size 1 Gib
partprobe To inform kernel about this partition
mkdir /mnt/partition To create mount directory
mkfs.xfs /dev/sda5 To create xfs filesystem on partition
mount /dev/sda5 /mnt/partition To test mounting filesystem temporarily
mount To verify mounted filesystem
vim /etc/fstab
/dev/sda5 /mnt/partition xfs defaults 0 0
:wq
To mount filesystem persistently (to persist across reboot)
mount -a To mount through fstab
lsblk To list block devices
5
❑ Create a disk partition of size 1 GiB and mount this for read only access on /mnt/fat directory.
• Use vfat file system for the partition.
• Mount should be persistent.
PRINCE BAJAJ
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter(Default First sector), Second input : +1G, Enter ,w (to save and
quit)
To create logical partition of 1 GiB size
partprobe To inform kernel about this partition
mkdir /mnt/fat To create mount point directory
mkfs.vfat /dev/sda6 To create vfat filesystem on partition
mount -o ro /dev/sda6 /mnt/fat To test mounting filesystem
mount To verify mounted filesystem
vim /etc/fstab
/dev/sda6 /mnt/fat vfat ro 0 0
:wq
To mount filesystem persistently
lsblk To list block devices
6
❑Configure and add 1 GiB swap space to your System.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter, Enter (Default First sector), Second input : +1G , Enter, Third
input : t ,Enter ,Enter( for default Partition),Fourth input : 82 ,Enter, w (to save and
quit),Enter
To create logical partition of 1 GiB size of
type Linux swap
partprobe To inform kernel about these changes
mkswap /dev/sda7 To configure partition as swap
vim /etc/fstab
/dev/sda7 swap swap defaults 0 0
:wq
Make entry in fstab file
swapon -a To activate swap as per entry in fstab
free -m To verify added swap memory
7
❑Configure logical volume with name lv_volume which should use 200 MiB from volume group vg_group of size 300 MiB.
• ext4 file system should be used
• Mount this on /mnt/log_vol directory and mount should be persistent.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter,Enter (Default first sector) , Second input :+300M ,Enter, Third input :
t,Enter,Enter( for default Partition),Fourth input : 8e ,Enter,w (to save and quit),Enter
To create logical partition of size 300 MiB with type Linux
LVM
partprobe To inform kernel about this partition
pvcreate /dev/sda8 To create physical volume
vgcreate vg_group /dev/sda8 To create volume group from physical volume
lvcreate -n lv_volume -L 200M vg_group To create logical volume on volume group
mkdir /mnt/log_vol To create mount directory
mkfs -t ext4 /dev/vg_group/lv_volume To create ext4 filesystem on logical volume
mount /dev/vg_group/lv_volume /mnt/log_vol To mount filesystem temporarily using mount
mount To verify mounted filesystem
vim /etc/fstab
/dev/vg_group/lv_volume /mnt/log_vol ext4 defaults 0 0
:wq
Make entry in fstab to mount filesystem persistently
mount -a To mount through fstab
8
❑Configure logical volume with name volume which should use 20 PE’s from volume group named group of size 400 MiB.
• Size of PE should be 16 MiB and file system used must be ext4 file system.
• Mount this on /mnt/volume directory and mount should be persistent.
• Use UUID to mount this.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter,Enter (Default first sector), Second input : +400M ,Enter, Third input : t,
Enter, Enter( for default Partition),Fourth input : 8e ,Enter, w (to save and quit),Enter
To create logical partition
partprobe To inform kernel about changes
pvcreate /dev/sda9 To create physical volume
vgcreate -s 16M group /dev/sda9 To create volume group with PE size of 16 MiB
lvcreate -n volume -l 20 group To create logical volume using 20 PE’s from volume group
mkdir /mnt/volume To create mount point
mkfs.ext4 /dev/group/volume To create ext4 filesystem on logical volume
mount /dev/group/volume /mnt/volume To mount filesystem in runtime
mount To verify mounted filesystem
vim /etc/fstab
UUID =? /mnt/volume ext4 defaults 0 0
:wq
To mount persistently through fstab
mount -a To verify mounted filesystem 9
❑Configure logical volume with name lvm from volume group vgroup of size 512 MiB.
• Logical volume should use complete free space on volume group.
• Create ext4 file system on this volume.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n Enter,Enter(Default first sector), Second input : +512M ,Enter, Third
input : t ,Enter,Enter (Default partition), Fourth input : 8e,Enter ,w (to save and
quit),Enter
To create logical partition of type Linux LVM
pvcreate /dev/sda10 To create physical volume
vgcreate vgroup /dev/sda10 To create volume group
lvcreate -n lvm -l 100%FREE vgroup To create logical volume using all space of
volume group
mkfs.ext4 /dev/vgroup/lvm To create ext4 filesystem
lvdisplay To display logical volume(s)
vgdisplay To display volume group(s)
pvdisplay To display physical volume(s)
10
❑Resize the lvm lv_volume so that after reboot size should be in between 230MiB to 260 MiB.
• Make sure complete logical volume should be usable.
PRINCE BAJAJ
Command Action/Description
lvdisplay To display logical volumes
lvextend -r -L +45M /dev/vg_group/lv_volume To extent logical volume and resize the filesystem
11
❑Extend size of LVM with name lvm by 256 MiB.
• Create new partition to increase the size of volume group.
• Format the complete volume with ext4 file system.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter, Enter (Default first sector),Second input :
+300M , Enter,Third input : t ,Enter ,Enter(Default partition)
Fourth input : 8e ,Enter, w (to save and quit),Enter
To create logical partition of type Linux LVM
pvcreate /dev/sda11 To create physical volume
vgextend vgroup /dev/sda11 To extend volume group
lvextend -r -L +256M /dev/vgroup/lvm To extend logical volume
lvdisplay To display logical volume(s)
12
❑Create a standard partition of size 100 MiB and format this with ext4 file system.
• Change the file system to xfs and verify same.
PRINCE BAJAJ
Command Action/Description
fdisk /dev/sda
First input : n ,Enter,Enter(To select default first sector),
Second input :+100MiB ,Enter, w (to save and quit),Enter
To create partition (Logical partition) of 100 MiB size
partprobe To inform kernel about partition table changes
mkfs.ext4 /dev/sda12 To create ext4 filesystem on partition
mkfs.xfs -f /dev/sda12 To change the filesystem type to xfs or to create xfs filesystem
blkid To verify changes
13
❑Create a directory /private/home.
• Set the user ownership to lisa and group ownership to group.
• Give full permissions to group group on this directory.
• User riya should have no access on this directory.
• Add user’s bob and harry to group group.
• Files created by user bob and harry under this directory should have group ownership set to group.
PRINCE BAJAJ
Command Action/Description
mkdir -p /private/home Creating directory path /private/home
chown lisa:group /private/home Changing user and group ownership
chmod g+rwx /private/home Configuring full permissions at group level
setfacl -m u:riya:- /private/home Removing all permissions for user riya
usermod -aG group bob & usermod -aG group harry Adding users to group group
chmod g+s /private/home To set GID bit
getfacl /home/private To display configured access control lists
14
❑Discover the NFS share exported by NFS server ipaserver.example.com.
• Mount the share /nfsshare on directory /nfs/share and mount should be persistent.
• NFS version 3 should be used.
PRINCE BAJAJ
Command Action Description
dnf group install “Network File System Client” Installing NFS client
showmount -e ipaserver.example.com Discovering NFS exports
mkdir -p /nfs/share Creating mount point directory
mount -o nfsvers=3 ipaserver.example.com:/nfshare /nfs/share Mounting NFS share in run time
umount /nfs/share Unmounting NFS share
vim /etc/fstab
ipaserver.example.com:/nfsshare /nfs/share nfs _netdev,nfsvers=3 0 0
:wq
Making entry in fstab file for persistent mount
mount -a Mounting through fstab
mount Verifying the mounted filesystem and version
15
❑Discover the samba share and mount share samba on /samba/smb1 directory with smb1 user.
• Use the password password to mount this share.
PRINCE BAJAJ
Command Action/Description
dnf install samba-client cifs-utils Installing Samba client
smbclient -L ipaserver.example.com Listing Samba shares
mkdir -p /samba/smb1 Creating mount point directory
mount -o username=smb1 //ipaserver.example.com/samba /samba/smb1
Enter the Samba user password : *********
Mounting share in runtime
umount /samba/smb1 Unmounting share
vim /etc/fstab
//ipaserver.example.com/samba /samba/smb1 cifs _netdev,username=smb1,password=password
0 0
:wq
Making entry in fstab file for
persistent mount
mount -a Mounting through fstab
mount Verifying mounted share
16

More Related Content

Similar to Configuring+Disks+and+Filsystems-pdf.pdf

Similar to Configuring+Disks+and+Filsystems-pdf.pdf (20)

EXP_2(20BCA1066 Internet).docx
EXP_2(20BCA1066 Internet).docxEXP_2(20BCA1066 Internet).docx
EXP_2(20BCA1066 Internet).docx
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
RH302 Exam-Red Hat Linux Certification
RH302 Exam-Red Hat Linux CertificationRH302 Exam-Red Hat Linux Certification
RH302 Exam-Red Hat Linux Certification
 
RH302 Exam-Red Hat Linux Certification
RH302 Exam-Red Hat Linux CertificationRH302 Exam-Red Hat Linux Certification
RH302 Exam-Red Hat Linux Certification
 
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
 
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 Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
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
 
Real time systems
Real time systemsReal time systems
Real time systems
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
2.1 design hard disk layout v2
2.1 design hard disk layout v22.1 design hard disk layout v2
2.1 design hard disk layout v2
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
Linux Shell Scripting Presantion
Linux Shell Scripting PresantionLinux Shell Scripting Presantion
Linux Shell Scripting Presantion
 
Linux
Linux Linux
Linux
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system administration
 
Ch12
Ch12Ch12
Ch12
 

Recently uploaded

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Recently uploaded (20)

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

Configuring+Disks+and+Filsystems-pdf.pdf

  • 1. Configuring Local Storage & Filesystems PRINCE BAJAJ 1
  • 2. Objectives ❖List, create, delete partitions on MBR and GPT disks ❖Create and remove physical volumes ❖Assign physical volumes to volume groups ❖Create and delete logical volumes ❖Configure systems to mount file systems at boot by universally unique ID (UUID) or label ❖Add new partitions and logical volumes, and swap to a system non-destructively ❖Create and configure file systems ❖Create, mount, unmount, and use vfat, ext4, and xfs file systems ❖Mount and unmount network file systems using NFS ❖Extend existing logical volumes ❖Create and configure set-GID directories for collaboration PRINCE BAJAJ 2
  • 3. Introducing Standard Partitions and Filesystems Step1 : Create partition(fdisk) Step2: Create filesystem(mkfs) Step3 : Mount filesystem(mount or fstab entry for persistent mount) PRINCE BAJAJ Partition1 ext2 Partition2 ext3 Partition3 ext4 Partition3 ext4 Partition1 ext2 Partition2 ext3 Mount Point Directory Dir1 Mount Point Directory Dir3 Mount Point Directory Dir2 Step 1 & 2 Step 3 MBR Partitioning Layout - 15 Partitions (3 Primary, 12 Logical) GPT Partitioning Layout - 128 Partitions 3
  • 4. Introducing Logical Volumes (LVM’s) Step1 – Create physical volume from disks or partitions (pvcreate) Step2- Create volume group using physical volume(s)(vgcreate) Step3 – Create logical volume (lvcreate) Step4- Create filesystem on logical volume (mkfs) Step5- Mount file system on mount point(mount or fstab entry for persistent mount) PRINCE BAJAJ /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4 Volume Group – VG1 Volume Group- VG2 Logical Vol1 Logical Vol2 Physical Volume1 Physical volume2 4
  • 5. ❑ Create a standard disk partition of 1 GiB size and mount this on /mnt/partition directory. • Partition should use xfs file system. • Mount should be persistent. PRINCE BAJAJ PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n , Second input : e , Two times Enter(To assign remaining space for Logical partitions) ,Third input : n , Enter (Default First sector),Fourth input: +1G ,wq (to save and quit) To create container for extended partition (Container) and to create logical partition of size 1 Gib partprobe To inform kernel about this partition mkdir /mnt/partition To create mount directory mkfs.xfs /dev/sda5 To create xfs filesystem on partition mount /dev/sda5 /mnt/partition To test mounting filesystem temporarily mount To verify mounted filesystem vim /etc/fstab /dev/sda5 /mnt/partition xfs defaults 0 0 :wq To mount filesystem persistently (to persist across reboot) mount -a To mount through fstab lsblk To list block devices 5
  • 6. ❑ Create a disk partition of size 1 GiB and mount this for read only access on /mnt/fat directory. • Use vfat file system for the partition. • Mount should be persistent. PRINCE BAJAJ PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter(Default First sector), Second input : +1G, Enter ,w (to save and quit) To create logical partition of 1 GiB size partprobe To inform kernel about this partition mkdir /mnt/fat To create mount point directory mkfs.vfat /dev/sda6 To create vfat filesystem on partition mount -o ro /dev/sda6 /mnt/fat To test mounting filesystem mount To verify mounted filesystem vim /etc/fstab /dev/sda6 /mnt/fat vfat ro 0 0 :wq To mount filesystem persistently lsblk To list block devices 6
  • 7. ❑Configure and add 1 GiB swap space to your System. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter, Enter (Default First sector), Second input : +1G , Enter, Third input : t ,Enter ,Enter( for default Partition),Fourth input : 82 ,Enter, w (to save and quit),Enter To create logical partition of 1 GiB size of type Linux swap partprobe To inform kernel about these changes mkswap /dev/sda7 To configure partition as swap vim /etc/fstab /dev/sda7 swap swap defaults 0 0 :wq Make entry in fstab file swapon -a To activate swap as per entry in fstab free -m To verify added swap memory 7
  • 8. ❑Configure logical volume with name lv_volume which should use 200 MiB from volume group vg_group of size 300 MiB. • ext4 file system should be used • Mount this on /mnt/log_vol directory and mount should be persistent. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter,Enter (Default first sector) , Second input :+300M ,Enter, Third input : t,Enter,Enter( for default Partition),Fourth input : 8e ,Enter,w (to save and quit),Enter To create logical partition of size 300 MiB with type Linux LVM partprobe To inform kernel about this partition pvcreate /dev/sda8 To create physical volume vgcreate vg_group /dev/sda8 To create volume group from physical volume lvcreate -n lv_volume -L 200M vg_group To create logical volume on volume group mkdir /mnt/log_vol To create mount directory mkfs -t ext4 /dev/vg_group/lv_volume To create ext4 filesystem on logical volume mount /dev/vg_group/lv_volume /mnt/log_vol To mount filesystem temporarily using mount mount To verify mounted filesystem vim /etc/fstab /dev/vg_group/lv_volume /mnt/log_vol ext4 defaults 0 0 :wq Make entry in fstab to mount filesystem persistently mount -a To mount through fstab 8
  • 9. ❑Configure logical volume with name volume which should use 20 PE’s from volume group named group of size 400 MiB. • Size of PE should be 16 MiB and file system used must be ext4 file system. • Mount this on /mnt/volume directory and mount should be persistent. • Use UUID to mount this. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter,Enter (Default first sector), Second input : +400M ,Enter, Third input : t, Enter, Enter( for default Partition),Fourth input : 8e ,Enter, w (to save and quit),Enter To create logical partition partprobe To inform kernel about changes pvcreate /dev/sda9 To create physical volume vgcreate -s 16M group /dev/sda9 To create volume group with PE size of 16 MiB lvcreate -n volume -l 20 group To create logical volume using 20 PE’s from volume group mkdir /mnt/volume To create mount point mkfs.ext4 /dev/group/volume To create ext4 filesystem on logical volume mount /dev/group/volume /mnt/volume To mount filesystem in runtime mount To verify mounted filesystem vim /etc/fstab UUID =? /mnt/volume ext4 defaults 0 0 :wq To mount persistently through fstab mount -a To verify mounted filesystem 9
  • 10. ❑Configure logical volume with name lvm from volume group vgroup of size 512 MiB. • Logical volume should use complete free space on volume group. • Create ext4 file system on this volume. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n Enter,Enter(Default first sector), Second input : +512M ,Enter, Third input : t ,Enter,Enter (Default partition), Fourth input : 8e,Enter ,w (to save and quit),Enter To create logical partition of type Linux LVM pvcreate /dev/sda10 To create physical volume vgcreate vgroup /dev/sda10 To create volume group lvcreate -n lvm -l 100%FREE vgroup To create logical volume using all space of volume group mkfs.ext4 /dev/vgroup/lvm To create ext4 filesystem lvdisplay To display logical volume(s) vgdisplay To display volume group(s) pvdisplay To display physical volume(s) 10
  • 11. ❑Resize the lvm lv_volume so that after reboot size should be in between 230MiB to 260 MiB. • Make sure complete logical volume should be usable. PRINCE BAJAJ Command Action/Description lvdisplay To display logical volumes lvextend -r -L +45M /dev/vg_group/lv_volume To extent logical volume and resize the filesystem 11
  • 12. ❑Extend size of LVM with name lvm by 256 MiB. • Create new partition to increase the size of volume group. • Format the complete volume with ext4 file system. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter, Enter (Default first sector),Second input : +300M , Enter,Third input : t ,Enter ,Enter(Default partition) Fourth input : 8e ,Enter, w (to save and quit),Enter To create logical partition of type Linux LVM pvcreate /dev/sda11 To create physical volume vgextend vgroup /dev/sda11 To extend volume group lvextend -r -L +256M /dev/vgroup/lvm To extend logical volume lvdisplay To display logical volume(s) 12
  • 13. ❑Create a standard partition of size 100 MiB and format this with ext4 file system. • Change the file system to xfs and verify same. PRINCE BAJAJ Command Action/Description fdisk /dev/sda First input : n ,Enter,Enter(To select default first sector), Second input :+100MiB ,Enter, w (to save and quit),Enter To create partition (Logical partition) of 100 MiB size partprobe To inform kernel about partition table changes mkfs.ext4 /dev/sda12 To create ext4 filesystem on partition mkfs.xfs -f /dev/sda12 To change the filesystem type to xfs or to create xfs filesystem blkid To verify changes 13
  • 14. ❑Create a directory /private/home. • Set the user ownership to lisa and group ownership to group. • Give full permissions to group group on this directory. • User riya should have no access on this directory. • Add user’s bob and harry to group group. • Files created by user bob and harry under this directory should have group ownership set to group. PRINCE BAJAJ Command Action/Description mkdir -p /private/home Creating directory path /private/home chown lisa:group /private/home Changing user and group ownership chmod g+rwx /private/home Configuring full permissions at group level setfacl -m u:riya:- /private/home Removing all permissions for user riya usermod -aG group bob & usermod -aG group harry Adding users to group group chmod g+s /private/home To set GID bit getfacl /home/private To display configured access control lists 14
  • 15. ❑Discover the NFS share exported by NFS server ipaserver.example.com. • Mount the share /nfsshare on directory /nfs/share and mount should be persistent. • NFS version 3 should be used. PRINCE BAJAJ Command Action Description dnf group install “Network File System Client” Installing NFS client showmount -e ipaserver.example.com Discovering NFS exports mkdir -p /nfs/share Creating mount point directory mount -o nfsvers=3 ipaserver.example.com:/nfshare /nfs/share Mounting NFS share in run time umount /nfs/share Unmounting NFS share vim /etc/fstab ipaserver.example.com:/nfsshare /nfs/share nfs _netdev,nfsvers=3 0 0 :wq Making entry in fstab file for persistent mount mount -a Mounting through fstab mount Verifying the mounted filesystem and version 15
  • 16. ❑Discover the samba share and mount share samba on /samba/smb1 directory with smb1 user. • Use the password password to mount this share. PRINCE BAJAJ Command Action/Description dnf install samba-client cifs-utils Installing Samba client smbclient -L ipaserver.example.com Listing Samba shares mkdir -p /samba/smb1 Creating mount point directory mount -o username=smb1 //ipaserver.example.com/samba /samba/smb1 Enter the Samba user password : ********* Mounting share in runtime umount /samba/smb1 Unmounting share vim /etc/fstab //ipaserver.example.com/samba /samba/smb1 cifs _netdev,username=smb1,password=password 0 0 :wq Making entry in fstab file for persistent mount mount -a Mounting through fstab mount Verifying mounted share 16