기본지식
IDE0 HDD : /dev/hda 로 인식됨, 디스크내의 파티션은 hda1 / hda2 / hda3 .....
IDE1 HDD : /dev/hdb 로 인식됨, 디스크내의 파티션은 hdb1 / hdb2 /hdb3....
하드디스크 추가하고 리눅스 부팅후...
1. fdisk -l 로 디스크가 추가된 것을 확인 할 수 있다.
[root@localhost ~]# fdisk -l
Disk /dev/hda: 20.0 GB, 20060651520 bytes
255 heads, 63 sectors/track, 2438 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2438 19478812+ 8e Linux LVM
Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 19457 156288321 7 HPFS/NTFS <- 추가된 hdd
[root@localhost ~]#
2. fdisk로 파티션 설정하기
[root@localhost ~]# fdisk /dev/hdb
The number of cylinders for this disk is set to 19457.
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): p
Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 19457 156288321 7 HPFS/NTFS
Command (m for help): m
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 <- 파티션 삭제
Selected partition 1
Command (m for help): p
Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 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-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457
Command (m for help): p
Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 19457 156288321 83 Linux
Command (m for help): v
5165 unallocated sectors
Command (m for help): w <- 저장하고 종료
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.