I have a 13.9 GB harddisk (/dev/sda). Initially it just had one
partition /dev/sda1 of size 5766 MB. To demonstrate LVM, using fdisk
utility I partitioned my harddisk in following manner:
PARTITION SIZE (MB) TYPE FILESYSTEM
/dev/sda1 5766 PRIMARY ext3
/dev/sda2 1653 PRIMARY
/dev/sda3 1653 PRIMARY
/dev/sda4 4886 EXTENDED
To use /dev/sda2 & /dev/sda3 for Logical Volume Manager, follow the
following steps:
1.] Using fdisk utility change the partition id of /dev/sda2 and
/dev/sd3 to lvm (8e)
fdisk /dev/sda
m
p
l
m
t
Partition number: 2
Hex Code: 8e
p
w
fdisk /dev/sda
p
l
t
Partition Number: 3
Hex Code: 8e
p
w
#partprobe
#pvdisplay
#pvcreate /dev/sda2
#pvdisplay
#pvscan
#vgdisplay
#vgscan
#vgcreate Volgroup001 /dev/sda2
#vgscan
#vgdisplay
#lvdisplay
#lvscan
#lvcreate -L 788.48m -n cdrive /dev/Volgroup001
#lvdisplay
#lvscan
#lvdisplay
#lvscan
#lvcreate -l 196 -n ddrive /dev/Volgroup001
#lvdisplay
#lvscan
#pvdisplay
#vgdisplay
#vgscan
#vgextend /dev/Volgroup001 /dev/sda3
#vgscan
#vgdisplay
#lvscan
#lvdisplay
#lvextend -L +788.48m /dev/Volgroup001/cdrive
#lvscan
#lvdisplay
#mke2fs -j /dev/Volgroup001/ddrive
#mount /dev/Volgroup001/ddrive /var2
#dd if=/dev/null /var2/file1 count=780MB
#lvextend -l +196 /dev/Volgroup001/ddrive
#resize2fs /dev/Volgroup001/ddrive
#dd if=/dev/null /var2/file1 count=780MB
can you please describe it more elaborately??
ReplyDelete