On Wed, Feb 08, 2023 at 04:50:32PM +0100, Jan Stary wrote: > On Feb 08 13:56:18, [email protected] wrote: > > 1) close any open files stored there > > 2) make sure no process has the media as $PWD (as in, cd away from there, > > and really a variation on the first) > > 3) issue at least one sync command (some folklore will insist on three) > > 4) umount the media from wherever it was mounted > > 4 takes care of 1,2,3, right?
It is a common assumption it does, but I have seen time and again applications either coredumping and hanging while doing so or just getting terribly confused when their presumed current directory disappeared from under them. Depending on how much force you put behind the umount (as in doas, sudo) it is not entirely certain you would be able to umount a file system that has open files. Then again, your mileage may vary. And the OP asked for safe removal. - P -- Peter N. M. Hansteen, member of the first RFC 1149 implementation team https://bsdly.blogspot.com/ https://www.bsdly.net/ https://www.nuug.no/ "Remember to set the evil bit on all malicious network traffic" delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.

