프린트 하기

OS환경 : Oracle Linux 7.4 (64bit)


방법 : 리눅스7 새로넣은 디스크 mount 시키기

fdisk -l 로 디스크 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# fdisk -l
 
Disk /dev/sdb: 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: 0x7ced59ba
 
   Device Boot      Start         End      Blocks   Id  System
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 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: 0x000f0d7f
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   104857599    51915776   8e  Linux LVM
 
Disk /dev/mapper/ol-root: 44.8 GB, 44770000896 bytes, 87441408 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/ol-swap: 8388 MB, 8388608000 bytes, 16384000 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

20GB 디스크를 추가한 상태 

/dev/sdb 부분 확인



fdisk 명령으로 파티션 설정

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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): n {n 입력}
Partition type:
   p   primary (0 primary0 extended, 4 free)
   e   extended
Select (default p): p {p 입력}
Partition number (1-4default 1): 1 {1 입력}
First sector (2048-41943039default 2048):  {엔터 입력}
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039default 41943039): {엔터 입력}  
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set
 
Command (m for help): w {w 입력}
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.

n

p

1

엔터

엔터

w

로 설정



fdisk -l 로 디스크 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# fdisk -l
 
Disk /dev/sdb: 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: 0x7ced59ba
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    41943039    20970496   83  Linux
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 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: 0x000f0d7f
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   104857599    51915776   8e  Linux LVM
 
Disk /dev/mapper/ol-root: 44.8 GB, 44770000896 bytes, 87441408 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/ol-swap: 8388 MB, 8388608000 bytes, 16384000 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

/dev/sdb1 이 만들어짐



현재 사용중인 파일시스템 확인

1
2
3
4
5
6
7
8
9
10
# df -Th
Filesystem          Type      Size  Used Avail Use% Mounted on
devtmpfs            devtmpfs  3.9G     0  3.9G   0/dev
tmpfs               tmpfs     3.9G     0  3.9G   0/dev/shm
tmpfs               tmpfs     3.9G  9.3M  3.9G   1/run
tmpfs               tmpfs     3.9G     0  3.9G   0/sys/fs/cgroup
/dev/mapper/ol-root xfs        42G   26G   17G  61/
/dev/sda1           xfs       497M  205M  292M  42/boot
tmpfs               tmpfs     797M   12K  797M   1/run/user/42
tmpfs               tmpfs     797M     0  797M   0/run/user/0

xfs 파일시스템을 사용중임(Linux 7 기본 Filesystem xfs)

linux 6 버전까지는 ext4를 사용하였음



xfs 파일시스템으로 포맷

1
2
3
# mkfs.xfs /dev/sdb1
mkfs.xfs: /dev/sdb1 appears to contain an existing filesystem (ext4).
mkfs.xfs: Use the -f option to force overwrite.

테스트 시 잘못만들어서 ext4로 생성됨



위 메세지가 발생할 경우 -f 옵션을 주고 오버라이팅 시키면됨

1
2
3
4
5
6
7
8
9
10
# mkfs.xfs -/dev/sdb1
meta-data=/dev/sdb1              isize=256    agcount=4, agsize=1310656 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0, sparse=0
data     =                       bsize=4096   blocks=5242624, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0



마운트 할 경로 생성

1
# mkdir /oradata1



마운트 및 확인

1
2
3
4
5
6
7
8
9
10
11
12
# mount /dev/sdb1 /oradata1
# df -Th
Filesystem          Type      Size  Used Avail Use% Mounted on
devtmpfs            devtmpfs  3.9G     0  3.9G   0/dev
tmpfs               tmpfs     3.9G     0  3.9G   0/dev/shm
tmpfs               tmpfs     3.9G  9.3M  3.9G   1/run
tmpfs               tmpfs     3.9G     0  3.9G   0/sys/fs/cgroup
/dev/mapper/ol-root xfs        42G   26G   17G  61/
/dev/sda1           xfs       497M  205M  292M  42/boot
tmpfs               tmpfs     797M   12K  797M   1/run/user/42
tmpfs               tmpfs     797M     0  797M   0/run/user/0
/dev/sdb1           xfs        20G   33M   20G   1/oradata1

정상적으로 마운트됨



시스템 재시작 후에도 마운트를 유지하기 위해 /etc/fstab 내용을 수정

1
2
3
4
5
6
7
8
9
10
11
12
# vi /etc/fstab 
#
/etc/fstab
# Created by anaconda on Thu Apr  9 20:41:12 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/ol-root     /                       xfs     defaults        0 0
UUID=399e361f-d4f9-4ca4-871c-8dbe3dd74f63 /boot                   xfs     defaults        0 0
/dev/mapper/ol-swap     swap                    swap    defaults        0 0
/dev/sdb1               /oradata1               xfs     defaults        0 0

파란색 표시한 내용 추가 후 저장



참조 : 리눅스6 새로넣은 디스크 mount 시키기 https://positivemh.tistory.com/259

https://m.blog.naver.com/tequini/221158559907