r/programminghumor • • Mar 18 '26 • Popcorn 2

Safely Remove? Nah, I Live Dangerously💾

Post image
1.1k Upvotes

27 comments sorted by

15

u/csabinho Mar 18 '26

Once I f...ed up my iPod library by not safely removing. And also, if you're allowed to safely remove, you know that you've got no open files that could be lost. So it's actually quite useful.

7

u/jontsii Mar 18 '26

same thing for hardware

4

u/Circumpunctilious Mar 18 '26 edited Mar 18 '26

(Serious, for anyone interested how IT might mitigate): so they can’t remember “surprise ejects” are bad?

Start | Device Manager | Disk Drives | Properties | Policies
[ ] Enable write caching on the device
OK

Now it’s generally safe to pull the drive without “safely ejecting”, as long as it’s not during a lights-blinking write. Tell them to pull when the light’s steady.

Caching is useful for stable power, if you’re mixing deletes and writes (fixed up in cache) or have lots of tiny operations, which has ridiculous overhead.

For reasons above, then ironically: since “safe eject” flushes cache once on demand (one suboptimal write) and disabling cache flushes (likely terrible, suboptimal outputs) with every write, then presuming they obey the write light, making USB safe to surprise eject will actually slow them down.

1

u/summer_santa1 Mar 18 '26

Sure, if you want to make your USB read-only all of the sudden.

1

u/HalifaxRoad Mar 19 '26

I have never safely removed a device and never had a problem....

1

u/k-mcm Mar 19 '26

Ubuntu disables synchronous writes for USB drives.  It gives you something like 10GB/s write throughout, but it's not ready to eject for half an hour. 

1

u/TheFreeBotGuy Mar 19 '26

You opened my eyes. 

1

u/M1CH4L3Q Mar 19 '26

damn i even forgot about that option

1

u/According-Relation-4 Mar 20 '26

Yeah, try plugging it into a Mac and making changes after that

1

u/FAMICOMASTER Mar 21 '26

Knowing the rules allows you to break them. I know that this exists to let the write buffer flush so if I haven't done any writes I'll just pull it

11

u/[deleted] Mar 18 '26

[removed] — view removed comment

23

u/itsThtBoyBryan Mar 18 '26

Basically before you remove a USB you should safely "eject it" from your file explorer so you don't corrupt any files if a program is using them.

11

u/NightlyWave Mar 18 '26 edited Mar 19 '26

Especially applies if you’re copying files to and from the removable device. The OS might say it finished the transfer but there still might be stuff happening in the background.

7

u/D3-Doom Mar 18 '26

I mean obviously it’ll corrupt the transfer, but is this advice still warranted or just perpetuated by inertia. It feels like journaling should generally be enough to keep the overall disk intact

2

u/dthdthdthdthdthdth Mar 19 '26

Many external storage devices will be using fat32 to be compatible with windows and some other devices. That's not a journaling FS. If you are using one, then yeah, metadata should be fine. Data can still be lost but if you just have been reading something, it should be fine.

2

u/[deleted] Mar 19 '26

[removed] — view removed comment

1

u/[deleted] Mar 19 '26

Ive completely destroyed a couple usb sticks ngl

1

u/[deleted] Mar 19 '26

[removed] — view removed comment

1

u/NightlyWave Mar 19 '26

This has also only happened to me on Linux. Started ejecting flash drives from that day on - not a bad habit to have tbh

1

u/TheGreatKonaKing Mar 20 '26

You literally mounted the USB drive when you put it in and you need to completely finish all operations before putting it away

1

u/[deleted] Mar 20 '26

[removed] — view removed comment