물리 장치는 논리 장치에 마운트 되어야한다.
/dev/sr0은 리눅스의 ODD(CD/DVD-ROM)물리장치
리눅스의 물리장치는 논리장치(디렉토리)와 연계된 상태에서 사용할 수 있다.(마운트)
물리장치 → /dev
외부에 있는 스토리지에서 볼륨을 마운트하여 사용하는 경우에는 로컬에서 vda, vda와 같은 형태로 보이기도 한다. vda → vda1, vda2
mount /dev/sr0 /test : /dev/sr0(물리장치)를 /test에 mount
umount /test or umount /dev/sr0
[로컬에서 mount/umount]
[root@srv7 ~]# mkdir /test
[root@srv7 ~]# mount /dev/sr0 /test
mount: /dev/sr0 is write-protected, mounting read-only
[root@srv7 ~]# mount | grep /dev/sr0
/dev/sr0 on /test type iso9660 (ro,relatime)
[root@srv7 ~]# umount /test
[root@srv7 ~]# ls /test/
# mount를 원격지에서 하게되면 nfs
[원격지 nfs mount/umount]
# 1.1.1.1에 /remote를 로컬의 /test에 mount
mount -t nfs 1.1.1.1:/remote /test
mount 정보를 지속적으로 유지하고싶다면 /etc/fstab 에 기록해둔다. OS가 부팅시에 읽어들인다.
LVM

FT(Fault Tolerance) : 결함허용이 가능해야한다. 결함에 의해 데이터가 손실 되더라도 복구가 가능해야 한다.
RAID
RAID0

RAID1

RAID4

RAID5

RAID10 (1+0)

결국 RAID를 사용하면 데이터를 안정적으로 관리할 수 있다. 또한 쓰기 속도를 향상시킬 수 있다.
로컬에 디스크 추가하기
단점 : 전원을 꺼야 함
전원 종료
디스크 추가 후 부팅
Edit virtual machine settings> Add > Hard Disk > SCSI > Create~ > 5GB > Finish
아직 사용할 수없음(파티셔닝,포맷,마운트 등등 해야함)
파티셔닝
[root@srv7 ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb
[root@srv7 ~]#
아직 sdb는 파티셔닝되지않았기때문에 1,2 이런식으로 되어있지않음
[root@srv7 ~]# 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.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x87e535d0.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set
Command (m for help): p
Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 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: 0x87e535d0
Device Boot Start End Blocks Id System
/dev/sdb1 2048 10485759 5241856 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@srv7 ~]# fdisk -l | grep /dev/sdb
Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
/dev/sdb1 2048 10485759 5241856 83 Linux
포맷
포맷 - 파일시스템을 해당 디스크에 적용
[root@srv7 ~]# mkfs.ext4 /dev/sdb1
[root@srv7 ~]# mkdir /added
[root@srv7 ~]# mount /dev/sdb1 /added
[root@srv7 ~]# touch /added/test.txt
[root@srv7 ~]# ls /added/
lost+found test.txt
[root@srv7 ~]# df | grep /added
/dev/sdb1 5028480 20472 4729532 1% /added
재부팅 후에도 마운트 정보 유지
vi /etc/fstab
맨 아래에 해당 내용 추가
/dev/sdb1 /added ext4 defaults 0 0
재부팅 후 확인
[root@srv7 ~]# ls -l /added
total 16
drwx------ 2 root root 16384 Jul 21 14:41 lost+found
-rw-r--r-- 1 root root 0 Jul 21 14:42 test.txt
[root@srv7 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 914488 0 914488 0% /dev
tmpfs 931512 0 931512 0% /dev/shm
tmpfs 931512 10520 920992 2% /run
tmpfs 931512 0 931512 0% /sys/fs/cgroup
/dev/mapper/centos-root 17811456 5234212 12577244 30% /
/dev/sdb1 5028480 20472 4729532 1% /added
/dev/sda1 1038336 189004 849332 19% /boot
tmpfs 186304 32 186272 1% /run/user/0
/dev/sr0 4600876 4600876 0 100% /run/media/root/CentOS 7 x86_64
df : 마운트된 파일 시스템의 크기, 용량 보여주는 명령어 ㅊ