리눅스 하드디스크 추가 하여 파티션 설정 하기
# fdisk -l 로 추가한 하드디스크 인식 되는지 확인
Disk /dev/sda: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 65140 523237018+ 83 Linux
/dev/sda2 65141 65270 1044225 82 Linux swap / Solaris
Disk /dev/sdb: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sdb가 인식 되었으므로, 새로운 파티션을 추가한다.
# fdisk /dev/sdb
The number of cylinders for this disk is set to 65270.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-65270, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-65270, default 65270): 65270
Command (m for help): p
Disk /dev/sdb: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 65270 524281243+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk -l 파티션 구성 후 확인
Disk /dev/sda: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 65140 523237018+ 83 Linux
/dev/sda2 65141 65270 1044225 82 Linux swap / Solaris
Disk /dev/sdb: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 65270 524281243+ 83 Linux
위와 같이 /dev/sdb의 파티션이 생성 되었다.
# mkfs -t ext3 /dev/sdb1 ☞ 포맷할때 /dev/sdb로 하면 파티션 설정 처음부터 다시 해야함.
포맷 후 /dev/sdb1 파티션이 사용할 디렉토리를 생성한다.
# cd /
# mkdir /data1
# mount /dev/sdb1 /data1 ☞ /dev/sdb1 파티션을 /data1으로 마운트 함
# mount ☞ 현재 파티션 정보 확인
/dev/sda1 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb1 on /data1 type ext3 (rw)
위와 같이 파티션이 추가 되었다
# vi /etc/fstab ☞ 부팅시 자동 마운트 하도록 추가한 파티션을 설정 한다.
LABEL=/ / ext3 defaults 1 1
LABEL=/home1 /home ext3 defaults 1 2
LABEL=/var1 /var ext3 defaults 1 2
LABEL=/usr1 /usr ext3 defaults 1 2
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/boot1 /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/sdb1 /data1 ext3 defaults 1 2
위와 같이 절대경로로 지정을 해 줘야 나중에 디스크 변동이 있어도 정상 작동 한다. 끝.
'기술자료 > 기술운영자료' 카테고리의 다른 글
NFS 자동 마운트가 되지 않을 때... (0) | 2016.03.20 |
---|---|
hp 서버 스마트스타트(smart start) cd 를 이용한 윈도우 설치과정 (0) | 2016.03.20 |
qmail 자료 URL 입니다. (0) | 2016.03.20 |
윈도우 단축키 리스트 및 명령어 (0) | 2016.03.20 |
Microsoft iSCSI Software Initiator (0) | 2016.03.20 |