Safely remove SATA disk from a running Linux system

Stop using the disk for anything. Then unmounted any file systems on the disk.

sudo umount ...

Deactivate any LVM groups.

sudo vgchange -an

Prevent disk damage with stop system using disk.

echo 1 | sudo tee /sys/block/{disk}/device/delete

Once you’ve done that, it should be safe to unplug SATA disk from running system.

echo 1 | sudo tee /sys/block/{disk}/device/rescan

โซเชียล

Kawin Viriyaprasopsook

System administrator at Zercle Technology Co., Ltd.
System admin กากๆ
รักในการเล่นเกม
ชอบดู Anime ญี่ปุ่น
โซเชียล

Leave a Reply