RAID 구성하자
물리 디스크를 ---> 논리적으로 인식 --> 논리 디스크
논리 디스크를 (묶어서 사용한다) --> 동작 인터페이스 단계
(인덱스)
인터페이스 컨트롤러
RAID 컨트롤러
sda -->
- : 동작방식 : h : ATA or IDE : 병렬 연결 방식
s : SCSI or SATA : 직렬 연결 방식
NVme
/dev --> 운영체제가 인식하는 모든 디바이스
sda1
sda2 --> 논리적 파티션 번호
fdisk -l
Disk /dev/sdb: 106 MB, 106954752 bytes, 208896 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/sda: 21.5 GB, 21474836480 bytes, 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 label type: dos
Disk identifier: 0x000bd6b3
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 41943039 19921920 8e Linux LVM
Disk /dev/sdc: 106 MB, 106954752 bytes, 208896 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/sdd: 106 MB, 106954752 bytes, 208896 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/sde: 106 MB, 106954752 bytes, 208896 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/centos-root: 18.2 GB, 18249416704 bytes, 35643392 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/centos-swap: 2147 MB, 2147483648 bytes, 4194304 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
[root@localhost dev]#
----> 시스템이 인식한 디스크
[root@localhost dev]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1913568 0 1913568 0% /dev
tmpfs 1930540 0 1930540 0% /dev/shm
tmpfs 1930540 12592 1917948 1% /run
tmpfs 1930540 0 1930540 0% /sys/fs/cgroup
/dev/mapper/centos-root 17811456 13380824 4430632 76% /
/dev/sda1 1038336 246640 791696 24% /boot
//192.168.0.120/ferhan 248923608 72645128 176278480 30% /share/mnt
tmpfs 386108 0 386108 0% /run/user/0
192.168.0.182:/share/jin 47285760 12140032 35145728 26% /share/nfs
tmpfs 386108 8 386100 1% /run/user/42
[root@localhost dev]#
---> 현재 작동 중인
mkfs -t ext4 /dev/sdb1
---> 포멧 /share/sdb1_mount
mkdir -p /share/sdb1_mount
mount -t ext4 /dev/sdb1/share/sdb1_mount
[root@localhost share]# mount -t ext4 /dev/sdb1 /share/sdb1_mount
[root@localhost share]# cd sdb1_mount/
[root@localhost sdb1_mount]# ls
lost+found
[root@localhost sdb1_mount]#
umount /share/sdb1_mount
논리 인덱스 시켜준다
[root@localhost share]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdb: 106 MB, 106954752 bytes, 208896 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 label type: dos
Disk identifier: 0x6869c3d3
Device Boot Start End Blocks Id System
/dev/sdb1 2048 208895 103424 fd Linux raid autodetect
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): d
Selected partition 1
Partition 1 is deleted
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
raw data binary data meta data bunlara boylede diyorlarmis
순수한 상태
md0
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
mkfs -t ext4 /dev/md0 --> 포미션 생성하고 무조건 포멧 시켜야돼
mount -t ext4 /dev/md0 /share/sdb0_mount/
md1
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1
mkfs -t ext4 /dev/md1
mount -t ext4 /dev/md1 /share/sdb1_mount/
치우기 /
mdadm --stop /dev/mdX
mdadm --remove /dev/mdX(stop이 안되는 경우 : 에러 발생 시)
md1
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1
mkfs -t ext4 /dev/md1
mount -t ext4 /dev/md1 /share/sdb1_mount/
df --> 마운트 확인
raid 0 raid 0 ---> raid 1 만들기
실습
umount /dev/md0
umount /dev/md1
mdadm --remove /dev/md0
mdadm --remove /dev/md1
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sdd1 /dev/sde1
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/md0 /dev/md1
mkfs -t ext4 /dev/md2
mkdir -p /share/sdb1_mount
mount -t ext4 /dev/md2 /share/raid0
blkid
vim /etc/fstab
UUID=45e8099d-48b1-43e5-955b-7df0a38cb64b /share/raid0 ext4 defaults 0 0
UUID=09d8d8e6-e021-4ba6-851f-3ae94e2f61f0 /share/raid1 ext4 defaults 0 0
실습 2
1+0 좋아
raid 1 raid 1 --> raid 0
umount /dev/md2
mdadm --stop /dev/md0
mdadm --stop /dev/md1
mdadm --stop /dev/md2
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1
mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/md0 /dev/md1
mkfs -t ext4 /dev/md2
mount -t ext4 /dev/md2 /share/raid0
vim /etc/fstab
UUID=2edd8ed0-aca8-4485-9c29-d2a2d59e0619 /share/raid0 ext4 defaults 0 0
실습 3
RAID 5 거의 표준
레이드 컨틀러에서 기본 적용
3대 이상 필요
umount /dev/md2 mount olani sile
mdadm --stop /dev/md0 onceki olusturdugumuz raid i siliyoruz
mdadm --stop /dev/md1
mdadm --stop /dev/md2
yeni raid olusturma
mdadm --create /dev/md5 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
-C -l5 -n 4
이상을 찾으세요 --> 이상이 없는데
mkfs -t ext4 /dev/md5 format
mount -t ext4 /dev/md5 /share/raid0 tekrar mount ettik
vim /etc/fstab kapatip acildigindada kalabilmesi icin fstab e kaydediyoruz
UUID=2109d20c-d251-4938-b1e0-7e18280f4afe /share/raid0 ext4 defaults 0 0
[root@localhost ~]# mdadm --detail /dev/md5
/dev/md5:
Version : 1.2
Creation Time : Wed Jun 21 15:21:01 2023
Raid Level : raid5
Array Size : 304128 (297.00 MiB 311.43 MB)
Used Dev Size : 101376 (99.00 MiB 103.81 MB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Wed Jun 21 15:40:44 2023
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : resync
Name : localhost.localdomain:5 (local to host localhost.localdomain)
UUID : 05fa009e:a7cc0a64:c01c2bea:fb35d62f
Events : 20
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
2 8 49 2 active sync /dev/sdd1
4 8 65 3 active sync /dev/sde1
[root@localhost ~]#
'RHEL' 카테고리의 다른 글
centOS-7 기본 (0) | 2023.06.26 |
---|---|
Disk quota (0) | 2023.06.22 |
phpmyadmin (0) | 2023.06.21 |