• 돌아가기
  • 아래로
  • 위로
  • 목록
  • 댓글
Linux

리눅스 디스크 추가 후 연결(마운트)하기.

달소 달소 107

0

0

 

안녕하세요. 달소입니다.

 

이번편은 예전에 작성했던 글중하나인데
리눅스 시스템에 디스크를 추가 후 마운트/인식 시키는 방법입니다.
(오래전글이라 반말체 양해부탁드립니다~)

 

앞서 ESXi에서 게스트의 디스크를 추가한다고해서 바로 디스크가 늘어나지 않는다. Ubuntu 같은경우 마운트 과정을 진행해줘야한다.

현재 마운트되어있는 디스크를 확인하는 명령어는 fdisk -l 명령어이다.

image.png.jpg

 
기본으로 사용하고있는 디스크 1 50G는 /dev/sda1에 마운트되어있다.

fdisk /dev/sda1(장치이름) 으로 fdisk 를 사용할수있는데 명령어는 아래와 같다.

Help:

DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag

Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition

Misc
m print this menu
u change display/entry units
x extra functionality (experts only)

Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file

Save & Exit
w write table to disk and exit
q quit without saving changes

Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table

image.png.jpg

 
추가할 디스크 /dev/sdb

image.png.jpg

 
n 명령어를 누른후에는 default 값만 적어도 무방하다(Enter)
마지막에는 w 명령어로 저장해줘야 기록이 완료된다.

image.png.jpg

 
p명령어를 통해 제대로 만들어졌는지 확인이 가능하다.

추가후에는 포맷 -> 마운트를 통해 제대로 사용할수있다.

image.png.jpg

 
mkfs -t ext4 /dev/sdb1 으로 포맷

마운트 같은경우 나는 /data 폴더에 마운트하도록 하겠다.

mkdir /data
mount /dev/sdb1 /data

image.png.jpg

 
df -h /dev/sdb1 으로 마운트가 정상적으로 완료되었음을 확인할수있다.

여기까지가 일반 마운트 과정이고. 지금까지한것들은 재부팅 하면 다풀린다.. 디스크의 정보는 /etc/fstab 에 저장되기때문에 여기에 새로 마운트한 정보를 입력해주어야한다.

image.png.jpg

 
/etc/fatab를 보면 이렇게 등록되어있는데 이형식으로 넣으면된다.

왼쪽부터
UUID, 마운트 포인트, 파일시스템 종류, 마운트 옵션, dump, 무결성 검사 우선순위 순서이다.

UUID는 blkid 명령어를 이용해서 확인이 가능하다.

image.png.jpg

 
/dev/sdb1의 UUID복사.

/etc/fstab

image.png.jpg

 
두번째 줄이 /dev/sdb1이다 default -> defaults

맨위에 1, 2 옵션은 덤프가능 + fsck 무결성검사 2순위라는 뜻이다.
ex) 0,1 이면 덤프 불가 + 무결성 검사 1순위.

이제 재부팅을하던 뭘하던 새로추가한 디스크를 사용할수있다.

신고공유스크랩
0

댓글 쓰기 권한이 없습니다. 로그인

취소 댓글 등록

신고

"님의 댓글"

이 댓글을 신고하시겠습니까?

댓글 삭제

"님의 댓글"

삭제하시겠습니까?


목록

공유

facebooktwitterpinterestbandkakao story

본 게시판은 서버구축 게시판과 통합되었습니다.

서버구축 게시판 이동하기
분류 제목 글쓴이 날짜 조회 추천
공지 서버OS(ESXi/Linux/Router 등) 게시판 이용안내. 달소 21.11.16.17:43 587 +1
ESXi 공지 ESXi 관련 추천글 모음 5 달소 21.04.23.12:19 3761 +6
ESXi USB LAN으로 ESXi8 설치하기.(Feat. Realtek LAN) 15 달소 23.01.01.18:51 2188 +2
Assistant OS 당신이 알아야할 새로운 스탠다드 Matter란 무엇인가 5 DarkAcid 22.12.30.02:38 740 +1
Proxmox 인텔 igpu는 gvt-g를 이용해 두개 이상의 가상머신에 패스스루 해줄 수 있네요. 13 니즛 22.12.23.02:19 1380 +1
Linux
image
달소 23.01.05.10:23 365 0
Linux
image
콜라 23.01.03.23:07 622 0
Linux
image
달소 22.11.01.01:16 3314 +2
Linux
image
달소 22.07.25.17:04 504 0
Linux
image
달소 22.07.25.16:48 42 0
Linux
image
달소 22.07.25.11:23 559 +1
Linux
image
달소 22.07.16.20:46 151 0
Linux
image
달소 22.07.16.18:09 11074 +2
Linux
image
달소 22.07.15.14:41 2506 +1
Linux
image
달소 22.07.13.12:08 631 0
Linux
image
달소 22.06.20.11:45 297 +2
Linux
image
달소 22.06.17.11:41 1728 +2
Linux
image
나스초보 22.06.13.14:07 160 0
Linux
image
KelvinKang 22.05.18.11:15 429 +1
Linux
image
KelvinKang 22.05.18.09:03 470 +2
Linux
image
달소 22.05.12.10:58 1900 +2
Linux
image
달소 22.05.11.22:32 1741 +4
Linux
image
FocalFossa 22.03.25.10:10 679 +4
Linux
image
달소 22.03.04.17:16 352 0
Linux
image
달소 22.02.04.22:47 147 +1
Linux
image
달소 21.12.24.15:39 1560 0
Linux
image
달소 21.12.06.23:14 793 0
Linux
image
달소 21.12.06.22:58 1692 +1
Linux
image
달소 21.12.06.22:24 339 0
Linux
image
달소 21.12.01.18:09 460 0
Linux
image
달소 21.12.01.17:23 134 0
Linux
image
달소 21.11.24.15:14 832 0
Linux
image
달소 21.11.24.14:58 3665 +1
Linux
image
달소 21.10.13.16:44 258 +2
Linux
image
올리고당 21.08.25.10:10 148 +1
Linux
image
달소 21.08.18.22:29 98 0
Linux
image
달소 21.08.14.13:35 152 0
Linux
image
달소 21.08.09.12:01 93 0
Linux
image
달소 21.06.25.15:43 197 +1
Linux
image
달소 21.06.22.13:19 818 0
Linux
image
달소 21.06.16.13:26 107 0
Linux
image
달소 21.06.09.15:58 338 0
Linux
image
달소 21.06.09.15:16 270 0
Linux
image
썩은준치 21.02.10.12:15 551 +1
Linux
image
달소 21.02.04.23:43 232 0
Linux
image
달소 21.01.27.15:18 204 0
Linux
image
달소 21.01.26.13:25 256 0
Linux
image
달소 21.01.06.15:38 1420 0
Linux
image
달소 21.01.02.13:32 1838 0