Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2395028
  • 博文数量: 454
  • 博客积分: 4860
  • 博客等级: 上校
  • 技术积分: 6375
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 10:08
个人简介

10年工作经验,专研网站运维。

文章分类

全部博文(454)

文章存档

2017年(11)

2016年(13)

2015年(47)

2014年(36)

2013年(147)

2012年(64)

2011年(136)

分类: LINUX

2013-01-24 13:10:37

背景:

 现有一个分区时lvm分区,但是空间不够大。现还有一个普通分区空间也不够大,所以想把普通分区重新全部划分给lvm分区,文件已经备份好。

操作步骤:

1.       

      1.       卸载分区

[root@LOCALSERVER ~]# umount /backup/

      2.       查看当前分区


[root@LOCALSERVER ~]# fdisk –l

Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      164151   441482233+  83  Linux

[root@LOCALSERVER ~]#

[root@LOCALSERVER ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/cciss/c0d0p3     190G  155G   25G  87% /

/dev/cciss/c0d0p7     9.5G  153M  8.9G   2% /home

/dev/cciss/c0d0p5      29G  3.4G   24G  13% /var

/dev/mapper/VolGroup00-EBSVOL

                      568G  287G  252G  54% /d01

/dev/cciss/c0d0p1     494M   17M  453M   4% /boot

tmpfs                 8.0G     0  8.0G   0% /dev/shm

/root/redhat57.iso    3.1G  3.1G     0 100% /mnt/iso

[root@LOCALSERVER ~]#

      3.       由此可见,需要重新划分/dev/cciss/c0d0p8分区。

      4.       调整新分区

[root@LOCALSERVER ~]# fdisk /dev/cciss/c0d0

[root@LOCALSERVER ~]# fdisk /dev/cciss/c0d0


The number of cylinders for this disk is set to 164151.

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): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      164151   441482233+  83  Linux


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)


Command (m for help): d

Partition number (1-8): 8


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@LOCALSERVER ~]#

      5.       确认分区表:

[root@LOCALSERVER ~]# fdisk -l


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

[root@LOCALSERVER ~]#

      6.       60G作为一个分区,划分剩余的磁盘空间。

[root@LOCALSERVER ~]# fdisk /dev/cciss/c0d0


The number of cylinders for this disk is set to 164151.

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): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      164151   441482233+  83  Linux


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)


Command (m for help): d

Partition number (1-8): 8


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@LOCALSERVER ~]# fdisk -l


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

[root@LOCALSERVER ~]# fdisk /dev/cciss/c0d0


The number of cylinders for this disk is set to 164151.

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): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux


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)


Command (m for help): n

First cylinder (109190-164151, default 109190):

Using default value 109190

Last cylinder or +size or +sizeM or +sizeK (109190-164151, default 164151): +60G


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux


Command (m for help): n

First cylinder (116486-164151, default 116486):

Using default value 116486

Last cylinder or +size or +sizeM or +sizeK (116486-164151, default 164151): +60g


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux


Command (m for help): n

First cylinder (123782-164151, default 123782):

Using default value 123782

Last cylinder or +size or +sizeM or +sizeK (123782-164151, default 164151): +60G


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux

/dev/cciss/c0d0p10         123782      131077    58605088+  83  Linux


Command (m for help): n

First cylinder (131078-164151, default 131078):

Using default value 131078

Last cylinder or +size or +sizeM or +sizeK (131078-164151, default 164151): +60G


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux

/dev/cciss/c0d0p10         123782      131077    58605088+  83  Linux

/dev/cciss/c0d0p11         131078      138373    58605088+  83  Linux


Command (m for help): n

First cylinder (138374-164151, default 138374):

Using default value 138374

Last cylinder or +size or +sizeM or +sizeK (138374-164151, default 164151): +60G


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux

/dev/cciss/c0d0p10         123782      131077    58605088+  83  Linux

/dev/cciss/c0d0p11         131078      138373    58605088+  83  Linux

/dev/cciss/c0d0p12         138374      145669    58605088+  83  Linux


Command (m for help): n

First cylinder (145670-164151, default 145670):

Using default value 145670

Last cylinder or +size or +sizeM or +sizeK (145670-164151, default 164151): +60G


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux

/dev/cciss/c0d0p10         123782      131077    58605088+  83  Linux

/dev/cciss/c0d0p11         131078      138373    58605088+  83  Linux

/dev/cciss/c0d0p12         138374      145669    58605088+  83  Linux

/dev/cciss/c0d0p13         145670      152965    58605088+  83  Linux


Command (m for help): n

First cylinder (152966-164151, default 152966):

Using default value 152966

Last cylinder or +size or +sizeM or +sizeK (152966-164151, default 164151):

Using default value 164151


Command (m for help): p


Disk /dev/cciss/c0d0: 1350.1 GB, 1350193700864 bytes

255 heads, 63 sectors/track, 164151 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes


           Device Boot      Start         End      Blocks   Id  System

/dev/cciss/c0d0p1   *           1          65      522081   83  Linux

/dev/cciss/c0d0p2              66       76554   614397892+  8e  Linux LVM

/dev/cciss/c0d0p3           76555      102050   204796620   83  Linux

/dev/cciss/c0d0p4          102051      164151   498826282+   5  Extended

/dev/cciss/c0d0p5          102051      105874    30716248+  83  Linux

/dev/cciss/c0d0p6          105875      107914    16386268+  82  Linux swap / Solaris

/dev/cciss/c0d0p7          107915      109189    10241406   83  Linux

/dev/cciss/c0d0p8          109190      116485    58605088+  83  Linux

/dev/cciss/c0d0p9          116486      123781    58605088+  83  Linux

/dev/cciss/c0d0p10         123782      131077    58605088+  83  Linux

/dev/cciss/c0d0p11         131078      138373    58605088+  83  Linux

/dev/cciss/c0d0p12         138374      145669    58605088+  83  Linux

/dev/cciss/c0d0p13         145670      152965    58605088+  83  Linux

/dev/cciss/c0d0p14         152966      164151    89851513+  83  Linux


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@LOCALSERVER ~]#

      7.       刷新磁盘分区表

[root@LOCALSERVER ~]# kpartx -a /dev/cciss/c0d0p8

[root@LOCALSERVER ~]# cd /dev/cciss/

[root@LOCALSERVER cciss]# ls

c0d0  c0d0p1  c0d0p2  c0d0p3  c0d0p4  c0d0p5  c0d0p6  c0d0p7  c0d0p8

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p9

failed to stat() /dev/cciss/c0d0p9

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p9

failed to stat() /dev/cciss/c0d0p9

[root@LOCALSERVER cciss]#

[root@LOCALSERVER cciss]#

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p9

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p10

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p11

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p12

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p13

[root@LOCALSERVER cciss]# partprobe

[root@LOCALSERVER cciss]# kpartx -a /dev/cciss/c0d0p14

[root@LOCALSERVER cciss]# partprobe

      8.       创建pv

[root@LOCALSERVER cciss]# pvs

  PV                VG         Fmt  Attr PSize   PFree

  /dev/cciss/c0d0p2 VolGroup00 lvm2 a-   585.91G    0

[root@LOCALSERVER cciss]# pvcreate /dev/cciss/c0d0p8 /dev/cciss/c0d0p9 /dev/cciss/c0d0p10 /dev/cciss/c0d0p11 /dev/cciss/c0d0p12 /dev/cciss/c0d0p13 /dev/cciss/c0d0p14

  Physical volume "/dev/cciss/c0d0p8" successfully created

  Physical volume "/dev/cciss/c0d0p9" successfully created

  Physical volume "/dev/cciss/c0d0p10" successfully created

  Physical volume "/dev/cciss/c0d0p11" successfully created

  Physical volume "/dev/cciss/c0d0p12" successfully created

  Physical volume "/dev/cciss/c0d0p13" successfully created

  Physical volume "/dev/cciss/c0d0p14" successfully created

[root@LOCALSERVER cciss]#

8.1   这里加一步,把pv格式化一下,我之前操作没做,是因为之前的磁盘已经被格式化。

 [root@PLASPACSHCN13 backup]# mkfs.ext3 /dev/cciss/c0d0p14

 

      9.       扩大vg

[root@LOCALSERVER cciss]# vgs

  VG         #PV #LV #SN Attr   VSize   VFree

  VolGroup00   1   1   0 wz--n- 585.91G    0

[root@LOCALSERVER cciss]# lvs

  LV     VG         Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  EBSVOL VolGroup00 -wi-ao 585.91G                                     

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p8

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p9

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p10

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p11

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p12

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p13

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgextend VolGroup00 /dev/cciss/c0d0p14

  Volume group "VolGroup00" successfully extended

[root@LOCALSERVER cciss]# vgs

  VG         #PV #LV #SN Attr   VSize    VFree 

  VolGroup00   8   1   0 wz--n- 1006.84G 420.94G

[root@LOCALSERVER cciss]

      10.   扩大lv

[root@LOCALSERVER cciss]# lvs

  LV     VG         Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  EBSVOL VolGroup00 -wi-ao 585.91G                                     

[root@LOCALSERVER cciss]# cd

[root@LOCALSERVER ~]# lvextend -L +100G /dev/VolGroup00/EBSVOL

  Extending logical volume EBSVOL to 685.91 GB

  Logical volume EBSVOL successfully resized

[root@LOCALSERVER ~]# resize

resize      resize2fs   resizecons 

[root@LOCALSERVER ~]# resize2fs /dev/VolGroup00/EBSVOL

resize2fs 1.39 (29-May-2006)

Filesystem at /dev/VolGroup00/EBSVOL is mounted on /d01; on-line resizing required

Performing an on-line resize of /dev/VolGroup00/EBSVOL to 179806208 (4k) blocks.

The filesystem on /dev/VolGroup00/EBSVOL is now 179806208 blocks long.


[root@LOCALSERVER ~]# lvs

  LV     VG         Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  EBSVOL VolGroup00 -wi-ao 685.91G                                      

[root@LOCALSERVER ~]# vgs

  VG         #PV #LV #SN Attr   VSize    VFree 

  VolGroup00   8   1   0 wz--n- 1006.84G 320.94G

[root@LOCALSERVER ~]# lvextend -L +320G /dev/VolGroup00/EBSVOL

  Extending logical volume EBSVOL to 1005.91 GB

  Logical volume EBSVOL successfully resized

[root@LOCALSERVER ~]# resize2fs /dev/VolGroup00/EBSVOL

resize2fs 1.39 (29-May-2006)

Filesystem at /dev/VolGroup00/EBSVOL is mounted on /d01; on-line resizing required

Performing an on-line resize of /dev/VolGroup00/EBSVOL to 263692288 (4k) blocks.

The filesystem on /dev/VolGroup00/EBSVOL is now 263692288 blocks long.


[root@LOCALSERVER ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/cciss/c0d0p3     190G  155G   25G  87% /

/dev/cciss/c0d0p7     9.5G  153M  8.9G   2% /home

/dev/cciss/c0d0p5      29G  3.4G   24G  13% /var

/dev/mapper/VolGroup00-EBSVOL

                      975G  287G  638G  32% /d01

/dev/cciss/c0d0p1     494M   17M  453M   4% /boot

tmpfs                 8.0G     0  8.0G   0% /dev/shm

/root/redhat57.iso    3.1G  3.1G     0 100% /mnt/iso

[root@LOCALSERVER ~]#

      11.   创建文件夹,做NFS把分区映射出去。即可!!!

    疑问:

    我的整个操作都没有格式化硬盘操作啊!!??

自    自答: 可能是我的分区之前就格式化过了,现在拿来用是不用再次格式化了。

阅读(1595) | 评论(0) | 转发(0) |
0

上一篇:tar命令详解/举例

下一篇:操作习惯

给主人留下些什么吧!~~