15.LVM

  • Upload
    maleem

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

  • 8/11/2019 15.LVM

    1/6

    1 LVM BY DIPAK SINGH

    Logical Volume Management

    LVM is used to create logical volumes on the single or multiple Hard Disk Drives,we can extend/reduce the size of logical volumes on the running system without

    any loss of data. Whenever we required the changes into logical volumes we caneasily make, we can also attach new disk and add the space of that disk into existedlogical volume.

    Logical volume id = 8e

    How to create Logical Volume :-

    Create 3 partition and convert into LVM

    #fdisk /dev/sdaPress n for new partition Press l for logical partition First cylinder size : (leave empty) press enter onlyLast cylinder size : +1GPress t to change id into LVM Type partition no : 7Hexadecimal code : 8eCreate two more partition as above createdPress w to save and quit

    Now reboot the system to update the Kernel partition table.

    #reboot Now create Physical Volumes (PV) using available Hard Disks or Partitions (here we can

    assume the partitions as Hard Disks if we dont have Multiple Hard Disk installed on thesystem)

    #pvcreate /dev/sda7 /dev/sda8 /dev/sda9

    OR

    #pvcreate /dev/sda{7,8,9}

    #pvscan [to display initialized Physical Volumes or PV]

    #pvdisplay [to display information about Physical Volumes or PV ]

  • 8/11/2019 15.LVM

    2/6

  • 8/11/2019 15.LVM

    3/6

  • 8/11/2019 15.LVM

    4/6

    4 LVM BY DIPAK SINGH

    How to remove the Logical Volumes: -

    #umount /lvmtest

    #vim /etc/fstab

    /dev/vg1/lv100 /lvmtest ext4 defaults 0 0 [delete this entry]:wq [save and quit]

    #lvremove /dev/vg1/lv100Type y (yes to remove active logical volume)

    #vgremove /dev/vg1

    #pvremove /dev/sda{7,8,9,10}

    #fdisk /dev/sda (now remove the partitions which are using as LVM )

    Pressd to delete the partitions

    Type partition no(1-10): 10

    Delete 3 more partitions also in the same manner.

    :wq [save and quit]

    #reboot [reboot the machine to update the kernel partition table]

  • 8/11/2019 15.LVM

    5/6

  • 8/11/2019 15.LVM

    6/6

    6 LVM BY DIPAK SINGH

    Expanding and reducing the size of Logical Volume in GUI: -

    System Administration Logical-Volume-Management

    Locate the LVM under logical view of new VG select LVM

    Example: - Volume Groups

    New VG

    Logical View

    [LV-200]

    Select the tab [edit properties]

    Specify size to reduce or extend

    How to extend Volume group in GUI environment: -

    Create a new partition and convert its id into LVM as created in above pacticals. Initialize new partition as Physical Volume Add the Physical Volume to the already existed VG1.