0% found this document useful (0 votes)
123 views4 pages

Linux LVM Practical Guide

This document summarizes a Linux experiment performed by a student. It includes 4 questions about Linux Volume Management: 1) How to scan a new disk for LVM physical volumes, 2) How to extend an existing volume group by 50GB, 3) How to reduce the size of an LVM partition, and 4) The steps to create a logical volume from scratch. The student provides the commands and steps to answer each question. They conclude with the key learning outcomes from completing the experiment.

Uploaded by

TAHLEEL RASHID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views4 pages

Linux LVM Practical Guide

This document summarizes a Linux experiment performed by a student. It includes 4 questions about Linux Volume Management: 1) How to scan a new disk for LVM physical volumes, 2) How to extend an existing volume group by 50GB, 3) How to reduce the size of an LVM partition, and 4) The steps to create a logical volume from scratch. The student provides the commands and steps to answer each question. They conclude with the key learning outcomes from completing the experiment.

Uploaded by

TAHLEEL RASHID
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LINUX EXPERIMENT – 9

Student Name: Vaibhav UID: 20MCA1024


Branch: MCA Section/Group: 1\A
Semester: 1ST Date of Performance: 22/12/2020
Subject Name: Linux Administration Lab Subject Code:CAT-618

1. Aim/Overview of the practical:


• How to do you scan the new disk for LVM physical volume?

• Assume Volume group “vg02” is already exists. Provide all the steps with commands
to extend the volume group with 50GB ?.

• How to Reduce Or Shrink The Size Of LVM ParLLon?

• What are the steps involved to create the logical volume from scratch?

2. Steps/Commands involved to perform practical:

QUES .1:How to do you scan the new disk for LVM physical volume?

The vgscan command scans all supported disk devices in the system looking for LVM
physical volumes and volume groups. This builds the LVM cache file in the
/etc/lvm/cache/.cache file, which maintains a listing of current LVM devices.

LVM runs the vgscan command automatically at system startup and at other times during
LVM operation, such as when you execute a vg create command or when LVM detects an
inconsistency.

This study source was downloaded by 100000837639765 from [Link] on 12-13-2021 [Link] GMT -06:00

[Link]
This study source was downloaded by 100000837639765 from [Link] on 12-13-2021 [Link] GMT -06:00

[Link]
QUES.2:Assume Volume group “vg02” is already exists. Provide all the
steps with commands to extend the volume group with 50GB?
Firstly, create Physical volume (/dev/sdaX, where X is the partition number) of size 50GB.
Now run following command: # vgextend vgname /dev/sdaX

This study source was downloaded by 100000837639765 from [Link] on 12-13-2021 [Link] GMT -06:00

[Link]
QUES.3:How to Reduce Or Shrink The Size Of LVM Partition?
Step:1 Umount the file system. ...
Step:2 check the file system for Errors using e2fsck command. ...
Step:3 Reduce or Shrink the size of /home to desire size. ...
Step:4 Now reduce the size using lvreduce command. ...
Step:5 (Optional) For the safer side, now check the reduced file system for errors.
QUES.4: What are the steps involved to create the logical volume from scratch?
Step 1: Partitioning the disk for creating Physical volume. ...
Step 2: Creating with Physical volume (PV). ...
Step 3: Creating with Volume Group (VG). ...
Step 4: Creating with Logical Volume (LV). ...
Step 5: Creating and mounting the filesystem in Linux.

Learning outcomes (What I have learnt):


1. To scan the new disk for LVM physical volume
2. Assume Volume group “vg02” is already exists. Provide all the steps with commands to
extend the volume group with 50GB ?.
3. To Reduce Or Shrink The Size Of LVM Partition?
4. Steps involved to create the logical volume from scratch?

This study source was downloaded by 100000837639765 from [Link] on 12-13-2021 [Link] GMT -06:00

[Link]
Powered by TCPDF ([Link])

Common questions

Powered by AI

The vgscan command is used to scan all supported disk devices for LVM physical volumes and volume groups. This command is run automatically by LVM during system startup and also when inconsistent situations are detected or when specific LVM commands are executed .

Checking for errors before resizing a filesystem is crucial because resizing can potentially corrupt a filesystem if it already contains errors. These errors can lead to data loss or inconsistencies if not resolved prior to resizing operations. Thus, running checks like e2fsck ensures the filesystem's stability before any modifications .

The vgscan command scans all disk devices for LVM physical volumes and volume groups, building a cache file of current LVM devices during system startup. This ensures that the logical volume manager is aware of all available volumes, maintaining stability and consistency by refreshing and validating the system's understanding of the available storage resources .

The process of creating a logical volume from scratch involves the following steps: first, partition the disk for use as a physical volume. Then, create and configure the physical volume (PV). Next, establish a volume group (VG) that includes the physical volume. Afterward, create the logical volume (LV) within the volume group. Finally, create and mount a filesystem on the logical volume .

Unmounting a filesystem before resizing is necessary to prevent access conflicts and to avoid corruption. When a filesystem is unmounted, it ensures that no processes are using it, allowing safe manipulation of its underlying storage without risking data integrity. This step is critical in maintaining the system's stability during modifications .

The vgextend command is used when there is a need to increase the storage capacity of an existing volume group. This is typically required when the demand for storage space exceeds the current allocation within a volume group, necessitating the addition of more physical volumes to the volume group .

To extend an existing volume group, first create a new physical volume on the partition you intend to use, e.g., /dev/sdaX. Then execute the command: # vgextend vg02 /dev/sdaX which adds the new physical volume to the volume group named 'vg02', extending it by 50GB .

Shrinking a logical volume involves several steps: first, unmount the filesystem using the volume. Next, check the filesystem for errors with the e2fsck command. Then, reduce the size of the logical volume using the lvreduce command. Optionally, check the reduced file system for errors again to ensure integrity .

Creating and mounting a filesystem on a newly created logical volume is significant as it prepares the logical storage space for use by applications and users. The filesystem structures the raw storage space, enabling data storage, retrieval, and management. Mounting the filesystem subsequently integrates it into the system hierarchy, making it accessible for use .

Failing to run the vgscan command can result in LVM being unaware of available physical volumes and volume groups, leading to potential inconsistencies and improper operation of logical volumes. This can impede system performance and reliability, as the system may not correctly utilize available storage or handle LVM-related tasks effectively .

You might also like