- 论坛徽章:
- 0
|
8月18日晚上,分区扩展已经实施,目前一切正常,现将过程分享给大家,是实实在在在业务环境下操作的,各位可放心参照。
1、肯定是备份,老老实实做了一个。
2、卸载分区
root@svnserver /]# umount /proj
3、确认分区已经卸载
[root@svnserver /]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sdb1 on /projbak type ext3 (rw)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
4、查看系统的分区
[root@svnserver /]# fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 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 36404 292310707+ 8e Linux LVM
Disk /dev/sdb: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 72809 584838261 83 Linux
Disk /dev/sdc: 1649.2 GB, 1649273733120 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 101822 817885183+ 83 Linux
5、对目标分区进行操作
[root@svnserver /]# fdisk /dev/sdc
The number of cylinders for this disk is set to 200512.
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)
Command (m for help): m
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)
6、本次操作最危险的步骤,删除目标分区
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdc: 1649.2 GB, 1649273733120 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
7、新建分区,注意,这次的分区大小已经改变。
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-200512, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-200512, default 200512): 200512
Command (m for help): p
Disk /dev/sdc: 1649.2 GB, 1649273733120 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 200512 1610612608+ 83 Linux
8、保存设定,退出。
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
9、确认下分区的大小,应该已经扩大了。
[root@svnserver /]# fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 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 36404 292310707+ 8e Linux LVM
Disk /dev/sdb: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 72809 584838261 83 Linux
Disk /dev/sdc: 1649.2 GB, 1649273733120 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 200512 1610612608+ 83 Linux
10、fsck分区,注意,这是最花费时间的一步,要耐心,我大概用了30分钟左右。
[root@svnserver /]# e2fsck -f /dev/sdc1
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdc1: 568675/102236160 files (7.0% non-contiguous), 194245912/204471295 blocks
11、resize分区
[root@svnserver /]# resize2fs /dev/sdc1
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/sdc1 to 402653152 (4k) blocks.
The filesystem on /dev/sdc1 is now 402653152 blocks long.
12、再次fsck
[root@svnserver /]# fsck -n /dev/sdc1
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/sdc1: clean, 568675/201326592 files, 197355609/402653152 blocks
13、检查分区
[root@svnserver /]# fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 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 36404 292310707+ 8e Linux LVM
Disk /dev/sdb: 598.8 GB, 598879502336 bytes
255 heads, 63 sectors/track, 72809 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 72809 584838261 83 Linux
Disk /dev/sdc: 1649.2 GB, 1649273733120 bytes
255 heads, 63 sectors/track, 200512 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 200512 1610612608+ 83 Linux
14、挂载分区,并确认大小,真的已经扩展了。
[root@svnserver /]# mount /dev/sdc1 /proj
[root@svnserver /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
269G 236G 20G 93% /
/dev/sdb1 549G 9.8G 512G 2% /projbak
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sdc1 1.5T 729G 722G 51% /proj
15、确认数据,都在
[root@svnserver /]# cd /proj
[root@svnserver proj]# ls -l
total 8620
drwxrwxr-x 7 apache apache 4096 Dec 2 2009 09CyberSpec
drwxrwxr-x 11 apache apache 4096 Dec 2 2009 09Light_KWGData
drwxrwxr-x 7 apache apache 4096 Dec 2 2009 09LightLib
drwxrwxr-x 7 apache apache 4096 Dec 2 2009 09LightProj
drwxrwxr-x 7 apache apache 4096 Dec 2 2009 09RakuSpec
drwxrwxr-x 7 apache root 4096 Sep 30 2010 10AutumnPHC_KWGData
drwxrwxr-x 7 apache root 4096 Jul 29 2010 14MPreAplSrc
-rw-r--r-- 1 root root 508376 May 22 15:06 accesProb_bak
-rw-r--r-- 1 root root 20 Dec 2 2009 access005CLSrc
至此,扩展分区完成!
|
|