External hard drive freezes system

Forum rules
Before you post please read this
Post Reply
ParaDice
Level 1
Level 1
Posts: 36
Joined: Sat Aug 27, 2016 6:38 am

External hard drive freezes system

Post by ParaDice » Tue Jul 31, 2018 2:48 pm

Hey everyone,

I have an external hard drive (with NTFS as the file system) which will freeze my Linux Mint 18.3 system upon being plugged in and auto-mounted by the OS. More precisely: what freezes must be Cinnamon, because the mouse pointer can still be moved and TTY is still available, so not everything is lost.

I can access the drive through TTY, i.e. I can cd into it and ls its directories and files, which to me means it is mounted correctly and readable. I have also checked it on a Windows machine where it works flawlessly. To me this indicates that there is no hardware fault at play here.

If it's any help, I can see the dreaded "/usr/lib/gfvs/gvfsd-trash --spawner" process gulping up considerable amounts of CPU power once I plug in the drive. This process has already given me some pain on a different occasion and may also be the root of all evil here.

I have come across this problem before with a different drive, same manufacturer, similar model, same FS (NTFS). Back then I just re-formatted the drive to EXFAT and I've been using it without problem ever since. This time, however, just killing the drive and re-formatting is not an option.

I would appreciate it if you could help me diagnose what the problem is and get this darn HDD up to speed again. ;)

Best wishes,
ParaDice.
Desktop: Linux Mint 19 (Cinnamon x64) , Intel Core i5-4670 / GeForce GTX 660
Notebook: Linux Mint 18.3 (Cinnamon x64), Lenovo E470 (Intel Core i3-7100U / Intel HD Graphics 620)

User avatar
catweazel
Level 17
Level 17
Posts: 7761
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: External hard drive freezes system

Post by catweazel » Tue Jul 31, 2018 8:07 pm

ParaDice wrote:
Tue Jul 31, 2018 2:48 pm
I can access the drive through TTY, i.e. I can cd into it and ls its directories and files, which to me means it is mounted correctly and readable. I have also checked it on a Windows machine where it works flawlessly. To me this indicates that there is no hardware fault at play here.
Hi, @ParaDice

Before deciding if the problem is related to your earlier issue with gvfs trash, I think we need to eliminate other causes first because this appears to be a different HDD, hence there is no guarantee that it's the same problem.

There are two main possible causes that I see we might look at. The first is that the drive has a corrupt file system, and the second is that the drive may have been left in a dirty state. If either of those two are actually the problem then you run the risk of being exposed to potential data loss, in which case, you should backup your treasured stuff and prepare for "...killing the drive and re-formatting is not an option" being your only option. However before we get drastic:

To fix the dirty state, you can start the Windwoes OS, insert the drive, then turn off fast startup in Windwoes (for Windwoes 10) and shut it down properly, or, at risk of losing any unsaved data you can delete the hibernation file, if there is one:

sudo ntfs-3g -o remove_hiberfile /dev/sdXn /path/to/mount/point

Where sdXn is the device and partition number of the NTFS formatted drive, for example /dev/sdc1.

Also see: http://manpages.ubuntu.com/manpages/tru ... ogs.8.html
In particular: http://manpages.ubuntu.com/manpages/tru ... fix.8.html

Cheers.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

ParaDice
Level 1
Level 1
Posts: 36
Joined: Sat Aug 27, 2016 6:38 am

Re: External hard drive freezes system

Post by ParaDice » Wed Aug 01, 2018 6:27 am

Hello catweazel, and thank you for your input! :)

I have done what you said, as far as it was possible.

The MS-infested machine was a Windows 7, which to my knowledge doesn't have any fast startup capabilities.

I did also try to get rid of any old hibernation files, but I don't think there were any. (To my knowledge, hibernation files are only written to the system drive, not to external HDDs like the one in question.)

Since Cinnamon froze again, I tried other things, e.g. chkdsk, but without any results.

Finally, I saw that I had forgotten to look for the hidden .Trash-0 folder, which had been the cause of my first problem with gvfs. It was some 8GB in size. So I took the liberty of backing it up and deleting it (it's not my own HDD). Now the disk will mount properly without freezing Cinnamon.

I'm sorry I didn't think of that earlier, but maybe this thread may serve to shed some light on what causes the problem. What is it with gvfs and the .Trash-0 folder? How can it be that a simple core functionality such as the system trash can freeze the whole system? In my opinion, this undermines the whole purpose of this age-old feature. :roll:
Desktop: Linux Mint 19 (Cinnamon x64) , Intel Core i5-4670 / GeForce GTX 660
Notebook: Linux Mint 18.3 (Cinnamon x64), Lenovo E470 (Intel Core i3-7100U / Intel HD Graphics 620)

Post Reply

Return to “Mounting Partitions”