欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

Linux下LVM邏輯卷管理-創(chuàng)新互聯(lián)

分區(qū)

[root@db01 ~]# fdisk -l

 

成都創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站建設(shè)、成都網(wǎng)站制作與策劃設(shè)計(jì),安龍網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)十多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:安龍等地區(qū)。安龍做網(wǎng)站價(jià)格咨詢:18980820575

Disk /dev/sda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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        1305    10377990   8e  Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

[root@db01 ~]#

[root@db01 ~]# fdisk /dev/sdb

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

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

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

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

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-652, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):

Using default value 652

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@db01 ~]#

[root@db01 ~]# fdisk -l

Disk /dev/sda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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        1305    10377990   8e  Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes

255 heads, 63 sectors/track, 652 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1         652     5237158+  83  Linux

[root@db01 ~]#

[root@db01 ~]#

[root@db01 ~]# pvcreate /dev/sdb1

  Physical volume "/dev/sdb1" successfully created

[root@db01 ~]#

[root@db01 ~]# vgcreate testvg /dev/sdb1

  /dev/hdc: open failed: No medium found

  Volume group "testvg" successfully created

[root@db01 ~]#

[root@db01 ~]# vgdisplay

  --- Volume group ---

  VG Name               testvg

  System ID            

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  1

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                0

  Open LV               0

  Max PV                0

  Cur PV                1

  Act PV                1

  VG Size               4.99 GB

  PE Size               4.00 MB

  Total PE              1278

  Alloc PE / Size       0 / 0  

  Free  PE / Size       1278 / 4.99 GB

  VG UUID               SMGvyj-hKdO-ILqF-Z9y3-1qPb-WHyQ-K7zN5d

  

  --- Volume group ---

  VG Name               VolGroup00

  System ID            

  Format                lvm2

  Metadata Areas        1

  Metadata Sequence No  3

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                2

  Open LV               2

  Max PV                0

  Cur PV                1

  Act PV                1

  VG Size               9.88 GB

  PE Size               32.00 MB

  Total PE              316

  Alloc PE / Size       316 / 9.88 GB

  Free  PE / Size       0 / 0  

  VG UUID               wH67cF-9Z6s-YEXC-yf0U-q0ep-NK0g-7gC25V

  

[root@db01 ~]#

[root@db01 ~]# lvcreate -L100 -n lv_test01 testvg

  Logical volume "lv_test01" created

[root@db01 ~]#

[root@db01 ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00

                      7.7G  4.3G  3.0G  60% /

/dev/sda1              99M   12M   82M  13% /boot

tmpfs                 506M     0  506M   0% /dev/shm


新建lv

創(chuàng)建pv

pvcreate /dev/sdb1

創(chuàng)建vg

vgcreate testvg /dev/sdb1

創(chuàng)建lv,單位是M

lvcreate -L100 -n lv_test01 testvg

或指定pe數(shù)量

lvcreate -l45230 testvg -n lv_test01

擴(kuò)展lv

將sdc2擴(kuò)展加到testvg中

vgextend testvg /dev/sdc2

將lv_test01擴(kuò)展到12G

lvextend -L12G /dev/testvg/lv_test01

將lv_test01增加1G

lvextend -L +1G /dev/testvg/lv_test01

文件系統(tǒng)

創(chuàng)建ext3格式文件系統(tǒng)

mkfs.ext3 /dev/testvg/lv_test01

或者

mkfs -t ext3  /dev/testvg/lv_test01

掛載到/mount_test

mount /dev/testvg/lv_test01 /mount_test

擴(kuò)展lv后需對(duì)文件系統(tǒng)resize(正對(duì)ext2、ext3、ext4等)

df –h –T 查看文件系統(tǒng)格式

e2fsck -f /dev/testvg/lv_test01  -- 可不執(zhí)行

resize2fs -p /dev/testvg/lv_test01

如果文件系統(tǒng)格式為reiserfs

resize_reiserfs -f /dev/testvg/lv_test01

刪除

刪除testvg中的pv,pvdisplay確認(rèn)pv是否在用

vgreduce testvg /dev/hda1

刪除lv

umount /dev/testvg/lv_test01

lvremove /dev/testvg/lv_test01

激活 vg

取消激活vg

vgchange -an /dev/vg001

激活vg

vgchange -ay vg001

分享文章:Linux下LVM邏輯卷管理-創(chuàng)新互聯(lián)
文章出自:http://chinadenli.net/article36/dhgesg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名移動(dòng)網(wǎng)站建設(shè)、微信小程序、微信公眾號(hào)建站公司、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化