Thứ Hai, 26 tháng 8, 2013

Thêm HDD vào CentOS trên VMWARE

Có mấy bạn hỏi mình làm sao add thêm HDD vào máy ảo CentOS or redhat trên vmw...để có thể Setup các ứng dụng khác làm lab trong khi HDD ban đầu chọn ít quá. (như Setup Oracle chẳng hạn).

1. Thêm HDD: Việc add HDD này cũng tương tự như trên Windows thôi. Đầu tiên bạn phải turn off cái Máy ảo đi => và Add thêm HDD vào cho nó (Dung lượng tùy chọn theo yêu cầu.).


2, Start lại máy ảo:

Kiểm tra lại dung lượng các HDD đã có:

Trích:
[root@centos ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 14G 5.9G 7.4G 45% /
/dev/sda1 190M 11M 170M 7% /boot
tmpfs 252M 0 252M 0% /dev/shm
3. Fdisk ổ đĩa mới thêm vào. (Chú ý : phải dùng User: root)

Trích:
[root@centos /]# 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.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
----------
Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
-------------------
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
----------------------
4. Tạo hệ thống file, sau khi phân vùng đã được tạo

Trích:
[root@centos /]# mkfs -V -t ext3 /dev/sdb
mkfs (util-linux 2.13-pre7)
mkfs.ext3 /dev/sdb
mke2fs 1.39 (29-May-2006)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:
done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

5. Kiểm tra hệ thống file:

Trích:
[root@centos /]# fsck /dev/sdb
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/sdb: clean, 11/262144 files, 25406/524288 blocks
6. Tạo 1 folder để Mound phân vùng này vào: VD ở đây mình tạo là U02.

Trích:
[root@centos /]# mount -t ext3 /dev/sdb /u02/
7. Kiểm tra lại:

Trích:
[root@centos /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 14G 5.9G 7.4G 45% /
/dev/sda1 190M 11M 170M 7% /boot
tmpfs 252M 0 252M 0% /dev/shm
/dev/sdb 2.0G 68M 1.9G 4% /u02
Nguồn: nhất nghệ

Không có nhận xét nào:

Đăng nhận xét