LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 04-26-2014, 09:51 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
"unmount volume" or "eject volume" to safely remove a flash drive?


When I right click on a flash drive icon on my desktop I get the option to "unmount volume" or "eject volume." I've always just chosen "eject volume" and then removed the flash drive. But now I read somewhere that I should choose "unmount volume" before I can safely remove the flash drive. And some people say I need to click "unmount volume" and then "eject volume" to safely remove it. And some people say "eject volume" is for CDs and DVDs and not flash drives. I just want to know how to safely remove my flash drive. And I might as well ask how it applies to CDs and DVDs too. (I haven't used them yet but will.) Thanks very much!
 
Old 04-26-2014, 09:59 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Eject will dismount - but you have to wait for the buffers to finish flushing before you remove it.

Most flash drives have an activity light for that...

As for CDs/DVDs, it depends... if it is a read only device, no problem.

If you have been writing to a device... you have to wait for buffers to flush to the disk, or you get a coaster...

Last edited by jpollard; 04-26-2014 at 10:00 PM.
 
Old 04-27-2014, 12:07 AM   #3
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by jpollard View Post
Eject will dismount - but you have to wait for the buffers to finish flushing before you remove it.

Most flash drives have an activity light for that...

As for CDs/DVDs, it depends... if it is a read only device, no problem.

If you have been writing to a device... you have to wait for buffers to flush to the disk, or you get a coaster...
So if I "unmount" it's safe to remove the flash drive? And then there's no need to "eject," right? And can I safely remove a flash drive from the computer when it's off? And can I safely insert a flash drive when the computer is off?

Last edited by Gregg Bell; 04-27-2014 at 12:08 AM. Reason: add
 
Old 04-27-2014, 04:21 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Gregg Bell View Post
So if I "unmount" it's safe to remove the flash drive? And then there's no need to "eject," right? And can I safely remove a flash drive from the computer when it's off? And can I safely insert a flash drive when the computer is off?
Remove only after the dismount/eject and it is off.
 
1 members found this post helpful.
Old 04-27-2014, 05:32 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
umount will only unmount one single partition, eject will unmount all the mounted partitions of that usb drive. umount is ok, you do not need eject, for CD/DVD it will not only umount but open the tray too.
 
1 members found this post helpful.
Old 04-27-2014, 07:51 PM   #6
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Thank jpollard and pan64 but I still have a few questions:

1)When I have a flash drive mounted, and I want to take it out, is it best to click on "unmount" or "eject"? (If I click on
"unmount" it removes the "eject" option.) (And if I click on the "eject" option, the icon for the flashdrive disappears from the desktop.)

2)So the flash drive should only be removed when unmount or eject is selected and the computer is off?

3)If I forget to hit eject or unmount and turn the computer off, is it okay to remove the flash drive then?

4)Is it okay to insert the flash drive when the computer is off?

5)This statement was confusing: umount will only unmount one single partition, eject will unmount all the mounted partitions of that usb drive. umount is ok, you do not need eject This sounds like "eject" would be better than "unmount" (it would be unmounting the usb drive entirely, so why would unmount be ok and I not need eject?)

Last edited by Gregg Bell; 04-27-2014 at 07:56 PM. Reason: adding something
 
Old 04-27-2014, 08:24 PM   #7
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
DESCRIPTION
Eject allows removable media (typically a CD-ROM, floppy disk, tape, or
JAZ or ZIP disk) to be ejected under software control. The command can
also control some multi-disc CD-ROM changers, the auto-eject feature
supported by some devices, and close the disc tray of some CD-ROM
drives.

The device corresponding to <name> is ejected. The name can be a device
file or mount point, either a full path or with the leading "/dev",
"/media" or "/mnt" omitted. If no name is specified, the default name
"cdrom" is used.

There are four different methods of ejecting, depending on whether the
device is a CD-ROM, SCSI device, removable floppy, or tape. By default
eject tries all four methods in order until it succeeds.

If the device is currently mounted, it is unmounted before ejecting.
1) Either one works. Clearly "unmount" should be used most of the time, unless you also want to eject a DVD/CD.

2) The flash drive should be removed when the LED on it stops blinking i.e. when it finishes writing and then unmounts it. When you give it the command to unmount, it waits for all I/O to be finished and then unmounts, make sure you wait for it to do that.

3) Yes. The shutdown procedure unmounts all mounted filesystems first.

4) Yes.

5) Not really, because you usually mount only one partition at a time and thus only need to unmount one partition.
 
1 members found this post helpful.
Old 04-27-2014, 09:50 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
My understanding (and I just made up all the facts to come to my understanding!) is that "unmount" removes OS access to the data and "eject" physically opens the door and kicks the thing out (like a CD drive opening). To eject something, the OS first unmounts it. So feel free to eject something knowing that the required unmount happens automatically.

However, to unmount something does not require it to be ejected. On things like USB thumbdrives, those aren't physically ejected, so in that case "eject" degenerates into the equivalent of "unmount". So the best the computer can do with devices like this is unmount them, even if you specified eject. YOU are the ejection step - reach in there, grab the thing, and yank it out (AFTER unmounting it, that is).
 
1 members found this post helpful.
Old 04-29-2014, 02:17 AM   #9
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by metaschima View Post
1) Either one works. Clearly "unmount" should be used most of the time, unless you also want to eject a DVD/CD.

2) The flash drive should be removed when the LED on it stops blinking i.e. when it finishes writing and then unmounts it. When you give it the command to unmount, it waits for all I/O to be finished and then unmounts, make sure you wait for it to do that.

3) Yes. The shutdown procedure unmounts all mounted filesystems first.

4) Yes.

5) Not really, because you usually mount only one partition at a time and thus only need to unmount one partition.
Thanks very much for the great answers, metaschima. Just one little point eludes me. The notion that only one partition is mounted. When the flash drive is mounted just one partition of it is mounted? I'm just not grasping that. And you wrote you "usually" only mount one partition at a time. Well, I'm a newbie, all I know is I'm putting a flash drive in. And one last question (I feel like "Columbo"): I just bought a flash drive that has no led light on it. (I have some that do have lights but this one doesn't.) I mean, when I click on "unmount volume" my computer tells me that the flash drive is unmounted. Just wait a few seconds after that? Thx!
 
Old 04-29-2014, 02:21 AM   #10
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by haertig View Post
My understanding (and I just made up all the facts to come to my understanding!) is that "unmount" removes OS access to the data and "eject" physically opens the door and kicks the thing out (like a CD drive opening). To eject something, the OS first unmounts it. So feel free to eject something knowing that the required unmount happens automatically.

However, to unmount something does not require it to be ejected. On things like USB thumbdrives, those aren't physically ejected, so in that case "eject" degenerates into the equivalent of "unmount". So the best the computer can do with devices like this is unmount them, even if you specified eject. YOU are the ejection step - reach in there, grab the thing, and yank it out (AFTER unmounting it, that is).
Thanks haertig. Good explanation. Esp. about things unmounted not necessarily being ejected. And thanks for the laugh about me being the ejection step. I guess the only difference I can see (besides what you guys have taught me, that is) between the two is that when I click on unmount the thumb drive icon stays on the desktop. When I click on eject it disappears.
 
Old 04-29-2014, 03:00 AM   #11
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
If the computer tells you the volume is unmounted (or the icon disappears), then it's usually safe to assume that it's finished unmounting so there's no need to wait any longer - though it might depend* on the software you happen to be using and the method it chooses to unmount.

Personally, being somewhat old-fashioned and paranoid, I often open a terminal and type
Code:
sync
to make sure - the command prompt doesn't return until all cached data have been written to disc, then I know it's safe to unmount. This is a bit of overkill though, since as others have mentioned, the unmounter will have to* sync the relevant filesystem before it can unmount it.


*There is such a thing as a lazy unmount, which essentially makes the filesystem appear to be unmounted but doesn't necessarily close all open files, so in theory you could unmount a device before everything's finished writing - but I doubt any UI designer would be daft enough to use that method, especially for a removable device.

Last edited by Pastychomper; 04-29-2014 at 06:12 AM.
 
1 members found this post helpful.
Old 04-29-2014, 10:54 AM   #12
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Gregg Bell View Post
Thanks very much for the great answers, metaschima. Just one little point eludes me. The notion that only one partition is mounted. When the flash drive is mounted just one partition of it is mounted? I'm just not grasping that. And you wrote you "usually" only mount one partition at a time. Well, I'm a newbie, all I know is I'm putting a flash drive in. And one last question (I feel like "Columbo"): I just bought a flash drive that has no led light on it. (I have some that do have lights but this one doesn't.) I mean, when I click on "unmount volume" my computer tells me that the flash drive is unmounted. Just wait a few seconds after that? Thx!
Well, you can check how many partitions are mounted automatically. Another question would be if clicking "unmount" is unmounting only one partition. As this is part of the GUI it is probably unmounting all partitions on that device. I can't know for sure, but you could experiment and see.

If it tells you that "the drive is unmounted" then it is safe to remove the device, and it likely also implies that it has unmounted all partitions on the device.
 
1 members found this post helpful.
Old 04-29-2014, 07:38 PM   #13
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Pastychomper View Post
If the computer tells you the volume is unmounted (or the icon disappears), then it's usually safe to assume that it's finished unmounting so there's no need to wait any longer - though it might depend* on the software you happen to be using and the method it chooses to unmount.

Personally, being somewhat old-fashioned and paranoid, I often open a terminal and type
Code:
sync
to make sure - the command prompt doesn't return until all cached data have been written to disc, then I know it's safe to unmount. This is a bit of overkill though, since as others have mentioned, the unmounter will have to* sync the relevant filesystem before it can unmount it.


*There is such a thing as a lazy unmount, which essentially makes the filesystem appear to be unmounted but doesn't necessarily close all open files, so in theory you could unmount a device before everything's finished writing - but I doubt any UI designer would be daft enough to use that method, especially for a removable device.
Thanks pastychomper. I think I'm borderline paranoid about this stuff too. Your typing "sync" in the terminal may come in handy, especially since I've got a flash drive without an LED light. Appreciate the feedback.
 
Old 04-29-2014, 07:42 PM   #14
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by metaschima View Post
Well, you can check how many partitions are mounted automatically. Another question would be if clicking "unmount" is unmounting only one partition. As this is part of the GUI it is probably unmounting all partitions on that device. I can't know for sure, but you could experiment and see.

If it tells you that "the drive is unmounted" then it is safe to remove the device, and it likely also implies that it has unmounted all partitions on the device.
Thanks metaschima. Yeah, I'm not that technical (re: partitions). Kind of like, if the darn flash drive works, I'm satisfied. And now I know if the computer says it's unmounted, it's unmounted. Don't make myself crazy worrying about stuff I shouldn't be worrying about. Thanks for all the help.
 
Old 04-30-2014, 10:09 AM   #15
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
Quote:
Originally Posted by metaschima View Post
5) Not really, because you usually mount only one partition at a time and thus only need to unmount one partition.
Not really, if you have more partitions probably they all will be mounted automativally (not only the one you need). Therefore you need to unmount all of them - to be on the safe side.
 
  


Reply

Tags
eject, flash drive, unmount


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing "mute" from 0-volume to "tiny" volume SaintDanBert Linux - Software 3 03-15-2013 05:20 AM
BASH:find out if volume "foo"/folder "goo" can be written to SilversleevesX Programming 2 08-28-2010 10:03 AM
"volume control GStreamer plugins and/or device not found"-how do I get volume contro fishurmn Linux - Newbie 6 07-19-2010 10:55 PM
trouble using wine + 2-cd sets "cannot eject volume" beeblequix Linux - Software 4 11-02-2007 09:16 AM
"unable to eject" error when trying to safely remove ipod shuffle in slack 12 mattydee Slackware 10 07-06-2007 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration