Thanks Mike,
On 04/06/2023 14.02, Mike Wright wrote:
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.
If it was not clear, nothing was mounted so no swapoff/umount is required in my case.
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).
This is what I needed and it solved my problem. I learn something every day.
The deactivation step may not be necessary but it won't hurt to make sure.
It was necessary here.
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.
It does.
cheers,
Eyal
Mike Wright
--
Eyal Lebedinsky (fedora@xxxxxxxxxxxxxx)
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue