logo completenetworkingnotes.com

RHCE LVM notes guides tutorials

Search Completenetworkingnotes.com Now


Home Workgroup N+ CCNA IPv6 RHCE Interview Tips n Tricks Hardware Troubleshooting
Basic Wireless Security

RHCE Linux lvm partitions

Form the beginning of RHCE exam RedHat always includes a question about LVM partitions. So you must be able to create the LVM partition and mount them properly in
/etc/fstab

Example of questions

  • One Logical Volume named lv00 is created under vg00. The Initial Size of that Logical Volume is 100MB. Now you required the size 500MB. Make successfully the size of that Logical Volume 500M without losing any data. As well as size should be increased online.
  • One Logical Volume is created named as lv00 under vg00 volume group and is mounted. The Initial Size of that Logical Volume is 124MB. Make successfully that the size of Logical Volume 245MB without losing any data. The size of logical volume 240MB to 255MB will be acceptable.

Explanations of basic definitions

The LVM system organizes hard disks into Logical Volume (LV) groups. Essentially, physical hard disk partitions (or possibly RAID arrays) are set up in a bunch of equal sized chunks known as Physical Extents (PE). As there are several other concepts associated with the LVM system, here we will discuss only some basic definitions those require in rhce:

  • Physical Volume (PV) is the standard partition that you add to the LVM mix. Normally, a physical volume is a standard primary or logical partition. It can also be a RAID array.
  • Physical Extent (PE) is a chunk of disk space. Every PV is divided into a number of equal sized PEs. Every PE in a LV group is the same size. Different LV groups can have different sized PEs.
  • Logical Extent (LE) is also a chunk of disk space. Every LE is mapped to a specific PE.
  • Logical Volume (LV) is composed of a group of LEs. You can mount a filesystem such as /home and /var on an LV.
  • Volume Group (VG) is composed of a group of LVs. It is the organizational group for LVM.

Create lvm partition and resize them

Run fdisk   /dev/sda to invoke fdisk. Make sure your hard disk status via fdisk -l command before it. If you see /dev/hda in the output of fdisk -l command run fdisk  /dev/hda instead of fdisk /dev/sda linux command  fdisk -l

Now run these command in given sequence

n
press enter
+100M

n
press enter
+100M

n
press enter
+100M

linux fdisk command lvm partitons

after creating partition define their file type and save via w command. lvm partitions are denoted as 8e. run these command exactly ( caution:- change only the partition you create )

t
7
8e

t
8
8e

t
9
8e

w

linux lvm file type 8e

Now tell kernel about this change run partprobe command

fdisk -l show partitions

Create physical volume from newly created partition and then we will create a volume group to use these physical volumes.

lvm pvcreate command

Create 2 lvm partition from this volume group

lvm lvcreate

For format you can use either mke2fs with -j switch or just single command mkfs.ext3
I used both command for illustration

mke2fs and mkfs.ext3 command

mke2fs mkfs.ext3 command

now we will define mount point to use this partitions

lvm mount

We can use these partitions until system reboot if you are asked to mount these partition permanently use these steps.

Run vi /etc/fstab
vi /etc/fstab
( fstab :- file contain information about linux partition )
( vi :- editing command if have problem using vi follow this link)

Make entry of newly created lvm partition

/dev/vg00/lv00	/data/lv00	ext3		defaults	0 0
/dev/vg00/lv01	/data/lv01	ext3		defaults	0 0

in the end of files as shown in figure and save the file.

vi /etc/fstab

In this tutorial we learn how to create lvm partition and mount them permanently
In next article we will learn how to resize the lvm partitions.

RHCE Study guide home
Paper Code Cast Durations
List of Exam topics
Structure Of Filesystem
Login in to Linux Terminals
vi editor switches basic
vi advance descriptions
System admin Commands
cat cp mv rm mkdir pwd
help wc spell aspell tty who head tail man info help cat bzip gzip pwd cd mkdir du df find history which whereis ps top pstree uname shadow,passwd, group files
chkconfig ntsysv Tools
User Managements useradd userdel groupadd groupdel su sudo user profile files from /etc/skel
Manage file permission chown chgrp chmod command description
chmod command example
sticky bit
access control list setfacl getfacl chattr
remove root password login problem and solution
RedHat Package Manager
how to secure terminal
fstab file and error
Removing grub password
Disk managements simple partitions LVM logical volume manger Example disk quota managements Raid partition Swap partition
lan card driver, Network configuration files commands ip ifconfig ping netstat arp mii-tool Linux as a router , create virtual LAN card
Deny icmp ping request
increase virtual terminal, Set default id, Disable alt ctrl delete key
Network configurations
job scheduling with at commands cron commands
Configure telnet server
configure ssh server
configure ftp server
Configure syslog server
configure nis server
configure nfs server
configure dhcp server
configure web server
configure samba server
configure vnc server
configure printer server
configure dns server
configure dns slave server
configure squid server
configure sendmail server
configure yum server
network installation via ftp and nfs server
via apache server
Home Bookmark and Share RHCE