Linux 外付けHDD マウント コマンドメモ

投稿者:
lvscan
デバイスをスキャンして論理ボリュームを一覧表示する

[root@localhost ~]# lvscan
ACTIVE ‘/dev/almalinux/swap’ [29.80 GiB] inherit
ACTIVE ‘/dev/almalinux/home’ [372.53 GiB] inherit
ACTIVE ‘/dev/almalinux/root’ [490.98 GiB] inherit
ACTIVE ‘/dev/cl/swap’ [14.90 GiB] inherit
ACTIVE ‘/dev/cl/home’ [186.26 GiB] inherit
ACTIVE ‘/dev/cl/root’ [<244.45 GiB] inherit

vgscan
デバイスをスキャンしてボリュームグループを一覧表示する

[root@localhost ~]# vgscan –mknodes
Found volume group “almalinux” using metadata type lvm2
Found volume group “cl” using metadata type lvm2

Thank you for reading this post, don't forget to subscribe!
vgdisplay
ボリュームグループの詳細情報を表示する
vgrename 
コマンド――ボリュームグループの名前を変更する

[root@localhost ~]# vgrename 55ETGD-KeWV-0kjk-rpoE-5sgc-abTa-9At8Yx almalinux

vgchange
ボリュームグループのアクティブ化と非アクティブ化

[root@localhost ~]# vgchange -ay
3 logical volume(s) in volume group “almalinux” now active
3 logical volume(s) in volume group “cl” now active

lsblk 
Linuxで接続されているハードディスクの一覧を取得

[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 572M 0 part /boot/efi
├─sda2 8:2 0 976M 0 part /boot
└─sda3 8:3 0 445.6G 0 part
├─cl-root 253:0 0 244.5G 0 lvm /
├─cl-swap 253:1 0 14.9G 0 lvm [SWAP]
└─cl-home 253:2 0 186.3G 0 lvm /home
sdb 8:16 0 3.7T 0 disk /mnt/usb-hdd
sdc 8:32 0 894.3G 0 disk
├─sdc1 8:33 0 953M 0 part
└─sdc2 8:34 0 893.3G 0 part
├─almalinux-swap 253:3 0 29.8G 0 lvm
├─almalinux-home 253:4 0 372.5G 0 lvm /mnt/usb-tmp
└─almalinux-root 253:5 0 491G 0 lvm