Environment:
System hardware: VMware vsphere (cpu:2*4 core, memory 2G)
System version: Linux CentOS 2.6.32-431.17.1.el6.x86_64 (Centos-6.5-x86_64-minimal.iso)
Hard drive to mount:/dev/sdb
Upgrade steps:
0. System Environment
[Email protected] ~]# uname-r
2.6.32-431.17.1.el6.x86_64
[Email protected] ~]# cat/etc/redhat-release
CentOS Release 6.5 (Final)
1. View current Mount Information
[Email protected] ~]# df-h
Filesystem Size used Avail use% mounted on
/dev/mapper/volgroup-lv_root 14G 884M 13G 7%/
Tmpfs 939M 0 939M 0%/dev/shm
/DEV/SDA1 485M 54M 407M 12%/boot
2. View hard drive information (see/DEV/SDB for this new drive)
... Slightly
disk/dev/sdb:32.2 GB, 32212254720 bytes
255 heads, Sectors/track, 3916 cylinders, total 62914560 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/512 bytes
I/O size (minimum/optimal): bytes/512 bytes
Disk Identifier:0xb819ae09
Device Boot Start End Blocks Id System
... Slightly
3. Hard disk partition and 4K alignment
[Email protected] ~]# fdisk-h 224-s 56/dev/sdb
Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off the mode (command ' C ') and change display units to
Sectors (Command ' u ').
Command (M for help):
3.1 First zone operation, follow these steps
N P 1 return car +10g return
3.2 First zone operation, follow these steps
N P 2 return car +5g return
3.1 First zone operation, follow these steps
N P 3 return car return
3.4 Save exit
W
4. View hard drive information (see/DEV/SDB for this new drive)
[Email protected] ~]# Fdisk-lu
... Slightly
disk/dev/sdb:32.2 GB, 32212254720 bytes
224 heads, Sectors/track, 5015 cylinders, total 62914560 sectors< br> Units = sectors of 1 * = bytes
Sector size (logical/physical): bytes/512 bytes
I/o size (mini Mum/optimal): bytes/512 bytes
Disk identifier:0xb819ae09
Device boot &nb sp; start end Blocks id System
/dev/sdb1 56 20986111 10493028 83 Linux
/dev/sdb2 20986112 31485439 5249664 83 Linux
/dev/sdb3 31485440 62908159 15711360 83 Linux
... Slightly
The start of each partition is divisible by 8, which means that the partition is 4K aligned
5. Format, create partition file system
[Email protected] ~]# MKFS.EXT4/DEV/SDB1
[Email protected] ~]# MKFS.EXT4/DEV/SDB2
[Email protected] ~]# MKFS.EXT4/DEV/SDB3
6. Mount Partitions
6.1 Need to save the attached directory real existence
[Email protected] ~]# mkdir-p/data
6.2 Modify the file so that you can mount the directory to the partition if you restart it
[Email protected] ~]# Vim/etc/fstab
Echo '/dev/sdb1/home ext4 defaults 0 0 '
Echo '/dev/sdb2/data ext4 defaults 0 0 '
Echo '/dev/sdb3/tmp ext4 defaults 0 0 '
Save exit
6.3 Mount Partition
[Email protected] ~]# mount-a
7. Rebooting the system
[Email protected] ~]# Shutdown-r now
8. View the partition Mount information
[Email protected] ~]# DF-LH
filesystem Size Used Avail Use% Moun Ted on
/dev/mapper/volgroup-lv_root 14g 884m 13g 7%/
/dev/sda1 ; 485m 54m 407M 12%/boot
Tmpfs 939m 0 939m 0%/dev/shm
/dev/sdb1 9.9g 151m 9.3g 2%/home
/DEV/SDB2&NBSP;&NBSP;&NBSP;&NB sp; 5.0g 139m 4.6g 3%/tmp
/dev/sdb3& nbsp; 15G 166M 14G ; 2%/data
9. View Partition Read speed
Time DD If=/dev/zero of=/data/test.file bs=1m count=500
Centos 6.5 Mount HDD 4K alignment (notes measured)