Skip to content

Instantly share code, notes, and snippets.

@jcnars
Created November 24, 2021 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcnars/2915f23ce3e5e277a054e5052f850720 to your computer and use it in GitHub Desktop.
Save jcnars/2915f23ce3e5e277a054e5052f850720 to your computer and use it in GitHub Desktop.
[root@linuxserver44 oracle_install]# cat /etc//fstab
#
# /etc/fstab
# Created by anaconda on Sun Feb 16 10:06:11 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rootvg-rootlv / xfs defaults 0 0
UUID=bc39a085-d080-488e-9402-d22558bc88ae /boot xfs defaults 0 0
UUID=4127-64CB /boot/efi vfat defaults,uid=0,gid=0,umask=0077,shortname=winnt 0 0
/dev/mapper/rootvg-homelv /home xfs defaults 0 0
/dev/mapper/rootvg-optlv /opt xfs defaults 0 0
/dev/mapper/rootvg-tmplv /tmp xfs defaults 0 0
/dev/mapper/rootvg-varlv /var xfs defaults 0 0
/dev/mapper/rootvg-swaplv1 none swap sw,nofail 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
[root@linuxserver44 oracle_install]# vi /etc/fstab
[root@linuxserver44 oracle_install]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 378G 200M 377G 1% /dev
tmpfs 378G 16K 378G 1% /dev/shm
tmpfs 378G 899M 377G 1% /run
tmpfs 378G 0 378G 0% /sys/fs/cgroup
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% /
/dev/mapper/3600a098038314344382b4f7539397555p2 1014M 192M 823M 19% /boot
/dev/mapper/3600a098038314344382b4f7539397555p1 204M 9.7M 195M 5% /boot/efi
/dev/mapper/rootvg-tmplv 5.0G 34M 5.0G 1% /tmp
/dev/mapper/rootvg-homelv 20G 6.3G 14G 32% /home
/dev/mapper/rootvg-optlv 20G 2.4G 18G 12% /opt
/dev/mapper/rootvg-varlv 4.0G 1.7G 2.4G 42% /var
tmpfs 76G 0 76G 0% /run/user/1001
tmpfs 76G 0 76G 0% /run/user/1532
[root@linuxserver44 oracle_install]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
mkfs.xfs: cannot open /dev/mapper/sw-u01: Device or resource busy
[root@linuxserver44 oracle_install]# lsof /dev/mapper/sw-u01
[root@linuxserver44 oracle_install]# fuser /dev/mapper/sw-u01
[root@linuxserver44 oracle_install]# fuser /dev/mapper/sw-u01
[root@linuxserver44 oracle_install]# !cat
cat /etc//fstab
#
# /etc/fstab
# Created by anaconda on Sun Feb 16 10:06:11 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rootvg-rootlv / xfs defaults 0 0
UUID=bc39a085-d080-488e-9402-d22558bc88ae /boot xfs defaults 0 0
UUID=4127-64CB /boot/efi vfat defaults,uid=0,gid=0,umask=0077,shortname=winnt 0 0
/dev/mapper/rootvg-homelv /home xfs defaults 0 0
/dev/mapper/rootvg-optlv /opt xfs defaults 0 0
/dev/mapper/rootvg-tmplv /tmp xfs defaults 0 0
/dev/mapper/rootvg-varlv /var xfs defaults 0 0
/dev/mapper/rootvg-swaplv1 none swap sw,nofail 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
/dev/mapper/sw-u01 /u01 xfs defaults 0 0
/dev/mapper/sw-u02 /u02 xfs defaults 0 0
[root@linuxserver44 oracle_install]# 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
u02 sw -wi-a----- 20.00g
[root@linuxserver44 oracle_install]# 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 2 0 wz--n- <160.01g <80.01g
[root@linuxserver44 oracle_install]# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/3600a098038314344372b4f75392d3850 db lvm2 a-- <160.01g 0
/dev/mapper/3600a098038314344382b4f7539397459 sw lvm2 a-- 80.00g 4.00m
/dev/mapper/3600a098038314344382b4f753939745a sw lvm2 a-- 80.00g 80.00g
/dev/mapper/3600a098038314344382b4f7539397555p3 rootvg lvm2 a-- 198.78g 125.78g
[root@linuxserver44 oracle_install]# lvremove sw
Logical volume sw/u01 contains a filesystem in use.
Do you really want to remove active logical volume sw/u02? [y/n]: y
Logical volume "u02" successfully removed
[root@linuxserver44 oracle_install]# lvcreate sw
No command with matching syntax recognised. Run 'lvcreate --help' for more information.
[root@linuxserver44 oracle_install]# lvcreate --help
lvcreate - Create a logical volume
Create a linear LV.
lvcreate -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ --type linear ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a striped LV (infers --type striped).
lvcreate -i|--stripes Number -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a raid1 or mirror LV (infers --type raid1|mirror).
lvcreate -m|--mirrors Number -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --mirrorlog core|disk ]
[ --minrecoveryrate Size[k|UNIT] ]
[ --maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a raid LV (a specific raid level must be used, e.g. raid1).
lvcreate --type raid -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -m|--mirrors Number ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --minrecoveryrate Size[k|UNIT] ]
[ --maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a raid10 LV.
lvcreate -m|--mirrors Number -i|--stripes Number -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --minrecoveryrate Size[k|UNIT] ]
[ --maxrecoveryrate Size[k|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a COW snapshot LV of an origin LV.
lvcreate -s|--snapshot -L|--size Size[m|UNIT] LV
[ -l|--extents Number[PERCENT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ --type snapshot ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a thin pool.
lvcreate --type thin-pool -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --thinpool LV_new ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a cache pool.
lvcreate --type cache-pool -L|--size Size[m|UNIT] VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a thin LV in a thin pool (infers --type thin).
lvcreate -V|--virtualsize Size[m|UNIT] --thinpool LV_thinpool VG
[ -T|--thin ]
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
Create a thin LV that is a snapshot of an existing thin LV
(infers --type thin).
lvcreate -s|--snapshot LV_thin
[ --type thin ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
Create a thin LV that is a snapshot of an external origin LV.
lvcreate --type thin --thinpool LV_thinpool LV
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
Create a thin LV, first creating a thin pool for it,
where the new thin pool is named by the --thinpool arg.
lvcreate --type thin -V|--virtualsize Size[m|UNIT] -L|--size Size[m|UNIT] --thinpool LV_new
[ -l|--extents Number[PERCENT] ]
[ -T|--thin ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
Create a cache LV, first creating a new origin LV,
then combining it with the existing cache pool named
by the --cachepool arg.
lvcreate --type cache -L|--size Size[m|UNIT] --cachepool LV_cachepool VG
[ -l|--extents Number[PERCENT] ]
[ -H|--cache ]
[ -c|--chunksize Size[k|UNIT] ]
[ -i|--stripes Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --cachemetadataformat auto|1|2 ]
[ COMMON_OPTIONS ]
[ PV ... ]
Common options for command:
[ -a|--activate y|n|ay ]
[ -A|--autobackup y|n ]
[ -C|--contiguous y|n ]
[ -M|--persistent y|n ]
[ -j|--major Number ]
[ -k|--setactivationskip y|n ]
[ -K|--ignoreactivationskip ]
[ -n|--name String ]
[ -p|--permission rw|r ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --addtag Tag ]
[ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
[ --ignoremonitoring ]
[ --metadataprofile String ]
[ --minor Number ]
[ --monitor y|n ]
[ --nosync ]
[ --noudevsync ]
[ --reportformat basic|json ]
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 oracle_install]# lvcreate VG db sw
No command with matching syntax recognised. Run 'lvcreate --help' for more information.
[root@linuxserver44 oracle_install]# lvcreate -n sw db
No command with matching syntax recognised. Run 'lvcreate --help' for more information.
[root@linuxserver44 oracle_install]# lvcreate -l 100 -n sw db
Logical Volume "sw" already exists in volume group "db"
[root@linuxserver44 oracle_install]# 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 oracle_install]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
mkfs.xfs: cannot open /dev/mapper/sw-u01: Device or resource busy
[root@linuxserver44 oracle_install]# lvremove u01
Volume group "u01" not found
Cannot process volume group u01
[root@linuxserver44 oracle_install]#
[root@linuxserver44 oracle_install]#
[root@linuxserver44 oracle_install]# 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 oracle_install]# 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 <100.01g
[root@linuxserver44 oracle_install]# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/3600a098038314344372b4f75392d3850 db lvm2 a-- <160.01g 0
/dev/mapper/3600a098038314344382b4f7539397459 sw lvm2 a-- 80.00g 20.00g
/dev/mapper/3600a098038314344382b4f753939745a sw lvm2 a-- 80.00g 80.00g
/dev/mapper/3600a098038314344382b4f7539397555p3 rootvg lvm2 a-- 198.78g 125.78g
[root@linuxserver44 oracle_install]# ls -l /dev/mapper/*sw*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/db-sw -> ../dm-73
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv -> ../dm-65
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv1 -> ../dm-72
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u021
[root@linuxserver44 oracle_install]# date
Tue Nov 23 20:57:25 PST 2021
[root@linuxserver44 oracle_install]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 378G 200M 377G 1% /dev
tmpfs 378G 16K 378G 1% /dev/shm
tmpfs 378G 899M 377G 1% /run
tmpfs 378G 0 378G 0% /sys/fs/cgroup
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% /
/dev/mapper/3600a098038314344382b4f7539397555p2 1014M 192M 823M 19% /boot
/dev/mapper/3600a098038314344382b4f7539397555p1 204M 9.7M 195M 5% /boot/efi
/dev/mapper/rootvg-tmplv 5.0G 34M 5.0G 1% /tmp
/dev/mapper/rootvg-homelv 20G 6.3G 14G 32% /home
/dev/mapper/rootvg-optlv 20G 2.4G 18G 12% /opt
/dev/mapper/rootvg-varlv 4.0G 1.7G 2.4G 42% /var
tmpfs 76G 0 76G 0% /run/user/1001
tmpfs 76G 0 76G 0% /run/user/1532
[root@linuxserver44 oracle_install]# mount /dev/mapper/sw-u01 /u01
mount: mount point /u01 does not exist
[root@linuxserver44 oracle_install]# mkdir /u01
[root@linuxserver44 oracle_install]# mount /dev/mapper/sw-u01 /u01
[root@linuxserver44 oracle_install]# df -h /u01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/sw-u01 60G 33M 60G 1% /u01
[root@linuxserver44 oracle_install]# umount /u01
[root@linuxserver44 oracle_install]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
mkfs.xfs: cannot open /dev/mapper/sw-u01: Device or resource busy
[root@linuxserver44 oracle_install]# !ls
ls -l /dev/mapper/*sw*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/db-sw -> ../dm-73
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv -> ../dm-65
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv1 -> ../dm-72
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u021
[root@linuxserver44 oracle_install]# 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 oracle_install]# lvremove u01
Volume group "u01" not found
Cannot process volume group u01
[root@linuxserver44 oracle_install]# lvremove /dev/mapper/sw-u01
Logical volume sw/u01 contains a filesystem in use.
[root@linuxserver44 oracle_install]# lvremove /dev/mapper/sw-u01 -f
Logical volume sw/u01 contains a filesystem in use.
[root@linuxserver44 oracle_install]# lvremove /dev/mapper/sw-u01 --force
Logical volume sw/u01 contains a filesystem in use.
[root@linuxserver44 oracle_install]# lvremove /dev/mapper/sw-u01 -force
lvremove: invalid option -- 'o'
Error during parsing of command line.
[root@linuxserver44 oracle_install]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 378G 200M 377G 1% /dev
tmpfs 378G 16K 378G 1% /dev/shm
tmpfs 378G 899M 377G 1% /run
tmpfs 378G 0 378G 0% /sys/fs/cgroup
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% /
/dev/mapper/3600a098038314344382b4f7539397555p2 1014M 192M 823M 19% /boot
/dev/mapper/3600a098038314344382b4f7539397555p1 204M 9.7M 195M 5% /boot/efi
/dev/mapper/rootvg-tmplv 5.0G 34M 5.0G 1% /tmp
/dev/mapper/rootvg-homelv 20G 6.3G 14G 32% /home
/dev/mapper/rootvg-optlv 20G 2.4G 18G 12% /opt
/dev/mapper/rootvg-varlv 4.0G 1.7G 2.4G 42% /var
tmpfs 76G 0 76G 0% /run/user/1001
tmpfs 76G 0 76G 0% /run/user/1532
[root@linuxserver44 oracle_install]# ls -l /dev/mapper/*sw*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/db-sw -> ../dm-73
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv -> ../dm-65
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/rootvg-swaplv1 -> ../dm-72
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u021
[root@linuxserver44 oracle_install]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
mkfs.xfs: cannot open /dev/mapper/sw-u01: Device or resource busy
[root@linuxserver44 oracle_install]# wipefs
Usage:
wipefs [options] <device>
Options:
-a, --all wipe all magic strings (BE CAREFUL!)
-f, --force force erasure
-h, --help show this help text
-n, --no-act do everything except the actual write() call
-o, --offset <num> offset to erase, in bytes
-p, --parsable print out in parsable instead of printable format
-q, --quiet suppress output messages
-t, --types <list> limit the set of filesystem, RAIDs or partition tables
-V, --version output version information and exit
For more information see wipefs(8).
[root@linuxserver44 oracle_install]# wipefs -a /dev/mapper/sw-u0
sw-u01 sw-u011 sw-u021
[root@linuxserver44 oracle_install]# wipefs -a /dev/mapper/sw-u01
wipefs: error: /dev/mapper/sw-u01: probing initialization failed: Device or resource busy
[root@linuxserver44 oracle_install]# xfs_
xfs_admin xfs_copy xfs_estimate xfs_fsr xfs_info xfs_logprint xfs_metadump xfs_ncheck xfs_repair
xfs_bmap xfs_db xfs_freeze xfs_growfs xfs_io xfs_mdrestore xfs_mkfile xfs_quota xfs_rtcp
[root@linuxserver44 oracle_install]# xfs_
xfs_admin xfs_copy xfs_estimate xfs_fsr xfs_info xfs_logprint xfs_metadump xfs_ncheck xfs_repair
xfs_bmap xfs_db xfs_freeze xfs_growfs xfs_io xfs_mdrestore xfs_mkfile xfs_quota xfs_rtcp
[root@linuxserver44 oracle_install]# mkfs
mkfs mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.fat mkfs.minix mkfs.msdos mkfs.vfat mkfs.xfs
[root@linuxserver44 oracle_install]#
[root@linuxserver44 oracle_install]#
[root@linuxserver44 oracle_install]# wipefs -a /dev/mapper/sw-u01
wipefs: error: /dev/mapper/sw-u01: probing initialization failed: Device or resource busy
[root@linuxserver44 oracle_install]# mount /dev/mapper/sw-u01
[root@linuxserver44 oracle_install]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 378G 200M 377G 1% /dev
tmpfs 378G 16K 378G 1% /dev/shm
tmpfs 378G 899M 377G 1% /run
tmpfs 378G 0 378G 0% /sys/fs/cgroup
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% /
/dev/mapper/3600a098038314344382b4f7539397555p2 1014M 192M 823M 19% /boot
/dev/mapper/3600a098038314344382b4f7539397555p1 204M 9.7M 195M 5% /boot/efi
/dev/mapper/rootvg-tmplv 5.0G 34M 5.0G 1% /tmp
/dev/mapper/rootvg-homelv 20G 6.3G 14G 32% /home
/dev/mapper/rootvg-optlv 20G 2.4G 18G 12% /opt
/dev/mapper/rootvg-varlv 4.0G 1.7G 2.4G 42% /var
tmpfs 76G 0 76G 0% /run/user/1001
tmpfs 76G 0 76G 0% /run/user/1532
/dev/mapper/sw-u01 60G 33M 60G 1% /u01
[root@linuxserver44 oracle_install]# rm
rm rmail rmail.postfix rmcp_ping rmdir rmmod
[root@linuxserver44 oracle_install]# rm
rm rmail rmail.postfix rmcp_ping rmdir rmmod
[root@linuxserver44 oracle_install]# umount /u01
[root@linuxserver44 oracle_install]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 378G 200M 377G 1% /dev
tmpfs 378G 16K 378G 1% /dev/shm
tmpfs 378G 899M 377G 1% /run
tmpfs 378G 0 378G 0% /sys/fs/cgroup
/dev/mapper/rootvg-rootlv 8.0G 2.9G 5.2G 36% /
/dev/mapper/3600a098038314344382b4f7539397555p2 1014M 192M 823M 19% /boot
/dev/mapper/3600a098038314344382b4f7539397555p1 204M 9.7M 195M 5% /boot/efi
/dev/mapper/rootvg-tmplv 5.0G 34M 5.0G 1% /tmp
/dev/mapper/rootvg-homelv 20G 6.3G 14G 32% /home
/dev/mapper/rootvg-optlv 20G 2.4G 18G 12% /opt
/dev/mapper/rootvg-varlv 4.0G 1.7G 2.4G 42% /var
tmpfs 76G 0 76G 0% /run/user/1001
tmpfs 76G 0 76G 0% /run/user/1532
[root@linuxserver44 oracle_install]# wipefs -a /dev/mapper/sw-u01
wipefs: error: /dev/mapper/sw-u01: probing initialization failed: Device or resource busy
[root@linuxserver44 oracle_install]# lsof | grep u01
[root@linuxserver44 oracle_install]# lsof | grep u0
[root@linuxserver44 oracle_install]# lvchange -an -v /dev/mapper/sw-u01
Deactivating logical volume sw/u01.
Logical volume sw/u01 contains a filesystem in use.
[root@linuxserver44 oracle_install]# 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 oracle_install]# lvremove u01
Volume group "u01" not found
Cannot process volume group u01
[root@linuxserver44 oracle_install]# lvchange -vf /dev/mapper/sw-u01
No command with matching syntax recognised. Run 'lvchange --help' for more information.
[root@linuxserver44 oracle_install]# lvremovge -vf /dev/mapper/sw-u01
-bash: lvremovge: command not found
[root@linuxserver44 oracle_install]# lvremove -vf /dev/mapper/sw-u01
Logical volume sw/u01 contains a filesystem in use.
[root@linuxserver44 oracle_install]# dmsetup info -c | grep u01
sw-u01 253 70 L--w 1 2 0 LVM-7fcfY2lqgVZnRrtcqa322ywUYHN2LnPJLM3wY5VENbfK0JyM66mEoBI0Vendv6Kg
[root@linuxserver44 oracle_install]# lsof | grep "253,70"
bash 6675 root cwd DIR 253,70 6 99 /oracle_install (deleted)
lsof 14302 root cwd DIR 253,70 6 99 /oracle_install (deleted)
grep 14303 root cwd DIR 253,70 6 99 /oracle_install (deleted)
lsof 14304 root cwd DIR 253,70 6 99 /oracle_install (deleted)
[root@linuxserver44 oracle_install]# ps -ef|grep 6675
root 6675 6674 0 Nov15 pts/0 00:00:00 -bash
root 15090 6675 0 21:19 pts/0 00:00:00 ps -ef
root 15091 6675 0 21:19 pts/0 00:00:00 grep --color=auto 6675
[root@linuxserver44 oracle_install]# ps -ef|grep 14302
root 15353 6675 0 21:20 pts/0 00:00:00 grep --color=auto 14302
[root@linuxserver44 oracle_install]# ps -ef|grep 14303
root 15510 6675 0 21:20 pts/0 00:00:00 grep --color=auto 14303
[root@linuxserver44 oracle_install]# ps -ef|grep 14304
root 15558 6675 0 21:20 pts/0 00:00:00 grep --color=auto 14304
[root@linuxserver44 oracle_install]# lsof | grep "253,70"
bash 6675 root cwd DIR 253,70 6 99 /oracle_install (deleted)
lsof 10061 root cwd DIR 253,70 6 99 /oracle_install (deleted)
grep 10062 root cwd DIR 253,70 6 99 /oracle_install (deleted)
lsof 10067 root cwd DIR 253,70 6 99 /oracle_install (deleted)
[root@linuxserver44 oracle_install]# pstree
systemd─┬─agetty
├─atd
├─auditd───{auditd}
├─crond
├─dbus-daemon
├─elxhbamgrd───{elxhbamgrd}
├─gssproxy───5*[{gssproxy}]
├─init.tfa───sleep
├─irqbalance
├─lvmetad
├─master─┬─pickup
│ └─qmgr
├─multipathd───66*[{multipathd}]
├─ntpd
├─polkitd───6*[{polkitd}]
├─rdma-ndd
├─rhnsd
├─rhsm-service───2*[{rhsm-service}]
├─rhsmcertd
├─rhsmd───{rhsmd}
├─rpcbind
├─rsyslogd───2*[{rsyslogd}]
├─smartd
├─sshd───sshd───sshd───bash───sudo───su───bash───pstree
├─2*[sudo───tcpdump]
├─systemd-journal
├─systemd-logind
├─systemd-udevd
└─tuned───4*[{tuned}]
[root@linuxserver44 oracle_install]# pstree -p 6675
bash(6675)───pstree(10586)
[root@linuxserver44 oracle_install]# dmsetup info -c | grep u01
sw-u01 253 70 L--w 1 2 0 LVM-7fcfY2lqgVZnRrtcqa322ywUYHN2LnPJLM3wY5VENbfK0JyM66mEoBI0Vendv6Kg
[root@linuxserver44 oracle_install]# history|grep oracle_install
451 cd /u01/oracle_install/
456 cd oracle_install/
474 cd ../oracle_install/
551 cd oracle_install/
563 cd /u01/oracle_install/32578973/32545008/
566 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/32578973/32545008
568 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/32126842/32226239
572 cd oracle_install/
579 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/31720429/31750108
584 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/31720429/31750108
587 ll /u01/oracle_install/31720429/31750108
588 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/31720429/31750108
591 /u01/app/19.3.0/grid/OPatch/opatchauto rollback /u01/oracle_install/31720429/31750108
603 cd /u01/oracle_install/
1075 cd oracle_install/
1150 history|grep oracle_install
[root@linuxserver44 oracle_install]# pstree -p 6675
bash(6675)───pstree(12806)
[root@linuxserver44 oracle_install]# lsof|grep u01
[root@linuxserver44 oracle_install]# findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/mapper/rootvg-rootlv
xfs rw,relatime,attr2,inode64,noquota
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
│ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids
│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_prio,net_cls
│ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
│ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
│ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu
│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
│ │ └─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
│ ├─/sys/firmware/efi/efivars efivarfs efivarfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/config configfs configfs rw,relatime
│ └─/sys/kernel/debug debugfs debugfs rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=26,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=32648
│ └─/proc/sys/fs/binfmt_misc binfmt_misc binfmt_misc rw,relatime
├─/dev devtmpfs devtmpfs rw,nosuid,size=395516504k,nr_inodes=98879126,mode=755
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/hugepages hugetlbfs hugetlbfs rw,relatime
│ └─/dev/mqueue mqueue mqueue rw,relatime
├─/run tmpfs tmpfs rw,nosuid,nodev,mode=755
│ ├─/run/user/1532 tmpfs tmpfs rw,nosuid,nodev,relatime,size=79105900k,mode=700,uid=1532,gid=1532
│ └─/run/user/1001 tmpfs tmpfs rw,nosuid,nodev,relatime,size=79105900k,mode=700,uid=1001,gid=1001
├─/boot /dev/mapper/3600a098038314344382b4f7539397555p2
xfs rw,relatime,attr2,inode64,noquota
│ └─/boot/efi /dev/mapper/3600a098038314344382b4f7539397555p1
vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro
├─/tmp /dev/mapper/rootvg-tmplv
xfs rw,relatime,attr2,inode64,noquota
├─/home /dev/mapper/rootvg-homelv
xfs rw,relatime,attr2,inode64,noquota
├─/var /dev/mapper/rootvg-varlv
xfs rw,relatime,attr2,inode64,noquota
│ └─/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
└─/opt /dev/mapper/rootvg-optlv
xfs rw,relatime,attr2,inode64,noquota
[root@linuxserver44 oracle_install]# findmnt|grep u01
[root@linuxserver44 oracle_install]# ll /dev/mapper/*up1*
ls: cannot access /dev/mapper/*up1*: No such file or directory
[root@linuxserver44 oracle_install]# ll /dev/mapper/*uo1*
ls: cannot access /dev/mapper/*uo1*: No such file or directory
[root@linuxserver44 oracle_install]# ll /dev/mapper/*u01*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
[root@linuxserver44 oracle_install]# lsof|grep dm-70
dio/dm-70 27410 root cwd DIR 253,64 4096 96 /
dio/dm-70 27410 root rtd DIR 253,64 4096 96 /
dio/dm-70 27410 root txt unknown /proc/27410/exe
[root@linuxserver44 oracle_install]# lsof|grep dm-70
dio/dm-70 27410 root cwd DIR 253,64 4096 96 /
dio/dm-70 27410 root rtd DIR 253,64 4096 96 /
dio/dm-70 27410 root txt unknown /proc/27410/exe
[root@linuxserver44 oracle_install]# ps -ef|grep 27410
root 16118 6675 0 22:01 pts/0 00:00:00 grep --color=auto 27410
root 27410 2 0 Nov17 ? 00:00:00 [dio/dm-70]
[root@linuxserver44 oracle_install]# pstree -p 27410
dio/dm-70(27410)
[root@linuxserver44 oracle_install]# which dio
/usr/bin/which: no dio in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/root/bin)
[root@linuxserver44 oracle_install]# ps -ef|grep dio
root 16582 6675 0 22:02 pts/0 00:00:00 grep --color=auto dio
root 27410 2 0 Nov17 ? 00:00:00 [dio/dm-70]
[root@linuxserver44 oracle_install]# kill -9 27410
[root@linuxserver44 oracle_install]# ll /dev/mapper/*u01*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
[root@linuxserver44 oracle_install]# lsof|grep dm-70
dio/dm-70 27410 root cwd DIR 253,64 4096 96 /
dio/dm-70 27410 root rtd DIR 253,64 4096 96 /
dio/dm-70 27410 root txt unknown /proc/27410/exe
[root@linuxserver44 oracle_install]# ps -ef|grep dio
root 18515 6675 0 22:04 pts/0 00:00:00 grep --color=auto dio
root 27410 2 0 Nov17 ? 00:00:00 [dio/dm-70]
[root@linuxserver44 oracle_install]# cd /proc/27410/exe
-bash: cd: /proc/27410/exe: No such file or directory
[root@linuxserver44 oracle_install]# cd /proc/27410/
[root@linuxserver44 27410]# ls
ls: cannot open directory .: No such process
[root@linuxserver44 27410]# cd -
-bash: cd: /u01/oracle_install: No such file or directory
[root@linuxserver44 27410]# cd /
[root@linuxserver44 /]# cd -
-bash: cd: /proc/27410: No such file or directory
[root@linuxserver44 /]# ps -ef|grep dio
root 19305 6675 0 22:05 pts/0 00:00:00 grep --color=auto dio
[root@linuxserver44 /]# ll /dev/mapper/*u01*
lrwxrwxrwx 1 root root 8 Nov 23 19:47 /dev/mapper/sw-u01 -> ../dm-70
-rw-r--r-- 1 root root 104857600 Feb 3 2021 /dev/mapper/sw-u011
[root@linuxserver44 /]# lvremove -vf /dev/mapper/sw-u01
Removing sw-u01 (253:70)
Archiving volume group "sw" metadata (seqno 6).
Releasing logical volume "u01"
Creating volume group backup "/etc/lvm/backup/sw" (seqno 7).
Logical volume "u01" successfully removed
[root@linuxserver44 /]# #lvcreate -l 100 -n u01 sw
[root@linuxserver44 /]# lvcreate -l 100 -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 /]# !mkfs.xfs
-bash: !mkfs.xfs: event not found
[root@linuxserver44 /]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
meta-data=/dev/mapper/sw-u01 isize=512 agcount=4, agsize=25600 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=102400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=1605, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linuxserver44 /]# /sbin/mkfs.xfs -f /dev/mapper/sw-u01
meta-data=/dev/mapper/sw-u01 isize=512 agcount=4, agsize=25600 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=102400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=1605, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linuxserver44 /]# #atleast the busy error is gone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment