centos lvm 扩容

vvilog@centos /h/vvilog> /sbin/vgdisplay

--- Volume group ---

VG Name               centos

System ID

Format                lvm2

Metadata Areas        1

Metadata Sequence No  4

VG Access             read/write

VG Status             resizable

MAX LV                0

Cur LV                3

Open LV               3

Max PV                0

Cur PV                1

Act PV                1

VG Size               <110.81 GiB

PE Size               4.00 MiB

Total PE              28367

Alloc PE / Size       28367 / <110.81 GiB

Free  PE / Size       0 / 0

VG UUID               Nt91Zx-Haal-LOPL-fDJF-XGjk-SvaA-yl9hgL

vvilog@centos /h/vvilog> /sbin/vgdisplay

--- Volume group ---

VG Name               centos

System ID

Format                lvm2

Metadata Areas        1

Metadata Sequence No  4

VG Access             read/write

VG Status             resizable

MAX LV                0

Cur LV                3

Open LV               3

Max PV                0

Cur PV                1

Act PV                1

VG Size               <110.81 GiB

PE Size               4.00 MiB

Total PE              28367

Alloc PE / Size       28367 / <110.81 GiB

Free  PE / Size       0 / 0

VG UUID               Nt91Zx-Haal-LOPL-fDJF-XGjk-SvaA-yl9hgL

vvilog@centos /h/vvilog> /sbin/lvdisplay

--- Logical volume ---

LV Path                /dev/centos/root

LV Name                root

VG Name                centos

LV UUID                NUekJb-ZCIc-mwcL-ExzX-ROYd-bD7T-HmPqql

LV Write Access        read/write

LV Creation host, time centos, 2018-07-11 19:47:08 +0800

LV Status              available

# open                 1

LV Size                60.00 GiB

Current LE             15360

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:0

--- Logical volume ---

LV Path  /dev/centos/home

LV Name                home

VG Name                centos

LV UUID                eShHQo-MewK-xN7H-ZqBu-GIV6-KMQI-YA606U

LV Write Access        read/write

LV Creation host, time centos, 2018-07-11 19:47:09 +0800

LV Status              available

# open                 1

LV Size                48.00 GiB

Current LE             12288

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:2

--- Logical volume ---

LV Path /dev/centos/swap

LV Name                swap

VG Name                centos

LV UUID                hwO7J7-gmbh-jgiT-vFLA-jsdI-8241-CSHEM8

LV Write Access        read/write

LV Creation host, time centos, 2018-07-11 19:47:10 +0800

LV Status              available

# open                 2

LV Size                <2.81 GiB

Current LE             719

Segments               1

Allocation             inherit

Read ahead sectors     auto

- currently set to     256

Block device           253:1

vvilog@centos /h/vvilog>/sbin/fdisk /dev/sda

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Welcome to fdisk (util-linux 2.23.2).

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

Be careful before using the write command.

Command (m for help): t

Partition number (1-4, default 4): 4

Partition type (type L to list all types): 8e

Type of partition 4 is unchanged: Linux filesystem

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 or after you run partprobe(8) or kpartx(8)

Syncing disks.

vvilog@centos /h/vvilog> /sbin/partprobe

vvilog@centos /h/vvilog> /sbin/fdisk /dev/sda

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Welcome to fdisk (util-linux 2.23.2).

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

Be careful before using the write command.

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors

Units = sectors of 1 * 512 = 512 bytes

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

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

Disk label type: gpt

Disk identifier: 30B84C4D-0A79-4BAE-8950-8C0FDF86949E

#         Start          End    Size  Type            Name

1         2048      1026047    500M  EFI System      EFI System Partition

2      1026048      2050047    500M  Microsoft basic

3      2050048    234440703  110.8G  Linux LVM

4    234440704   1953523711  819.7G  Linux filesyste

Command (m for help): t

Partition number (1-4, default 4): 4

Partition type (type L to list all types): l

   19 Linux swap                     0657FD6D-A4AB-43C4-84E5-0933C84B4F4F

 31 Linux LVM                      E6D6D379-F507-44C2-A23C-238F2A3DF928

Partition type (type L to list all types): t

Type of partition 4 is unchanged: Linux filesystem

Command (m for help): t

Partition number (1-4, default 4): 4

Partition type (type L to list all types): 31

Changed type of partition 'Linux filesystem' to '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: Device or resource busy.

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)

Syncing disks.

vvilog@centos /h/vvilog> /sbin/partprobe

vvilog@centos /h/vvilog> /usr/sbin/vgextend centos /dev/sda4

Volume group "centos" successfully extended

vvilog@centos /h/vvilog> whereis  lvextend

lvextend: /usr/sbin/lvextend /usr/share/man/man8/lvextend.8.gz

vvilog@centos /h/vvilog> /sbin/lvextend -L +760g /dev/centos/home

Size of logical volume centos/home changed from 48.00 GiB (12288 extents) to 808.00 GiB (206848 extents).

Logical volume centos/home successfully resized.

vvilog@centos /h/vvilog> df -lh

Filesystem               Size  Used Avail Use% Mounted on

/dev/mapper/centos-root   60G  5.5G   55G  10% /

devtmpfs                 1.7G     0  1.7G   0% /dev

tmpfs                    1.7G     0  1.7G   0% /dev/shm

tmpfs                    1.7G  9.6M  1.7G   1% /run

tmpfs                    1.7G     0  1.7G   0% /sys/fs/cgroup

/dev/sda2                497M  178M  320M  36% /boot

/dev/sda1                500M  9.8M  490M   2% /boot/efi

/dev/mapper/centos-home   48G  5.6G   43G  12% /home

tmpfs                    344M   12K  344M   1% /run/user/1000

vvilog@centos /h/vvilog> /sbin/resize2fs /dev/centos/home

resize2fs 1.42.9 (28-Dec-2013)

/sbin/resize2fs: Bad magic number in super-block while trying to open /dev/centos/home

Couldn't find valid filesystem superblock.

vvilog@centos /h/vvilog>/sbin/xfs_growfs /dev/centos/home

meta-data=/dev/mapper/centos-home isize=512    agcount=4, agsize=3145728 blks

=                       sectsz=512   attr=2, projid32bit=1

=                       crc=1        finobt=0 spinodes=0

data     =                       bsize=4096   blocks=12582912, imaxpct=25

=                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=1

log      =internal               bsize=4096   blocks=6144, version=2

=                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

data blocks changed from 12582912 to 211812352

vvilog@centos /h/vvilog> df -lh

Filesystem               Size  Used Avail Use% Mounted on

/dev/mapper/centos-root   60G  5.5G   55G  10% /

devtmpfs                 1.7G     0  1.7G   0% /dev

tmpfs                    1.7G     0  1.7G   0% /dev/shm

tmpfs                    1.7G  9.6M  1.7G   1% /run

tmpfs                    1.7G     0  1.7G   0% /sys/fs/cgroup

/dev/sda2                497M  178M  320M  36% /boot

/dev/sda1                500M  9.8M  490M   2% /boot/efi

/dev/mapper/centos-home  808G  5.6G  803G   1% /home

tmpfs                    344M   12K  344M   1% /run/user/1000

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,590评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 86,808评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,151评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,779评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,773评论 5 367
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,656评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,022评论 3 398
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,678评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 41,038评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,659评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,756评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,411评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,005评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,973评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,203评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,053评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,495评论 2 343

推荐阅读更多精彩内容