Linux command
lvscan 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
List all logical volumes
sudo lvscan
Include internal LV components
sudo lvscan --all
Output in JSON format
sudo lvscan --reportformat json
Run in read-only mode
sudo lvscan --readonly
Verbose output with extra detail
sudo lvscan -v
说明
lvscan scans and lists all logical volumes in all volume groups. The output shows one line per logical volume indicating whether it is active or inactive, the LV path, and its size.
参数
- -a, --all
- Show information about internal LVs that are components of normal LVs (e.g., mirror images and logs).
- -b, --blockdevice
- No longer used. Use lvs(8) or lvdisplay(8) instead.
- --readonly
- Read on-disk metadata without taking locks. Useful for inspecting metadata on VMs or clustered VGs.
- --reportformat _FORMAT_
- Output format: basic or json.
- --ignorelockingfailure
- Allow the command to continue with read-only metadata after locking failures.
- -d, --debug
- Increase debug detail (repeat 1-6 times).
- -q, --quiet
- Suppress output and log messages.
- -t, --test
- Run in test mode without updating metadata.
- -v, --verbose
- Increase verbosity (repeat 1-4 times).
FAQ
What is the lvscan command used for?
lvscan scans and lists all logical volumes in all volume groups. The output shows one line per logical volume indicating whether it is active or inactive, the LV path, and its size.
How do I run a basic lvscan example?
Run `sudo lvscan` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in lvscan?
Show information about internal LVs that are components of normal LVs (e.g., mirror images and logs).