Jiniya

WEB

[LINUX] HDD 추가 방법

1. 서버에 하드 추가 후 OS 부팅시 하드가 올라오는지 확인한다.
 
2. 현재구성 확인
2-1. vi /etc/fstab을 열어 ext2, ext3인지 판단
2-2. fdisk -l
 
3. fdisk로 파티션을 잡는다.
3-1. fdisk /dev/hdb (IDE 하드인 경우)
3-2. fdisk /dev/sdb (SCSI 하드인 경우)
3-3. fdisk /dev/cciss/c0d1 (HP서버 smart array controller 경우) <- 부팅시 new logical volume 설정해주어야함
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 partitions 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):
3-2. p로 기존 파티션이 잡혀있는지 확인한다.
3-3. d로 기존 파티션이 잡혀있으면 삭제후 p로 확인한다.
3-4. n으로 파티션 추가- > p(primary로) -> 1 -> 크기지정 default 1 입력(Full로 잡을시, 디폴트가 Full) -> 엔터
3-5. w로 쓴다.
 
4. format
ext3 : mke2fs -j /dev/hdb or sdb or c0d1p1(파티션나누엇다면 c0d1p1,c0d1p2 등으로 포멧)
ext2 : mkfs -t ext2 /dev/hdb
 
5. 마운트할 디렉토리 생성
mkdir home2
 
6. mount
ext3 : mount -t ext3 /dev/hdb /home2
ext2 : mount -t ext2 /dev/hdb /home2
 
7. fstab 수정 (vi /etc/fstab)
ex)
/dev/hdb /home2 ext3 defaults 1 2 (앞 두부분만 수정)
 
8. df -h로 마운트 확인
 
9. 재부팅후 이상없이 올라온후 마운트 되었는지 확인