From time to time I need these commands.
Before hot-unplugging a disk drive sdX make sure that no file systems from the disk are mounted, no swap active, no LVM volumes active (N - partition number, VG - volume group, LV - logical volume, PV - physical volume):
After hot-plugging a disk drive on a host adapter X:
Before hot-unplugging a disk drive sdX make sure that no file systems from the disk are mounted, no swap active, no LVM volumes active (N - partition number, VG - volume group, LV - logical volume, PV - physical volume):
lsblk /dev/sdX # see what's there swapon -s | grep sdX # check for active swap swapoff /dev/sdXN # deactivate swap if found mount | grep sdX # check for mounted FS umount /dev/sdXN # umount them if found pvs | grep sdX # check for PVs pvdisplay -m /dev/sdXN # find LVs if a PV found umount /dev/mapper/VG-LV # umount LVs if found lvchange -an /dev/mapper/VG-LV # deactivate LVs if any
vgchange -an VG
echo 1 > /sys/block/sdX/device/delete
After hot-plugging a disk drive on a host adapter X:
echo - - - > /sys/class/scsi_host/hostX/scan
Комментариев нет:
Отправить комментарий