You are not logged in.

#1 2015-08-15 17:04:56

Stamper
Member
Registered: 2015-08-08
Posts: 10

[SOLVED] Problems regarding writing and unmounting NTFS usb...

Hi everyone!

EDIT1: I am having the same problems with an USB 2 stick that is NTFS formatted. Will continue to debug
EDIT2: I found out that it isn't actually a bug/problem. It is intended working. See replies at the bottom of the page

I have been having some issues regarding writing to an NTFS formatted USB 3.0 stick and than unmounting it. To partition the stick, I used GParted with an MBR partition table. If I try to eject/unmount directly after the partitioning, it works fine and the usb stick seems happy. However, if I first write to the usb stick and wait for that to finish, the unmount/ejecting process hangs. I tried using the umount/eject from Thunar (I use XFCE as a desktop) which displays the spinner and just hangs. I also tried manually umounting it from a terminal but the process never ends. No errors, just silence. If I remove the usb stick, it is in an unusable state and no computer can read from it anymore and I need to repartition it.

If I run umount from another terminal (while the original one hangs), I get an error saying it is not mounted. I have tried killing the umount and mount.ntfs process. The first time this released the drive back and I could mount it again. The second time it took 10-20 minutes before it released it again. After the (forced) release, the write seems to have succeeded and the drive is still usable.

If I try an fuser -mv on the mounted spot after a (forced) release (/run/media/<user>/<gibberish representing the mounted drive>), it says that there are quite a few users on that spot even though they have nothing to do there but I don't think that is the problem as the problem only arises after I write to the usb stick myself.

fdisk -mv:

USER    PID       ACCESS     COMMAND
root      kernel  mount         /run
root      1          F....             systemd
root      184      F...M           systemd-journal
root      218      F....             systemd-udevd
mysql   351      F....             mysqld
root      355      f....              systemd-logind
dbus     356     F....              dbus-daemon
root      520     F....              dhcpd
root      534     F....              php-fpm
root      551     F....              lightdm
php-fpm 555   F....              php-fpm
php-fpm 556   F....              php-fpm
sebastiaan 634 F....            xfce4-power-man

I installed ntfs-3g and ntfstools.

Anyone any clue as to what is going on? Thank you guys very much in advance!!

Stamper

P.S. I am a newb user. This is my first Arch install and I have been installing services like crazy the last few days. It might be I configured some of them poorly and they are interfering (might not be as logical as I installed postfix, nginx, gitlab, php-fpm, openssh, phpmyadmin and mariadb which have nothing to do with removable devices).

Last edited by Stamper (2015-08-16 14:07:15)

Offline

#2 2015-08-15 17:08:07

DarkCerberus
Banned
From: Holsworthy, Devon
Registered: 2011-12-31
Posts: 252

Re: [SOLVED] Problems regarding writing and unmounting NTFS usb...

Stamper wrote:

Hi everyone!

I have been having some issues regarding writing to an NTFS formatted USB 3.0 stick and than unmounting it. To partition the stick, I used GParted with an MBR partition table. If I try to eject/unmount directly after the partitioning, it works fine and the usb stick seems happy. However, if I first write to the usb stick and wait for that to finish, the unmount/ejecting process hangs. I tried using the umount/eject from Thunar (I use XFCE as a desktop) which displays the spinner and just hangs. I also tried manually umounting it from a terminal but the process never ends. No errors, just silence. If I remove the usb stick, it is in an unusable state and no computer can read from it anymore and I need to repartition it.

If I run umount from another terminal (while the original one hangs), I get an error saying it is not mounted. I have tried killing the umount and mount.ntfs process. The first time this released the drive back and I could mount it again. The second time it took 10-20 minutes before it released it again. After the (forced) release, the write seems to have succeeded and the drive is still usable.

If I try an fuser -mv on the mounted spot after a (forced) release (/run/media/<user>/<gibberish representing the mounted drive>), it says that there are quite a few users on that spot even though they have nothing to do there but I don't think that is the problem as the problem only arises after I write to the usb stick myself.

fdisk -mv:

USER    PID       ACCESS     COMMAND
root      kernel  mount         /run
root      1          F....             systemd
root      184      F...M           systemd-journal
root      218      F....             systemd-udevd
mysql   351      F....             mysqld
root      355      f....              systemd-logind
dbus     356     F....              dbus-daemon
root      520     F....              dhcpd
root      534     F....              php-fpm
root      551     F....              lightdm
php-fpm 555   F....              php-fpm
php-fpm 556   F....              php-fpm
sebastiaan 634 F....            xfce4-power-man

I installed ntfs-3g and ntfstools.

Anyone any clue as to what is going on? Thank you guys very much in advance!!

Stamper

P.S. I am a newb user. This is my first Arch install and I have been installing services like crazy the last few days. It might be I configured some of them poorly and they are interfering (might not be as logical as I installed postfix, nginx, gitlab, php-fpm, openssh, phpmyadmin and mariadb which have nothing to do with removable devices).

Linux cannot run in NTFS mode this is a Windows thingy - a USB drive must be in FAT32 and also you cannot install linux kernel in a ntfs partition see the Linux not windows article http://linux.oneandoneis2.org/LNW.htm  and also https://wiki.archlinux.org/index.php/Beginners'_guide on the archlinux wiki....

Last edited by DarkCerberus (2015-08-15 17:08:47)


Our enemies are your enemies, Nick. Disorder, war. It's just a matter of time before a dirty bomb goes off in Moscow, or an EMP fries Chicago.  ---  Alexander Pierce, Captain America: Winter Soldier
Access Denied! De-cryption failed, override denied all files sealed! --- Triskelion, Shield OS
-----
How to ask questions the smart way

Offline

#3 2015-08-15 17:17:52

Stamper
Member
Registered: 2015-08-08
Posts: 10

Re: [SOLVED] Problems regarding writing and unmounting NTFS usb...

DarkCerberus wrote:

Linux cannot run in NTFS mode this is a Windows thingy - a USB drive must be in FAT32 and also you cannot install linux kernel in a ntfs partition see the Linux not windows article http://linux.oneandoneis2.org/LNW.htm  and also https://wiki.archlinux.org/index.php/Beginners'_guide on the archlinux wiki....

I think you may have misunderstood me. I am writing arbitrary files to the USB stick. I already installed Arch. I am writing to the USB stick FROM an Arch installation which I am having problems with. Shouldn't it be possible to just write and read "normal" files to an NTFS usb stick from an Arch installation?

Offline

#4 2015-08-16 11:40:47

Stamper
Member
Registered: 2015-08-08
Posts: 10

Re: [SOLVED] Problems regarding writing and unmounting NTFS usb...

For everyone struggling with the same problems:

It turns out, it is a syncing issue. Everything is working as intended, only the transfer is really really slow. The copying process only shows the writes to the cache and the reason the unmounting takes so long is because the writes are still being written to the cache. If you do sync /run/media/<gibberish for usb stick> it will tell you when the cache is completely written to the usb stick. Unmounting after the sync has finished, is instantanous.

TL;DR It looks like the copying is done, but it isn't. There are still writes happening from the cache.

Offline

#5 2015-08-16 13:08:58

oliver
Member
Registered: 2007-12-12
Posts: 448

Re: [SOLVED] Problems regarding writing and unmounting NTFS usb...

Stamper wrote:

If you do sync /run/media/<gibberish for usb stick> it will tell you when the cache is completely written to the usb stick.

You can also tell it not to copy asynchronously with (I think) the 'flush' option when you mount - but that may be an old method.  You won't get your prompt back until the copy is complete

Offline

#6 2015-08-16 14:05:12

Stamper
Member
Registered: 2015-08-08
Posts: 10

Re: [SOLVED] Problems regarding writing and unmounting NTFS usb...

oliver wrote:

You can also tell it not to copy asynchronously with (I think) the 'flush' option when you mount - but that may be an old method.  You won't get your prompt back until the copy is complete

Thanks! I have been testing a lot today and I came across the sync/async mounting option. This doesn't change a lot in my case. As far as I can tell, my drives are being automounted with the async option (a lot faster than sync, so I prefer this default setting).

I tried it with a few different drives and I can now say with confidence that it is a fluke due to the nature of writecaching and the very very slow writing of small files to usb sticks.

The case for which I opened the thread is writing a lot(about 900) smaller files to my usb drive. A few very big ones but most of them were only a few kb. What happened is that the entire test was small enough to be swallowed up by the writecache reporting to the graphical copying dialog that the copy was complete. However, as they were cached, they were still being written to the usb device (and the unmounting took very long as it was waiting on this write). This however takes a long time because the usb drive is just very slow. I have been testing with an external USB 3.0 hdd and I get consistent results on Fedora, Windows 10 and Arch linux even if it is formatted as NTFS.

So no bugs or problems, just a misunderstanding on my part.

Offline

Board footer

Powered by FluxBB