ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux LVM 磁盘管理 基本用法举例

linux LVM 磁盘管理 基本用法举例

Linux操作系统 作者:dbasdk 时间:2014-07-22 11:03:15 0 删除 编辑

操作系统版本 suse linux 11

创建物理卷PV

clip_image001

给磁盘新建分区

clip_image002

大小1000M

clip_image003

将分区调整为8e linux LVM

clip_image004

W写入保存

clip_image005

将分区转换为PV

clip_image006

查看现有PV信息

创建卷组

clip_image007

创建卷组

clip_image008

查看卷组

 

创建逻辑卷LV

clip_image009

使用LV 创建文件系统

clip_image010

clip_image011

加入文件系统成功!!

 

扩展LV

clip_image018

无变化

clip_image019

resize文件系统

clip_image020

已添加

clip_image021

扩展VG

创建PV

hp5-2:~ # fdisk /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x5c2e7bc3.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

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

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)

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1566, default 1):

Using default value 1

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

Using default value 1566

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

Selected partition 1

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

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

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

ehp5-2:~ #

clip_image022

扩展成功。

现在我们就可以灵活使用磁盘和文件系统了,添加删除都可以

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29734436/viewspace-1224377/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-07-02

  • 博文量
    490
  • 访问量
    1388092