A.
1. Create a 500 MB part of 8e for /home in fdisk
2. U cannot give any label in DD for this - NA
3. Install minimum
B.
# vgscan -
# vgdisplay - will give "no volume groups found"
C. Create a PV called /dev/hda5
Note: 1. In Linux, one cannot access the HW partition hda5 directly -
you go thru the /dev/hda5
'ly, in LVM, one cannot access the HW partition hda5 directly -
you go thru the PV - /dev/hda5
Since Linux and LVM look and access the partition differently -
2. The devdrv name and the PV name are the same, not surprisingly
3. Hence, what linux calls a devdrv, LVM calls a PV
# pvcreate /dev/hda5 <=============================
# pvscan
# pvdisplay /dev/hda5
D. Create a VG called vadapav
# vgcreate vadapav /dev/hda5
# vgscan -
# vgdisplay -
Note : A /dev/vadapav/ dir is created for every VG
E. Create a LV called idli
# lvcreate -l 120 -n idli vadapav <==========================
or
# lvcreate -L 480 -n idli vadapav
which will create
/dev/vadapav/idli ----- Devdrv file is the LV
F. # mke2fs /dev/vadapav/idli <============================
This will Make a FS on hda5 part. of type ext2
I should have given -j
# mount /dev/vadapav/idli /home
# df -h
# umount /home
# tune2fs -j /dev/vadapav/idli
# mount /home
Now u have an ext3 one
To resize a LV :
e2fsadm -l+60 /dev/vadapav/idli
or
e2fsadm -L+240 /dev/vadapav/idli
Adding another Disk
===================
1. fdisk /dev/hdc
* Create a single primary partition the size of the whole disk
* Change id to 8e
* Save and exit from fdisk
* Re-Read new parition table with :
sfdisk -R /dev/hdc
or
hdparm -z /dev/hdc
or
partprobe
or
plain CAD
2. Create PV : # pvcreate /dev/hdc1
3. Add this new PV to the existing VG - vadapav
# vgextend vadapav /dev/hdc1
4. Now resize the old LV - after umounting, of course -
# e2fsadm -l+xxx /dev/vadapav/idli
5. Now mount /dev/vadapav/idli on /home and you have resize /home to
spread across two disks
Removing a Disk
===============
1. Resize the LV - after umounting, of course -
# e2fsadm -l-xxx /dev/vadapav/idli
2. lvremove /dev/vadapav/idli
3. Now remove the LV from the VG too
# vgreduce vadapav /dev/hdc1
***********************************
Summary
=======
A.
1. Create a 500 MB part of 8e for /home in fdisk
2. U cannot give any label in DD for this - NA
3. Install minimum
B.
# pvcreate /dev/hda5 <=============================
C.
# vgcreate vadapav /dev/hda5
D.
# lvcreate -l 120 -n idli vadapav <==========================
E.
# mke2fs -j /dev/vadapav/idli <========================
F.
# mount /dev/vadapav/idli /home
and
configure fstab
Command Used Summary :
====================
* vgscan - Scan LVM system for all VG
* vgdisplay vadapav - To see a particular VG
* vgchange -a n vadapav - To deactivate a VG
* vgremove vadapav - To remove a VG
* vgextend vadapav /dev/hdaX - To add a PV to the VG
* vgreduce vadapav /dev/hdaX - To delete a PV from a VG
* pvscan - Scan LVM system for all PVs
* pvdisplay /dev/hdaX - To see a particular PV
* lvscan - Scan LVM system for all LVs
* lvdisplay /dev/vadapav/idli - To see a particular LV
* lvremove /dev/vadapav/idli - To delete a LV
Alert :
Q: Reduce the LV to 200 MB
RHL9: 1. df -h
/dev/vadapav/idli 101M 4.5M 91M 5% /home
2. umount /dev/vadapav/idli
3. e2fsadm -L200 /dev/vadapav/idli
4. mount -a
Q: Extend the LV to 500 MB
AS4: 1. df -h
/dev/vadapav/idli 101M 4.5M 91M 5% /home
2. lvextend -L500 /dev/vadapav/idli
3. ext2online /dev/vadapav/idli
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment