linux LVM 磁碟管理 基本用法舉例

dbhelper發表於2014-11-27

作業系統版本 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部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1349525/,如需轉載,請註明出處,否則將追究法律責任。

相關文章