Thêm HDD cho CentOS theo các bước sau

Tác giả admin+, T.Ba 14, 2011, 06:37:57 CHIỀU

« Chủ đề trước - Chủ đề tiếp »

0 Thành viên và 1 Khách đang xem chủ đề.

Thêm HDD cho CentOS theo các bước sau


Mã nguồn [Chọn]
[root]# fdisk /dev/hdc
Command (m for help): m (Enter the letter "m" to get list of commands)
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): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-2654, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2654, default 2654):
Using default value 2654

Command (m for help): p

Disk /dev/hdc: 240 heads, 63 sectors, 2654 cylinders
Units = cylinders of 15120 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 1 2654 20064208+ 5 Extended

Tới đây cần tạo ra một Logical Disk:

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
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): w (Write and save partition table)

Mã nguồn [Chọn]
[root]# mkfs -t ext3 /dev/hdc5
mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2508352 inodes, 5016052 blocks
250802 blocks (5.00%) reserved for the super user
First data block=0
154 block groups
32768 blocks per group, 32768 fragments per group
16288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (8192 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.

Mã nguồn [Chọn]
[root]# mkdir /home/www/public_html/gallery
Mã nguồn [Chọn]
[root]# mount -t ext3 /dev/hdc5 /home/www/public_html/gallery
Cuối cùng cần phải cập nhật /etc/fstab để hệ thống tự mount khi boot:

Thêm dòng sau vào /etc/fstab:

Mã nguồn [Chọn]
/dev/hdc5 /home/www/public_html/gallery ext3 defaults 1 2