- OS : Ubuntu 16.04.6 LTS
- Kernel : 4.4.0-157-generic
ubuntu 의 경우 RHEL 과 다르게 DM 구성이 자동으로 진행 됨.
별도의 /etc/multipath.conf 파일 구성이 필요 없음.
1. Multipath-tools 설치
# apt-get -y install multipath-tools
실행 확인
# systemctl status multipath-tools.service
● multipathd.service - Device-Mapper Multipath Device Controller
Loaded: loaded (/lib/systemd/system/multipathd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-08-02 06:57:30 KST; 4min 40s ago
Process: 1394 ExecStartPre=/sbin/modprobe dm-multipath (code=exited, status=0/SUCCESS)
Main PID: 1408 (multipathd)
Status: "running"
Tasks: 6
Memory: 4.5M
CPU: 65ms
CGroup: /system.slice/multipathd.service
└─1408 /sbin/multipathd -d -s
Aug 02 06:57:30 _servername_ multipathd[1408]: 360060e80072b8e0000302b8e00003000: load table [0 41943040000 multipath 0 0 1 1 round-robin 0 2 1 8:16 1 8:32 1]
Aug 02 06:57:30 _servername_ multipathd[1408]: 360060e80072b8e0000302b8e00003000: event checker started
Aug 02 06:57:30 _servername_ multipathd[1408]: path checkers start up
Aug 02 06:57:30 _servername_ systemd[1]: Started Device-Mapper Multipath Device Controller.
Aug 02 06:57:31 _servername_ multipathd[1408]: sda: add path (uevent)
Aug 02 06:57:31 _servername_ multipathd[1408]: sda: spurious uevent, path already in pathvec
Aug 02 06:57:31 _servername_ multipathd[1408]: sdb: add path (uevent)
Aug 02 06:57:31 _servername_ multipathd[1408]: sdb: spurious uevent, path already in pathvec
Aug 02 06:57:31 _servername_ multipathd[1408]: sdc: add path (uevent)
Aug 02 06:57:31 _servername_ multipathd[1408]: sdc: spurious uevent, path already in pathvec
2. 스토리지 확인
# fdisk -l
Disk /dev/sdb: 19.5 TiB, 21474836480000 bytes, 41943040000 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/sdc: 19.5 TiB, 21474836480000 bytes, 41943040000 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/360060e80072b8e0000302b8e00003000: 19.5 TiB, 21474836480000 bytes, 41943040000 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
3. DM 구성 확인
# multipath -ll
360060e80072b8e0000302b8e00003000 dm-0 HITACHI,OPEN-V
size=20T features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:0:0 sdb 8:16 active ready running
`- 5:0:0:0 sdc 8:32 active ready running
4. GPT 파티션 구성
# parted /dev/mapper/360060e80072b8e0000302b8e00003000
GNU Parted 3.2
Using /dev/mapper/360060e80072b8e0000302b8e00003000
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/mapper/360060e80072b8e0000302b8e00003000: unrecognised disk label
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/360060e80072b8e0000302b8e00003000: 21.5TB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
(parted) mklabel gpt
(parted) print
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/360060e80072b8e0000302b8e00003000: 21.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted) mkpart primary 0 21.5TB
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? ignore
(parted) print
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/360060e80072b8e0000302b8e00003000: 21.5TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 21.5TB 21.5TB primary
(parted) quit
Information: You may need to update /etc/fstab.
디스크 정보 확인
# fdisk -l
Disk /dev/mapper/360060e80072b8e0000302b8e00003000: 19.5 TiB, 21474836480000 bytes, 41943040000 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: gpt
Disk identifier: 111959D6-AB11-4984-B688-46326D2E23CC
Device Start End Sectors Size Type
/dev/mapper/360060e80072b8e0000302b8e00003000-part1 34 41943039966 41943039933 19.5T Linux filesystem
blkid 로 정보를 확인하면 디바이스 정보가 다르게 나옴.
# blkid
/dev/mapper/360060e80072b8e0000302b8e00003000: PTUUID="111959d6-ab11-4984-b688-46326d2e23cc" PTTYPE="gpt"
/dev/mapper/360060e80072b8e0000302b8e00003000p1: PARTLABEL="primary" PARTUUID="1f6e70d8-6d29-4e3c-b55b-c9a05fa731e0"
리부팅 후 다시 blkid 로 확인하면 동일하게 변경 됨.
# blkid
/dev/mapper/360060e80072b8e0000302b8e00003000-part1: UUID="83325420-7f3e-4b3c-8ce7-7f6764a3af1b" TYPE="ext4" PARTLABEL="primary" PARTUUID="1f6e70d8-6d29-4e3c-b55b-c9a05fa731e0"
디스크 포멧 시 /dev/mapper/360060e80072b8e0000302b8e00003000-part1 사용하면 디스크를 찾지 못하고
/dev/mapper/360060e80072b8e0000302b8e00003000p1을 사용하면 포멧이 진행 됨.
fstab 에 등록 시에는 /dev/mapper/360060e80072b8e0000302b8e00003000-part1 을 사용 해야 됨.
5. 디스크 포멧
# mkfs.ext4 /dev/mapper/360060e80072b8e0000302b8e00003000p1
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 5242879991 4k blocks and 327680000 inodes
Filesystem UUID: 83325420-7f3e-4b3c-8ce7-7f6764a3af1b
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,
2560000000, 3855122432
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
6. fstab 수정
# vi /etc/fstab
-----------------------------------------
/dev/mapper/360060e80072b8e0000302b8e00003000-part1 /data ext4 defaults 0 0
-----------------------------------------
7. 리부팅
8. 디스크 확인
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/360060e80072b8e0000302b8e00003000-part1 20T 20K 19T 1% /data