728x90
반응형
리눅스 하드 디스크 추가 방법
리눅스에 새로운 하드디스크 추가시 마운트 하는 방법에 대해 알아 보겠습니다.
umount
umount /dev/sda1
하드디스크 마운트 정보 확인 (fdisk -l )
[root@centos7:/root]$ fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 83 Linux
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 83 Linux
파티션 분리
[root@centos7:/]$ fdisk /dev/sdb
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): h
h: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
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
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Command (m for help): d
No partition is defined yet!
Command (m for help): d
No partition is defined yet!
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1 <-- 첫번째 파티션
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601): +500g <-- 첫번째 파티션 500g
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2 <-- 두번째 파티션
First cylinder (60790-121601, default 60790):
Using default value 60790
Last cylinder or +size or +sizeM or +sizeK (60790-121601, default 121601): <-- 나머지 파티션
Using default value 121601
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): h
h: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
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
Partition number (1-4): 1
Command (m for help): d
Selected partition 2
Command (m for help): d
No partition is defined yet!
Command (m for help): d
No partition is defined yet!
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1 <-- 첫번째 파티션
First cylinder (1-121601, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601): +500g <-- 첫번째 파티션 500g
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2 <-- 두번째 파티션
First cylinder (60790-121601, default 60790):
Using default value 60790
Last cylinder or +size or +sizeM or +sizeK (60790-121601, default 121601): <-- 나머지 파티션
Using default value 121601
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Mount 디렉토리 생성 및 포멧
#마운트할 디렉 토리 생성
mkdir data1
mkdir data2
#ext3 포멧으로 하드디스크 포멧
mkfs.ext3 /dev/sda1
생성 디렉토리에 하드 디스크 마운트
mount -t ext3 /dev/sdb1 /data1
mount -t ext3 /dev/sdb2 /data2
Mount 디렉토리 부팅 설정
- /etc/fstab 파일 수정
/dev/sdb1 /data1 ext3 defaults 0 0
/dev/sdb2 /data2 ext3 defaults 0 0
[root@centos7:/]$ vi /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb1 /data1 ext3 defaults 0 0
/dev/sdb2 /data2 ext3 defaults 0 0
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb1 /data1 ext3 defaults 0 0
/dev/sdb2 /data2 ext3 defaults 0 0
추가된 하드디스크 마운트 확인 (df -h)
[root@centos7:/root]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
448G 343G 82G 81% /
/dev/sda1 99M 26M 68M 28% /boot
tmpfs 2.9G 0 2.9G 0% /dev/shm
/dev/sdb1 917G 200M 871G 1% /data
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
448G 343G 82G 81% /
/dev/sda1 99M 26M 68M 28% /boot
tmpfs 2.9G 0 2.9G 0% /dev/shm
/dev/sdb1 917G 200M 871G 1% /data
728x90
반응형
'06.OS > Linux' 카테고리의 다른 글
[Linux] Centos 7.9 Failed to load SELinux policy, freezing 에러 (0) | 2024.04.16 |
---|---|
[CentOS7] LVM으로 구성된 ROOT 디스크 증설 (1) | 2024.01.30 |
[Linux] ftp put 실행시 에러 [553 Could not create file] (0) | 2022.05.04 |
[Ubuntu]우분투 gif 움짤 프로그램 설치 (0) | 2022.04.16 |
[Linux] 리눅스 캐쉬 메모리 비우기 (0) | 2022.04.12 |