On 6/3/23 19:42, Eyal Lebedinsky wrote:
I am on f38, but I had this problem before with f36.

I attach an external USB disk that has CentOS.
I see that beyond the basic device and partitions, three other devices /dev/dm-{0,1,2} show up. Without doing anything else I want to remove the disk safely. I could not do it, see below.

The question at the end is: how do I cleanly remove the external USB disk. It is an SSD in a USB3.0 caddy.


<snip/>

This stays until a reboot. I have some cron jobs that log the state of the machine and they raise errors in the log
from looking into these devices.

 Hi Eyal,

Partition /dev/sdi2 is now a pv so you can't work with it as a physical; you must work with it under the VG/LV names.

Remove the swap: swapoff /dev/cl/swap

Unmount root: umount /dev/cl/root

Unmount home: umount /dev/cl/home

Deactivate the LVs: vgchange --activate n cl (or vgchange -a n cl).

The deactivation step may not be necessary but it won't hurt to make sure.

All LVM stuff is cleared out. You must now refer to it by its physical name.

Note: the VG/LVs still exist and can be remounted by referring to them with their physical names: /dev/cl/{root,home} or added to swap with swapon /dev/cl/swap.

eject /dev/sdi -- you may now safely remove your device.

Hope that explains everything clearly.

Mike Wright
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to