1. vmware에서 원하는 용량만큼 새로운 hard disk를 생성
2. fdisk -l 에서 83 형식
3. ext3.mkfs
4. mkdir /새로운 폴더
5. mount /디바이스 /불일폴더
6. vi /etc/fstab 편집
1. 루트로 터미널 창으로 접속함
2. 연결된 하드 디스크 내용 확인
[root@localhost ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 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 1288 10241437+ 83 Linux
/dev/sda3 1289 1925 5116702+ 83 Linux
/dev/sda4 1926 3916 15992707+ 5 Extended
/dev/sda5 1926 2180 2048256 82 Linux swap / Solaris
/dev/sda6 2181 2307 1020096 83 Linux
/dev/sda7 2308 3916 12924261 83 Linux
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
3. 파티션 하기
[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 2610.
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)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n 새롭게 파티션을 만들 때 n(new) 입력
Command action
e extended
p primary partition (1-4)
p 주 파티션
Partition number (1-4): 1 주 파티션 번호
First cylinder (1-2610, default 1): 1 시작 실린더번호
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): 엔터 : 모든용량
Using default value 2610
Command (m for help): p 파티션 생성시 설정한 옵션 볼 수 있음
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 2610 20964793+ 83 Linux
Command (m for help): w 파티션 저장
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
4. 파티션 완료 된 디스크를 포맷, 주의할 점 장치명을 적을 때 뒤에 숫자 1을 적어주어야 함
[root@localhost ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2621440 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
160 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5. 디렉토리를 생성해서 마운트 작업을 함
[root@localhost ~]# mkdir /data
[root@localhost ~]# mount /dev/sdb1 /data
6. 재부팅 후에도 적용되도록 /etc/fstab 파일에 등록
[root@localhost ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/app /app ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=/home /home ext3 defaults 1 2
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
LABEL=SWAP-sda5 swap swap defaults 0 0
/dev/sdb1 /data ext3 defaults 1 2 내용 추가
:wq!
7. 장치확인
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 4.8G 3.0G 1.5G 67% /
/dev/sda7 12G 12G 279M 98% /app
/dev/sda6 965M 80M 836M 9% /var
/dev/sda2 9.5G 1.1G 8.0G 12% /home
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 506M 0 506M 0% /dev/shm
/dev/sdb1 20G 173M 19G 1% /data