0

The problem

I've got a simple question: what's the difference between ejecting flash drive using GNOME Files (formerly known as Nautilus) button (see image below) and umount command?

Screenshot of the Nautilus manager after inserting flash drive with marked eject button

Before you will read rest of this question I encourage you to think if you expect any difference between results of clicking eject button in GNOME Files and typing umount command? If yes, then what's the difference? If no, then read on...


1st try: GNOME Files eject

When I insert my flash drive to my computer's USB socket, Debian automatically mounts it, which is reflected both in GNOME Files:

Screenshot of the Nautilus manager after inserting flash drive

and command line using e.g. df command:

me@host:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
(...)
/dev/sdf1       3,6G  3,6G     0 100% /media/me/Debian 9.1.0 amd64 1

or blkid command:

root@host:~# blkid
(...)
/dev/sdf1: UUID="XXXX-XX-XX-XX-XX-XX-XX" LABEL="Debian 9.1.0 amd64 1" TYPE="iso9660" PTUUID="XXXXXXXX" PTTYPE="dos" PARTUUID="XXXXXXXX-XX"
/dev/sdf2: SEC_TYPE="msdos" UUID="XXXX-XXXX" TYPE="vfat" PARTUUID="XXXXXXXX-XX"

When I click eject button marked with a red circle:

Screenshot of the Nautilus manager after inserting flash drive with marked eject button

and I run those commands once again, there is no sdf string in commands' output (which is probably what I should expect after ejecting /dev/sdf1):

root@host:~# df -h | grep sdf
root@host:~# df -ah | grep sdf
root@host:~#

Note that I added -a (--all) flag to df command and I got the same (empty) result.

root@host:~# blkid | grep sdf
root@host:~#

Note that now I'm unable to remount /dev/sdf1 without reinserting my flash drive:

root@host:~# mkdir -p /mnt/test
root@host:~# mount /dev/sdf1 /mnt/test
mount: special device /dev/sdf1 does not exist

2nd try: umount command

Now repeat the hole procedure with only changing the way I unmount my flash drive. Instead of clicking eject button, I type:

umount /dev/sdf1

Here is the result of df:

root@host:~# df -h | grep sdf
root@host:~# df -ah | grep sdf
root@host:~#

df result is probably as expected because it's the same as above... but here comes the blkid:

root@host:~# blkid | grep sdf
/dev/sdf1: UUID="XXXX-XX-XX-XX-XX-XX-XX" LABEL="Debian 9.1.0 amd64 1" TYPE="iso9660" PTUUID="XXXXXXXX" PTTYPE="dos" PARTUUID="XXXXXXXX-XX"
/dev/sdf2: SEC_TYPE="msdos" UUID="XXXX-XXXX" TYPE="vfat" PARTUUID="XXXXXXXX-XX"

Note that remounting works fine in opposite to the previous try:

root@host:~# df -h | grep sdf
root@host:~# mkdir -p /mnt/test
root@host:~# ls /mnt/test | wc -l
0
root@host:~# mount /dev/sdf1 /mnt/test
mount: /dev/sdf1 is write-protected, mounting read-only
root@host:~# ls /mnt/test | wc -l
24

The question

Why is that?

What is the precise, underlying reason of above differences in blkid output? Does GNOME Files do something more than umount command? It seems to me that GNOME File eject button is kind of 'permanent' unmount. Why?

patryk.beza
  • 1,179

0 Answers0