티스토리 뷰

최초 설치 시 파티션 설정은 모두사용 + LVM으로 진행하면


root와 swap으로 잡힌 영역을 제외한 용량이 피지컬 볼륨 상태로 잡혀있다.



utgit@utGit01:~$ df -h

Filesystem                    Size  Used Avail Use% Mounted on

udev                          2.0G     0  2.0G   0% /dev

tmpfs                         396M   11M  385M   3% /run

/dev/mapper/utGit01--vg-root   88G  1.6G   82G   2% /

tmpfs                         2.0G     0  2.0G   0% /dev/shm

tmpfs                         5.0M     0  5.0M   0% /run/lock

tmpfs                         2.0G     0  2.0G   0% /sys/fs/cgroup

/dev/cciss/c0d0p1             472M   54M  394M  13% /boot

tmpfs                         396M     0  396M   0% /run/user/1000

utgit@utGit01:~$ fdisk -l

fdisk: cannot open /dev/cciss/c0d0: Permission denied

fdisk: cannot open /dev/mapper/utGit01--vg-root: Permission denied

fdisk: cannot open /dev/mapper/utGit01--vg-swap_1: Permission denied

utgit@utGit01:~$ sudo fdisk -l

[sudo] password for utgit:

Disk /dev/cciss/c0d0: 465.7 GiB, 500051402752 bytes, 976662896 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

Disklabel type: dos

Disk identifier: 0xd4bf1e25


Device            Boot   Start       End   Sectors   Size Id Type

/dev/cciss/c0d0p1 *       2048    999423    997376   487M 83 Linux

/dev/cciss/c0d0p2      1001470 976662527 975661058 465.2G  5 Extended

/dev/cciss/c0d0p5      1001472 976662527 975661056 465.2G 8e Linux LVM



Disk /dev/mapper/utGit01--vg-root: 89 GiB, 95609159680 bytes, 186736640 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 /dev/mapper/utGit01--vg-swap_1: 4 GiB, 4290772992 bytes, 8380416 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


위처럼 fdisk로 보면 465.2G lvm으로 잡혀 있고 그중에 root 89기가 swap이 4기가 사용중

이미 LVM은 생성이 되어있는거니 별도에 그룹생성이나 이런 작업은 패쓰


root@utGit01:/# vgdisplay
  --- Volume group ---
  VG Name               utGit01-vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.23 GiB
  PE Size               4.00 MiB
  Total PE              119099
  Alloc PE / Size       23818 / 93.04 GiB
  Free  PE / Size       95281 / 372.19 GiB
  VG UUID               KeE5V0-RQQB-W1YS-GG2r-xo96-HGDP-tNeRTj


그룹을 확인해보면 이런 정보가 나옴 젤밑에서 두번째 372.19가 root/swap가 사용하고 남은 공간

저 공간에 대한 마운트를 설정함

일단 로지컬 볼륨 생성

root@utGit01:/# lvcreate -L 300g -n data utGit01-vg

data는 로지컬볼륨 명 utGit01-vg는 볼륨그룹명

생성 후 lvdisplay 해보면

 --- Logical volume ---
  LV Path                /dev/utGit01-vg/data
  LV Name                data
  VG Name                utGit01-vg
  LV UUID                kBE1u9-2Jln-mJNC-TtdJ-0OQy-pksy-LRshoX
  LV Write Access        read/write
  LV Creation host, time utGit01, 2017-04-08 11:41:37 +0900
  LV Status              available
  # open                 0
  LV Size                300.00 GiB
  Current LE             76800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

이렇게 하나가 더 생김

파일시스템으로 생성


root@utGit01:/# mkfs.ext4 /dev/utGit01-vg/data
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 78643200 4k blocks and 19660800 inodes
Filesystem UUID: e3daf9fb-bc4c-4e94-b884-26ea23292e6c
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done


생성 후 마운트

mount /dev/utGit01-vg/data /data


마운트 후 df -h로 확인


Filesystem                    Size  Used Avail Use% Mounted on

udev                          2.0G     0  2.0G   0% /dev

tmpfs                         396M   11M  385M   3% /run

/dev/mapper/utGit01--vg-root   88G  1.6G   82G   2% /

tmpfs                         2.0G     0  2.0G   0% /dev/shm

tmpfs                         5.0M     0  5.0M   0% /run/lock

tmpfs                         2.0G     0  2.0G   0% /sys/fs/cgroup

/dev/cciss/c0d0p1             472M   54M  394M  13% /boot

tmpfs                         396M     0  396M   0% /run/user/1000

/dev/mapper/utGit01--vg-data  296G   63M  281G   1% /data


마운트 후 고정 시킴

blkid로 uuid 확인


sudo vim /etc/fstab에 아래 처럼 추가


UUID=e3853343-ec3b-4933-b0e0-2a872112ed6d     /data     ext4      defaults     0 0

하고나면 영구마운트까지 끝

댓글