linux增加分区容量lvm,lvm增加分区容量

增加硬盘略

硬盘分区

[root@ora10g-1 ~]# fdisk /dev/sda

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

Partition number (1-5): 3

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000391c7

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26        3917    31251456   8e  Linux LVM

/dev/sda4            3917        4177     2094472+  83  Linux

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Selected partition 3

First cylinder (4178-5221, default 4178):

Using default value 4178

Last cylinder, +cylinders or +size{K,M,G} (4178-5221, default 5221):

Using default value 5221

Command (m for help): t

Partition number (1-4): e

Partition number (1-4): 3

Hex code (type L to list codes): 8e

Changed system type of partition 3 to 8e (Linux LVM)

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: 设备或资源忙.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

重启reboot

[root@ora10g-1 ~]# pvcreate /dev/sda3

Physical volume "/dev/sda3" successfully created

[root@ora10g-1 ~]# vgscan

Reading all physical volumes.  This may take a while...

Found volume group "vg_ora10g1" using metadata type lvm2

[root@ora10g-1 ~]# df -h

Filesystem                        Size  Used Avail Use% Mounted on

/dev/mapper/vg_ora10g1-LogVol03   7.8G  7.7G     0 100% /

tmpfs                             581M     0  581M   0% /dev/shm

/dev/sda1                         194M   30M  155M  16% /boot

/dev/mapper/vg_ora10g1-LogVolU01  7.8G  2.4G  5.1G  32% /u01

/dev/mapper/vg_ora10g1-LogVol02    12G  9.5G  1.5G  87% /u02

[root@ora10g-1 ~]# vgextend vg_ora10g1 /dev/sda3

Volume group "vg_ora10g1" successfully extended

[root@ora10g-1 ~]#

[root@ora10g-1 ~]# lvextend -L +7G /dev/vg_ora10g1/LogVol03

Extending logical volume LogVol03 to 14.83 GiB

Logical volume LogVol03 successfully resized

[root@ora10g-1 ~]# resize2fs /dev/mapper/vg_ora10g1-LogVol0

vg_ora10g1-LogVol00  vg_ora10g1-LogVol02  vg_ora10g1-LogVol03

[root@ora10g-1 ~]# resize2fs /dev/mapper/vg_ora10g1-LogVol03

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/mapper/vg_ora10g1-LogVol03 is mounted on /; on-line resizing required

old desc_blocks = 1, new_desc_blocks = 1

Performing an on-line resize of /dev/mapper/vg_ora10g1-LogVol03 to 3888128 (4k) blocks.

The filesystem on /dev/mapper/vg_ora10g1-LogVol03 is now 3888128 blocks long.

[root@ora10g-1 ~]# df -h

Filesystem                        Size  Used Avail Use% Mounted on

/dev/mapper/vg_ora10g1-LogVol03    15G  7.7G  6.2G  56% /

tmpfs                             581M     0  581M   0% /dev/shm

/dev/sda1                         194M   30M  155M  16% /boot

/dev/mapper/vg_ora10g1-LogVolU01  7.8G  2.4G  5.1G  32% /u01

/dev/mapper/vg_ora10g1-LogVol02    12G  9.5G  1.5G  87% /u02

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值