일단 VMWare 로 20GB 하드디스크를 추가한다

 

Setting -> add -> Hard Disk -> Create a new virtural disk -> SCSI -> 20 GB (Store virtual disk as a single file)

-> Finish

 

재부팅 후 디스크 조회

[root@chan ~]# 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

sdb 에 20기가짜리 하드디스크가 보인다

 

[root@chan ~]# 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
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 엔터
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610): 엔터
Using default value 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

 

▼이제 포맷을 한다

[root@chan ~]# 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 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

▼디렉토리 생성 후 마운트

[root@chan ~]# mkdir /data
[root@chan ~]# mount /dev/sdb1 /data/

▼마운트 잘 됬나 확인

[root@chan ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             4.8G  2.5G  2.1G  55% /
/dev/sda7              12G  7.5G  3.9G  67% /app
/dev/sda6             965M   68M  848M   8% /var
/dev/sda2             9.5G  5.5G  3.6G  61% /home
/dev/sda1              99M   12M   83M  12% /boot
tmpfs                 506M     0  506M   0% /dev/shm
/dev/hdc              2.9G  2.9G     0 100% /media/RHEL_5.3 i386 DVD
/dev/sdb1              20G  173M   19G   1% /data

 

▼ 재부팅마다 자동 마운트 되도록 설정

[root@chan ~]# 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

맨 아랫줄 추가

 

'OS > RHEL5' 카테고리의 다른 글

RHEL5 설치  (0) 2013.12.01
by 짱구를꼭말려 2013. 8. 2. 22:54