Created
November 24, 2021 06:44
-
-
Save jcnars/976fd24354a5710edea1d349586ceae0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@linuxserver44 /]# lvs | |
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert | |
sw db -wi-a----- <160.01g | |
homelv rootvg -wi-ao---- 20.00g | |
optlv rootvg -wi-ao---- 20.00g | |
rootlv rootvg -wi-ao---- 8.00g | |
swaplv rootvg -wi-ao---- 16.00g | |
tmplv rootvg -wi-ao---- 5.00g | |
varlv rootvg -wi-ao---- 4.00g | |
u01 sw -wi-a----- 400.00m | |
[root@linuxserver44 /]# vgs | |
VG #PV #LV #SN Attr VSize VFree | |
db 1 1 0 wz--n- <160.01g 0 | |
rootvg 1 6 0 wz--n- 198.78g 125.78g | |
sw 2 1 0 wz--n- <160.01g <159.62g | |
[root@linuxserver44 /]# lvremove df -h /u0* | |
lvremove - Remove logical volume(s) from the system | |
lvremove VG|LV|Tag|Select ... | |
[ -A|--autobackup y|n ] | |
[ -f|--force ] | |
[ -S|--select String ] | |
[ --nohistory ] | |
[ --noudevsync ] | |
[ --reportformat basic|json ] | |
[ COMMON_OPTIONS ] | |
Common options for lvm: | |
[ -d|--debug ] | |
[ -h|--help ] | |
[ -q|--quiet ] | |
[ -v|--verbose ] | |
[ -y|--yes ] | |
[ -t|--test ] | |
[ --commandprofile String ] | |
[ --config String ] | |
[ --driverloaded y|n ] | |
[ --lockopt String ] | |
[ --longhelp ] | |
[ --profile String ] | |
[ --version ] | |
Use --longhelp to show all options and advanced commands. | |
[root@linuxserver44 /]# f -h /u0* | |
-bash: f: command not found | |
[root@linuxserver44 /]# df -h /u0* | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% / | |
[root@linuxserver44 /]# df -h /u01 | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% / | |
[root@linuxserver44 /]# lvs | |
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert | |
sw db -wi-a----- <160.01g | |
homelv rootvg -wi-ao---- 20.00g | |
optlv rootvg -wi-ao---- 20.00g | |
rootlv rootvg -wi-ao---- 8.00g | |
swaplv rootvg -wi-ao---- 16.00g | |
tmplv rootvg -wi-ao---- 5.00g | |
varlv rootvg -wi-ao---- 4.00g | |
u01 sw -wi-a----- 400.00m | |
[root@linuxserver44 /]# lvremove u01 | |
Volume group "u01" not found | |
Cannot process volume group u01 | |
[root@linuxserver44 /]# mount /u01 | |
[root@linuxserver44 /]# df -h /u0* | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/mapper/sw-u01 394M 21M 374M 6% /u01 | |
[root@linuxserver44 /]# umount /u01 | |
[root@linuxserver44 /]# lvs | |
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert | |
sw db -wi-a----- <160.01g | |
homelv rootvg -wi-ao---- 20.00g | |
optlv rootvg -wi-ao---- 20.00g | |
rootlv rootvg -wi-ao---- 8.00g | |
swaplv rootvg -wi-ao---- 16.00g | |
tmplv rootvg -wi-ao---- 5.00g | |
varlv rootvg -wi-ao---- 4.00g | |
u01 sw -wi-a----- 400.00m | |
[root@linuxserver44 /]# ll /dev/mapper/*u01* | |
lrwxrwxrwx 1 root root 8 Nov 23 22:26 /dev/mapper/sw-u01 -> ../dm-70 | |
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011 | |
[root@linuxserver44 /]# lsof|grep dm-70 | |
[root@linuxserver44 /]# lsof|grep dm-70 | |
[root@linuxserver44 /]# !dmsetup | |
dmsetup info -c | grep u01 | |
sw-u01 253 70 L--w 0 1 0 LVM-7fcfY2lqgVZnRrtcqa322ywUYHN2LnPJ0Zz7GhRHbu18axwqZDkpxkn3cG8xI2F1 | |
[root@linuxserver44 /]# lsof | grep "253,70" | |
[root@linuxserver44 /]# lvscan | |
ACTIVE '/dev/sw/u01' [400.00 MiB] inherit | |
ACTIVE '/dev/db/sw' [<160.01 GiB] inherit | |
ACTIVE '/dev/rootvg/swaplv' [16.00 GiB] inherit | |
ACTIVE '/dev/rootvg/optlv' [20.00 GiB] inherit | |
ACTIVE '/dev/rootvg/varlv' [4.00 GiB] inherit | |
ACTIVE '/dev/rootvg/homelv' [20.00 GiB] inherit | |
ACTIVE '/dev/rootvg/tmplv' [5.00 GiB] inherit | |
ACTIVE '/dev/rootvg/rootlv' [8.00 GiB] inherit | |
[root@linuxserver44 /]# lsof /dev/sw/u01 | |
[root@linuxserver44 /]# lvremove /dev/sw/u01 | |
Do you really want to remove active logical volume sw/u01? [y/n]: y | |
Logical volume "u01" successfully removed | |
[root@linuxserver44 /]# vgscan | |
Reading volume groups from cache. | |
Found volume group "sw" using metadata type lvm2 | |
Found volume group "db" using metadata type lvm2 | |
Found volume group "rootvg" using metadata type lvm2 | |
[root@linuxserver44 /]# vgdisplay | |
--- Volume group --- | |
VG Name sw | |
System ID | |
Format lvm2 | |
Metadata Areas 2 | |
Metadata Sequence No 9 | |
VG Access read/write | |
VG Status resizable | |
MAX LV 0 | |
Cur LV 0 | |
Open LV 0 | |
Max PV 0 | |
Cur PV 2 | |
Act PV 2 | |
VG Size <160.01 GiB | |
PE Size 4.00 MiB | |
Total PE 40962 | |
Alloc PE / Size 0 / 0 | |
Free PE / Size 40962 / <160.01 GiB | |
VG UUID 7fcfY2-lqgV-ZnRr-tcqa-322y-wUYH-N2LnPJ | |
--- Volume group --- | |
VG Name db | |
System ID | |
Format lvm2 | |
Metadata Areas 1 | |
Metadata Sequence No 2 | |
VG Access read/write | |
VG Status resizable | |
MAX LV 0 | |
Cur LV 1 | |
Open LV 0 | |
Max PV 0 | |
Cur PV 1 | |
Act PV 1 | |
VG Size <160.01 GiB | |
PE Size 4.00 MiB | |
Total PE 40962 | |
Alloc PE / Size 40962 / <160.01 GiB | |
Free PE / Size 0 / 0 | |
VG UUID E9irgr-adpP-b2jf-5bB3-adY4-awYl-Ev1UXi | |
--- Volume group --- | |
VG Name rootvg | |
System ID | |
Format lvm2 | |
Metadata Areas 1 | |
Metadata Sequence No 10 | |
VG Access read/write | |
VG Status resizable | |
MAX LV 0 | |
Cur LV 6 | |
Open LV 6 | |
Max PV 0 | |
Cur PV 1 | |
Act PV 1 | |
VG Size 198.78 GiB | |
PE Size 32.00 MiB | |
Total PE 6361 | |
Alloc PE / Size 2336 / 73.00 GiB | |
Free PE / Size 4025 / 125.78 GiB | |
VG UUID UKI1Xi-9cBf-v5Uh-cSCT-TYC4-x9HZ-J0v8CO | |
[root@linuxserver44 /]# lvcreate -L 60G -n u01 sw | |
WARNING: xfs signature detected on /dev/sw/u01 at offset 0. Wipe it? [y/n]: y | |
Wiping xfs signature on /dev/sw/u01. | |
Logical volume "u01" created. | |
[root@linuxserver44 /]# lvs | |
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert | |
sw db -wi-a----- <160.01g | |
homelv rootvg -wi-ao---- 20.00g | |
optlv rootvg -wi-ao---- 20.00g | |
rootlv rootvg -wi-ao---- 8.00g | |
swaplv rootvg -wi-ao---- 16.00g | |
tmplv rootvg -wi-ao---- 5.00g | |
varlv rootvg -wi-ao---- 4.00g | |
u01 sw -wi-ao---- 60.00g | |
[root@linuxserver44 /]# lvcreate -L 20G -n u02 sw | |
Logical volume "u02" created. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment