[SOLVED] Is there a Linux eqivalent to "safely remove USB"
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi. And thanks in advance for simply being here! You're much appreciated.
In Windows, I know it's important to click the icon before removing a flash drive. Is there an equivalent in Linux, or does it depend on the distro? I'm so Pavlov-trained that I cringe at just pulling the drive out without securing it first. What does that Windows process do, anyway? Finalize it? Close open files or something?
In Linux you must unmount writeable disks before removing them. Many desktops have a graphical app for doing this. In a terminal you use the umount command. After that, it is safe to remove them.
Linux does not usually write to disks as soon as a program gives a write command. Instead, it writes into a buffer and transfers the contents of this to disk when the cpu is otherwise idle. That is why simply pulling out a pendrive can cause it to be corrupted. In addition, the system thinks the disk is still mounted on its mount point, which could cause problems if you try to write to that directory. Unmounting the disk causes a synchronization operation that writes all buffers to disk, followed by the mount point being cleared.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by DGLauren
Hi. And thanks in advance for simply being here! You're much appreciated.
In Windows, I know it's important to click the icon before removing a flash drive. Is there an equivalent in Linux, or does it depend on the distro? I'm so Pavlov-trained that I cringe at just pulling the drive out without securing it first. What does that Windows process do, anyway? Finalize it? Close open files or something?
Thanks for your help!
It depends on your desktop environment/window manager, but having said that, most of them would have an equivalent. So the answer would be yes.
In Linux you must unmount writeable disks before removing them. Many desktops have a graphical app for doing this. In a terminal you use the umount command. After that, it is safe to remove them.
Linux does not usually write to disks as soon as a program gives a write command. Instead, it writes into a buffer and transfers the contents of this to disk when the cpu is otherwise idle. That is why simply pulling out a pendrive can cause it to be corrupted. In addition, the system thinks the disk is still mounted on its mount point, which could cause problems if you try to write to that directory. Unmounting the disk causes a synchronization operation that writes all buffers to disk, followed by the mount point being cleared.
Hazel! Thank you so much for responding to my question. You not only told me exactly what I needed to know, but explained why. That second part is what put such a gigantic grin on my face. (That, and your signature.) I, too, am a little old lady and learning is still a thrill. Loved what I found in your website, as well. Thank you.
Lauren
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.