계속 까먹어서 정리해야겠음..




참고. 

http://blog.daum.net/99lib/9

http://blog.boxcorea.com/wp/archives/448

https://wiki.gentoo.org/wiki/LVM/ko




# LVM 

: Logical Volume Manager


- 여러 물리적인 디스크를 하나의 논리적인 디스크처럼 사용할 수 있음. (RAID와 비슷)

- raid처럼 parity, mirroring등을 지원하지 않음

- 하지만 RAID보다 비교적 관리가 쉽고, 확장성, 안정성, 효율, 스냅샷지원 등의 이유에서 많이 사용됨




출처. http://ivanvillareal.com/linux/migrate-from-direct-partition-to-lvm/



1. Hard Drives -> Paritions

: LVM 타입으로 파티션 생성 (생략 가능한 듯)


# fdisk /dev/sda

(8e, linux LVM)



2. Partitions -> PV

: 물리볼륨을 생성


# pvcreate /dev/sda1

Physical volume "/dev/sda1" successfully created


# pvdisplay



3. PV -> VG

: 볼륨그룹을 생성


# vgcreate myVolumeGroup /dev/sda1 [나머지 PV들 나열]

Volume group "myVolumeGroup" successfully created


# vgdisplay


4. VG -> LV

: 논리볼륨을 생성


# lvcreate -n lv1 -L 5GB myVolumeGroup

Logical volume "lv1" created


# lvcreate -n lv2 -l 100%FREE myVolumeGroup

Logical volume "lv2" created


# lvdisplay


5. File System 

: 파일시스템 포맷 및 마운트


# mkfs.ex4 /dev/myVolumeGroup /lv1

mkfs.ex4 /dev/myVolumeGroup /lv2


# mkdir /mnt/volume1

# mkdir /mnt/volume2

# mount -t ext4 /dev/myVolumeGroup /lv1 /mnt/volume1

# mount -t ext4 /dev/myVolumeGroup /lv2 /mnt/volume2

( # mount -a)


# df -l

(# df -f)


# vi /etc/fstab

/dev/myVolumeGroup       /mnt/volume1    ext4    0    0

( UUID=(위에서 확인한 uuid)  /srv/repository  ext4  errors=remount-ro  0  1)







--------------------------------------------------------------------------------------------------------------------------------------------------------------

root@controller:~# fdisk -l


Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000bf3f3


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1            2048   390625279   195311616   fd  Linux raid autodetect

/dev/sda2       390625280   878907391   244141056   fd  Linux raid autodetect

/dev/sda3       937711616   976771071    19529728   fd  Linux raid autodetect

/dev/sda4       878907392   937711615    29402112   fd  Linux raid autodetect


Partition table entries are not in disk order


Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d3a7b


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *        2048   390625279   195311616   fd  Linux raid autodetect

/dev/sdb2       390625280   878907391   244141056   fd  Linux raid autodetect

/dev/sdb3       937711616   976771071    19529728   fd  Linux raid autodetect

/dev/sdb4       878907392   937711615    29402112   fd  Linux raid autodetect


Partition table entries are not in disk order


Disk /dev/md1: 500.0 GB, 499999834112 bytes                                        * RAID 0으로 구성한 md1을 Linux LVM으로 바꾸었었는데

2 heads, 4 sectors/track, 122070272 cylinders, total 976562176 sectors        이런 경우 어떤의미를 가지는지 생각해봐야 할 듯.

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

Disk identifier: 0x0357007d


    Device Boot      Start         End      Blocks   Id  System

/dev/md1p1            2048   976562175   488280064   8e  Linux LVM


Disk /dev/md2: 40.0 GB, 39995834368 bytes

2 heads, 4 sectors/track, 9764608 cylinders, total 78116864 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

Disk identifier: 0x00000000


Disk /dev/md2 doesn't contain a valid partition table


Disk /dev/md3: 60.2 GB, 60214476800 bytes

2 heads, 4 sectors/track, 14700800 cylinders, total 117606400 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

Disk identifier: 0x00000000


Disk /dev/md3 doesn't contain a valid partition table


* 기존에 RAID 0 으로 설정했던 md0을 cinder-volumes로 사용하기 위하여 LVM physical volume으로 생성하기 위해 일단 "mdadm –manage –stop /dev/md0"으로 md를 중지 후"pvcreate"로 physical volume 생성

* cinder volume 생성한 것


// 1GB 짜리

Disk /dev/mapper/cinder--volumes-volume--ee1bc346--f489--42c4--b73a--135e97acf2b4: 1073 MB, 1073741824 bytes

255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000


Disk /dev/mapper/cinder--volumes-volume--ee1bc346--f489--42c4--b73a--135e97acf2b4 doesn't contain a valid partition table


// 20GB 짜리

Disk /dev/mapper/cinder--volumes-volume--5d6c6e13--f9e3--4146--9df2--ffbe312599c1: 21.5 GB, 21474836480 bytes            

255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors            

Units = sectors of 1 * 512 = 512 bytes 

Sector size (logical/physical): 512 bytes / 512 bytes  

I/O size (minimum/optimal): 512 bytes / 512 bytes 

Disk identifier: 0x00000000 


Disk /dev/mapper/cinder--volumes-volume--5d6c6e13--f9e3--4146--9df2--ffbe312599c1 doesn't contain a valid partition table

--------------------------------------------------------------------------------------------------------------------------------------------------------------




# cinder volume 삭제하는데 오래걸리는 구나


'System > Linux OS ' 카테고리의 다른 글

man  (0) 2015.12.24
리눅스 커널 커밋(commit)하기 - ing  (0) 2015.12.23
[Linux] 리눅스 모니터링  (0) 2015.04.22
[ubuntu] 디스크 늘리기(ESXi기반의 VM)  (0) 2015.04.21
[Linux]라우팅 테이블  (0) 2015.04.21

+ Recent posts