Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@testvm ~]# lsblk
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
- sr0 11:0 1 4.3G 0 rom
- sda 8:0 0 20G 0 disk
- ├─sda2 8:2 0 19G 0 part
- │ ├─ol-swap 252:1 0 2G 0 lvm [SWAP]
- │ └─ol-root 252:0 0 17G 0 lvm /
- └─sda1 8:1 0 1G 0 part /boot
- [root@testvm ~]# for i in `ls /sys/class/scsi_host`; do echo "- - -" | sudo tee /sys/class/scsi_host/${i}/scan; done
- - - -
- - - -
- - - -
- [root@testvm ~]# lsblk
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
- sdb 8:16 0 5G 0 disk
- sr0 11:0 1 4.3G 0 rom
- sda 8:0 0 20G 0 disk
- ├─sda2 8:2 0 19G 0 part
- │ ├─ol-swap 252:1 0 2G 0 lvm [SWAP]
- │ └─ol-root 252:0 0 17G 0 lvm /
- └─sda1 8:1 0 1G 0 part /boot
- [root@testvm ~]# pvs
- PV VG Fmt Attr PSize PFree
- /dev/sda2 ol lvm2 a-- <19.00g 0
- [root@testvm ~]# lvs
- LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
- root ol -wi-ao---- <17.00g
- swap ol -wi-ao---- 2.00g
- [root@testvm ~]# pvcreate /dev/sdb
- Physical volume "/dev/sdb" successfully created.
- [root@testvm ~]# vgcreate test_vg /dev/sdb
- Volume group "test_vg" successfully created
- [root@testvm ~]# lvcreate -l +100%FREE -n test_lv test_vg
- Logical volume "test_lv" created.
- [root@testvm ~]# lvs
- LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
- root ol -wi-ao---- <17.00g
- swap ol -wi-ao---- 2.00g
- test_lv test_vg -wi-a----- <5.00g
- [root@testvm ~]# mkfs.xfs /dev/test_vg/test_lv
- meta-data=/dev/test_vg/test_lv isize=256 agcount=4, agsize=327424 blks
- = sectsz=512 attr=2, projid32bit=1
- = crc=0 finobt=0, sparse=0, rmapbt=0, reflink=0
- data = bsize=4096 blocks=1309696, imaxpct=25
- = sunit=0 swidth=0 blks
- naming =version 2 bsize=4096 ascii-ci=0 ftype=1
- log =internal log bsize=4096 blocks=2560, version=2
- = sectsz=512 sunit=0 blks, lazy-count=1
- realtime =none extsz=4096 blocks=0, rtextents=0
- [root@testvm ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- devtmpfs 474M 0 474M 0% /dev
- tmpfs 488M 0 488M 0% /dev/shm
- tmpfs 488M 6.8M 481M 2% /run
- tmpfs 488M 0 488M 0% /sys/fs/cgroup
- /dev/mapper/ol-root 17G 2.3G 15G 14% /
- /dev/sda1 1014M 221M 794M 22% /boot
- tmpfs 98M 0 98M 0% /run/user/0
- [root@testvm ~]# mkdir /test_mount
- [root@testvm ~]# vim /etc/fstab
- [root@testvm ~]# ls /dev/mapper/
- control ol-root ol-swap test_vg-test_lv
- [root@testvm ~]# ls /dev/mapper/test_vg-test_lv
- /dev/mapper/test_vg-test_lv
- [root@testvm ~]# ls /dev/mapper/
- control ol-root ol-swap test_vg-test_lv
- [root@testvm ~]# vim /etc/fstab
- [root@testvm ~]# mount -a
- [root@testvm ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- devtmpfs 474M 0 474M 0% /dev
- tmpfs 488M 0 488M 0% /dev/shm
- tmpfs 488M 6.8M 481M 2% /run
- tmpfs 488M 0 488M 0% /sys/fs/cgroup
- /dev/mapper/ol-root 17G 2.3G 15G 14% /
- /dev/sda1 1014M 221M 794M 22% /boot
- tmpfs 98M 0 98M 0% /run/user/0
- /dev/mapper/test_vg-test_lv 5.0G 33M 5.0G 1% /test_mount
- [root@testvm ~]# lsblk
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
- sdb 8:16 0 10G 0 disk
- └─test_vg-test_lv 252:2 0 5G 0 lvm /test_mount
- sr0 11:0 1 4.3G 0 rom
- sda 8:0 0 20G 0 disk
- ├─sda2 8:2 0 19G 0 part
- │ ├─ol-swap 252:1 0 2G 0 lvm [SWAP]
- │ └─ol-root 252:0 0 17G 0 lvm /
- └─sda1 8:1 0 1G 0 part /boot
- [root@testvm ~]# pvs
- PV VG Fmt Attr PSize PFree
- /dev/sda2 ol lvm2 a-- <19.00g 0
- /dev/sdb test_vg lvm2 a-- <5.00g 0
- [root@testvm ~]# lvs
- LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
- root ol -wi-ao---- <17.00g
- swap ol -wi-ao---- 2.00g
- test_lv test_vg -wi-ao---- <5.00g
- [root@testvm ~]# vgs
- VG #PV #LV #SN Attr VSize VFree
- ol 1 2 0 wz--n- <19.00g 0
- test_vg 1 1 0 wz--n- <5.00g 0
- [root@testvm ~]# for i in `ls /sys/class/scsi_host`; do echo "- - -" | sudo tee /sys/class/scsi_host/${i}/scan; done
- - - -
- - - -
- - - -
- [root@testvm ~]# lvs
- LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
- root ol -wi-ao---- <17.00g
- swap ol -wi-ao---- 2.00g
- test_lv test_vg -wi-ao---- <5.00g
- [root@testvm ~]# vgs
- VG #PV #LV #SN Attr VSize VFree
- ol 1 2 0 wz--n- <19.00g 0
- test_vg 1 1 0 wz--n- <5.00g 0
- [root@testvm ~]# pvresize /dev/sdb
- Physical volume "/dev/sdb" changed
- 1 physical volume(s) resized or updated / 0 physical volume(s) not resized
- [root@testvm ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- devtmpfs 474M 0 474M 0% /dev
- tmpfs 488M 0 488M 0% /dev/shm
- tmpfs 488M 6.8M 481M 2% /run
- tmpfs 488M 0 488M 0% /sys/fs/cgroup
- /dev/mapper/ol-root 17G 2.3G 15G 14% /
- /dev/mapper/test_vg-test_lv 5.0G 33M 5.0G 1% /test_mount
- /dev/sda1 1014M 221M 794M 22% /boot
- tmpfs 98M 0 98M 0% /run/user/0
- [root@testvm ~]# lvresize /dev/test_vg/test_lv -r -l +100%FREE
- Size of logical volume test_vg/test_lv changed from <5.00 GiB (1279 extents) to <10.00 GiB (2559 extents).
- Logical volume test_vg/test_lv successfully resized.
- meta-data=/dev/mapper/test_vg-test_lv isize=256 agcount=4, agsize=327424 blks
- = sectsz=512 attr=2, projid32bit=1
- = crc=0 finobt=0 spinodes=0 rmapbt=0
- = reflink=0
- data = bsize=4096 blocks=1309696, imaxpct=25
- = sunit=0 swidth=0 blks
- naming =version 2 bsize=4096 ascii-ci=0 ftype=1
- log =internal bsize=4096 blocks=2560, version=2
- = sectsz=512 sunit=0 blks, lazy-count=1
- realtime =none extsz=4096 blocks=0, rtextents=0
- data blocks changed from 1309696 to 2620416
- [root@testvm ~]# lvs
- LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
- root ol -wi-ao---- <17.00g
- swap ol -wi-ao---- 2.00g
- test_lv test_vg -wi-ao---- <10.00g
- [root@testvm ~]# xfs_repair /dev/test_vg/test_lv
- xfs_repair: /dev/test_vg/test_lv contains a mounted filesystem
- xfs_repair: /dev/test_vg/test_lv contains a mounted and writable filesystem
- fatal error -- couldn't initialize XFS library
- [root@testvm ~]# umount /test_mount/
- [root@testvm ~]# xfs_repair /dev/test_vg/test_lv
- Phase 1 - find and verify superblock...
- Phase 2 - using internal log
- - zero log...
- - scan filesystem freespace and inode maps...
- - found root inode chunk
- Phase 3 - for each AG...
- - scan and clear agi unlinked lists...
- - process known inodes and perform inode discovery...
- - agno = 0
- - agno = 1
- - agno = 2
- - agno = 3
- - agno = 4
- - agno = 5
- - agno = 6
- - agno = 7
- - agno = 8
- - process newly discovered inodes...
- Phase 4 - check for duplicate blocks...
- - setting up duplicate extent list...
- - check for inodes claiming duplicate blocks...
- - agno = 0
- - agno = 1
- - agno = 2
- - agno = 3
- - agno = 4
- - agno = 5
- - agno = 6
- - agno = 7
- - agno = 8
- Phase 5 - rebuild AG headers and trees...
- - reset superblock...
- Phase 6 - check inode connectivity...
- - resetting contents of realtime bitmap and summary inodes
- - traversing filesystem ...
- - traversal finished ...
- - moving disconnected inodes to lost+found ...
- Phase 7 - verify and correct link counts...
- done
Advertisement
Add Comment
Please, Sign In to add comment