개발은 하는건가..

IWinV 클라우드에서 블록 스토리지 사용 본문

Server, Maria DBMS

IWinV 클라우드에서 블록 스토리지 사용

수동애비 2023. 2. 15. 10:04
반응형

Iwinv 의 서버 콘솔 페이지에서 스토리지 신청을 한 후

fdisk -l 명령으로 서버에 스토리지 장착 여부 확인.

dev/vdb  가 블록 스토리지 경로 이다.

# fdisk -l

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    52428766    26213359+  83  Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 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 /dev/vdb 명령으로 파티션을 설정한다.

# fdisk /dev/vdb  (엔터)

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x49b42461.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
 

Command (m for help): n (입력)
Command action
e extended
p primary partition (1-4)
p (입력)
Partition number (1-4): 1 (입력)
First sector (2048-419430399, default 2048): (엔터입력)
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399): (엔터입력)
Using default value 419430399 

Command (m for help): wq (입력)
The partition table has been altered! 

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

mkfs.ext4 /dev/vdb 명령으로 스토리지를 포맷한다.

# mkfs.ext4 /dev/vdb1 (입력)

mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52428544 blocks
2621427 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2199912448
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

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

blkid 명령으로 스토리지의 UUID 를 확인한다.

# blkid

/dev/vda1: UUID="f13d84b4-c756-4d89-9d5e-6b534397aa14" TYPE="xfs"
/dev/vdb1: UUID="6e600685-4f09-4047-9784-4867d20f98a5" TYPE="ext4"

vdb1 의 UUID 를 이용해 마운드 한다. (아무런 메세지가 표시되지 않으면 성공이다.)

# mount UUID="6e600685-4f09-4047-9784-4867d20f98a5" /mnt


/etc/fstab  파티션 테이블 파일에  마운드된 파티션을 추가한다.

UUID=f13d84b4-c756-4d89-9d5e-6b534397aa14 /xfs defaults 0 0
UUID=6e600685-4f09-4047-9784-4867d20f98a5 /mnt ext4 defaults,nofail 0 2   (라인추가)


리부팅 후에도 마운트가 잘되어 있는지 확인한다.

# reboot

// 리부팅 후 다시 로그인하여 df -Th 명령으로 확인

# df -Th

Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  3.8G     0  3.8G   0% /dev
tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs          tmpfs     3.9G  8.6M  3.9G   1% /run
tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/vda1      xfs        25G  2.2G   23G   9% /
/dev/vdb1      ext4      197G   61M  187G   1% /mnt           <-- 요놈이 마운트왼 스토리지
tmpfs          tmpfs     783M     0  783M   0% /run/user/0

 

/mnt 디렉터리를 저장소로 사용하거나 symbol link 를 걸어서 사용하면 된다.

 

스토리지를 detach 해야할 경우 . iwinv 사이트에서 해당 스토리지를 detach 한다.

 

'Server, Maria DBMS' 카테고리의 다른 글

[linux] 파일 찾기 명령  (0) 2023.02.20
[linux] 심볼릭 링크(symbolic link) 사용  (0) 2023.02.15
[linux] 실시간 로그 확인  (1) 2023.02.01
[Linux] shell script 작성 기본  (0) 2023.02.01
CentOs 하드 용량 확인  (0) 2022.11.09
Comments