# [SOLVED] How to unmount ntfs file system, (or usb)



## mikethe1wheelnut (Jul 3, 2021)

I'm still trying (or trying again) to commit the heinous act of removing my data from my computer via the usb-port. Either to usb, or to an external hard-drive.  Posting this as a separate question because I'm fine with doing it as root.  Maybe it should still be part of my previous question..

here are the drives attached to the computer:


```
root@ozzie:~ # gpart show
=>       63  250069617  ada0  MBR  (119G)
         63          1        - free -  (512B)
         64  249561088     1  freebsd  [active]  (119G)
  249561152     508528        - free -  (248M)

=>        0  249561088  ada0s1  BSD  (119G)
          0  241172480       1  freebsd-ufs  (115G)
  241172480    8388608       2  freebsd-swap  (4.0G)

=>        63  1953525104  da0  MBR  (932G)
          63        1985       - free -  (993K)
        2048  1953519616    1  ntfs  (932G)
  1953521664        3503       - free -  (1.7M)

=>      63  30322625  da1  MBR  (14G)
        63      8001       - free -  (3.9M)
      8064  30314624    1  fat32lba  (14G)
```
I've looked at the information here and here and here, (these last two are somewhat redundant), and I still can't unmount via gui. it doesn't say anything about rebooting, rather, it goes into length about how I have to do something else if I don't want to have to do all that all over again when I re-boot. Strictly speaking though, most of that is for mounting, not unmounting. I'm not actually sure if these drives are mounted or not, so I'm trying to be systematic.. I know that if I unplug my drive without unmounting/ejecting it, when I plug it into another computer, the data I tried to write to it isn't there. I've tried some of the proposed solutions here, but there is no claim even there that they should work (they work for one person..)


----------



## mark_j (Jul 3, 2021)

Well I don't have time to read endless threads in search of the question, so I will ask it:

What is your problem and what have you tried so far?


----------



## mikethe1wheelnut (Jul 3, 2021)

mark_j said:


> Well I don't have time to read endless threads in search of the question, so I will ask it:
> 
> What is your problem and what have you tried so far?


At the shallowest level, this is my problem:




There was a popup previously tracking the progress of the save, which went away, so I assumed all the data was written.

To make sure I have permission to eject/unmount, I went into /etc/devfs.conf, as per this link, and added:

own /dev/da0 root: operator
perm /dev/da00 0666

to it, then typing:

# pw groupmod operator -m yourusername

..I'll add more things I've done in another reply..


----------



## mikethe1wheelnut (Jul 3, 2021)

I have also used this command:


> *    sysctl vfs.usermount=1*


Following this site.


----------



## mark_j (Jul 3, 2021)

Is there anything in */var/log/messages *about this?

Ensure when you modify your username's account you log out and log back in again.

Is the seagate device you're trying to unmount actually mounted as a file system? Does `df` show you it mounted?

(Apologies, I don't use a GUI so I don't know what the file manager is or what it's doing when displaying it as it does. )


----------



## mikethe1wheelnut (Jul 3, 2021)

I can "formally" recognize the attached device:  (instructions here)


> root@ozzie:/etc # ls -l /dev/da0*
> crw-r-----  1 root  operator  0x82 Jul  2 19:29 /dev/da0
> crw-r-----  1 root  operator  0x83 Jul  2 19:29 /dev/da0s1


and mount it (apparently) with:


> root@ozzie:/etc # ntfs-3g /dev/da0s1 /mnt
> root@ozzie:/etc #


I then went on to research as to how to unmount it, and you could say that's where I am now.  I found things, but documentation will take longer..


----------



## mikethe1wheelnut (Jul 3, 2021)

mark_j said:


> Is there anything in */var/log/messages *about this?
> 
> Ensure when you modify your username's account you log out and log back in again.
> 
> ...


/var/log/messages ... perhaps you can spot easier than I can anything important in there..  I'll answer your other questions, then get back to that..


> Jul  2 19:30:50 ozzie ntfs-3g[1143]: Cmdline options:
> Jul  2 19:30:50 ozzie ntfs-3g[1143]: Mount options: allow_other,nonempty,relatime,fsname=/dev/da0s1
> Jul  2 19:30:50 ozzie ntfs-3g[1143]: Ownership and permissions disabled, configuration type 1
> Jul  2 19:31:16 ozzie ntfs-3g[1143]: ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 4096   usa_ofs: 0  usa_count: 0: Invalid
> ...


and, yes, apparently it -is- mounted:


> root@ozzie:/var/log # df
> Filesystem   1K-blocks      Used     Avail Capacity  Mounted on
> /dev/ada0s1a 116781948  74459556  32979840    69%    /
> devfs                1         1         0   100%    /dev
> ...


----------



## mark_j (Jul 3, 2021)

mikethe1wheelnut said:


> I can "formally" recognize the attached device:  (instructions here)
> 
> 
> 
> ...



Have you simply tried `umount /mnt` ?


----------



## mark_j (Jul 3, 2021)

The mount option of allow_other implies (according to the manual page) that it only accepts this if you mount as root. You can override by, to quote the man page, "_but this restriction can be overridden by the 'user_allow_other' option in the /etc/fuse.conf file._"
1. Are you mounting as root or as a non-root user?
2. In the entry in the log there is:


> Jul  2 20:17:24 ozzie ntfs-3g[1239]: Mount options: allow_other,nonempty,relatime,fsname=/dev/da0s1


Is that process still around, if so, can you show it? eg `ps -ux 1239`

3. Can you `umount` it while root?


----------



## mikethe1wheelnut (Jul 3, 2021)

mark_j said:


> The mount option of allow_other implies (according to the manual page) that it only accepts this if you mount as root. You can override by, to quote the man page, "_but this restriction can be overridden by the 'user_allow_other' option in the /etc/fuse.conf file._"
> 1. Are you mounting as root or as a non-root user?
> 2. In the entry in the log there is:
> 
> ...


from what I understand, from these lines of my previous post:


> root@ozzie:/etc # ntfs-3g /dev/da0s1 /mnt
> root@ozzie:/etc #


the "#" symbols imply that the associated command is performed as root..  I'll check the log soon, and get back to you with the results of your other questions..


----------



## Geezer (Jul 3, 2021)

You cannot unmount while the filesystem is still in use.

Looks like you are using xfce and thunar, so best thing is to close all instances of thunar or any other file manager. Better still get out of the DE and back to a command prompt.

Then you can use `umount`.


----------



## mikethe1wheelnut (Jul 3, 2021)

mark_j said:


> Have you simply tried `umount /mnt` ?





> root@ozzie:/var/log # umount /media/Seagate_Expansion_NAATTNKZ_s1
> root@ozzie:/var/log # df
> Filesystem   1K-blocks     Used    Avail Capacity  Mounted on
> /dev/ada0s1a 116781948 74496516 32942880    69%    /
> devfs                1        1        0   100%    /dev


success!  (The key was figurring out -what- to unmount!)
thanks!! I've now checked that all my data got written, and my program works on the other computer!


----------



## mikethe1wheelnut (Jul 3, 2021)

Geezer said:


> You cannot unmount while the filesystem is still in use.
> 
> Looks like you are using xfce and thunar, so best thing is to close all instances of thunar or any other file manager. Better still get out of the DE and back to a command prompt.
> 
> Then you can use `umount`.


..may the command-prompt and the gui never meet..  hehe..  for now, solution found!


----------



## grahamperrin@ (Jul 10, 2021)

Geezer said:


> … cannot unmount while the filesystem is still in use …



In my case (not NTFS) I typically run: 
`procstat -fa | grep t500`

– where _t500_ is a unique string within a mount point. The offending process is nearly always `gvfsd-trash`, which I choose to kill (although it's not recommended).


----------



## Deleted member 30996 (Jul 10, 2021)

I do it one way and one way only. You just have to make sure any files opened on the USB drive are closed, no need to close the FM. I don't use NTFS but the second set is for larger drives using FAT32. Only root can mount or unmount, the usr can read but not write


```
mount -v -t msdosfs /dev/da0s1 /media/da0s1

umount -v -t msdosfs /dev/da0s1 /media/da0s1


mount -v -t msdosfs -F32 -o large /dev/da0s1 /media/da0s1

umount -v -t msdosfs -F32 /dev/da0s1 /media/da0s1
```


----------

