Showing posts with label pv. Show all posts
Showing posts with label pv. Show all posts

Thursday, 19 January 2017

[CentOS] Create new VG(Volume Group) (새로운 VG 생성)

1. Attach Physical Hard Disk (하드디스크 장착)


2. Partitioning Disk

#> fdisk -l
#> fdisk [DEVICE_PATH]








- Create partition




- Select partition type





3. Create physical volumn (PV 생성)

#> fdisk -l
#> pvcreate [DEVICE_PATH]
















4. Create Volume Group

If you want to create new volume group, create volume group

#> vgcreate [VG_NAME] [PV_NAME]



5. Create Logical Volume

#> lvcreate -l [PE_SIZE] [LV_NAME] [VG_NAME]


6. Make filesytem

#> mkfs.ext4 [LV_PATH]


7. Mount LV

#> mount -t [TYPE] [LV_PATH] [MOUNT_PATH]


8. Register in file system table

#> vi /etc/fstab

/dev/extvg1/extlv1 /home ext4 defaults 0 0


[CentOS] Extend Volume Group and Logical Volume (VG 볼륨그룹 LV 확장하는 법)

1. Attach Physical Hard Disk (하드디스크 장착)


2. Partitioning Disk

#> fdisk -l
#> fdisk [DEVICE_PATH]








- Create partition




- Select partition type





3. Create physical volumn (PV 생성)

#> fdisk -l
#> pvcreate [DEVICE_PATH]
















4. Extends Volumn Group

#> vgdisplay
#> vgetend [VG_NAME] [PV_NAME]




5. Extends Logical Volume

#> lvdisplay
#> lvextend -l [PE_SIZE] [LV_PATH]




6. Apply extension

#> xfs_growfs [LV_PATH]

Friday, 29 January 2016

[Linux] How to Increase the size of LVM by adding a new disk

1. Check New Disk Device

fdisk -l


2. Create Partition

  2.1. Select Device
fdisk /dev/xvdb

  2.2. New Partition
Command (m for help): n

  2.3. Continue...
Command action
   e   extended
   p   primary partition (1-4)
p

Partition number (1-4): 1

First cylinder (1-2610, default 1): (enter)
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): (enter)

  2.4. Change to a partitions system ID
Command (m for help): t
Selected partition 1

Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

  2.5. Save
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

3. Create PV(Physical Volume)

pvcreate /dev/xvdb1



4. Extend VG(Volume Group)
vgdisplay


vgextend VolGroup /dev/xvdb1


pvscan


5. Extend LV(Logical Volume)

lvdisplay
































lvextend /dev/VolGroup/lv_home /dev/xvdb1


6. Resize File System

resize2fs /dev/VolGroup/lv_home




Before Extention



After Extention