External hard drive freezes system

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ParaDice
Level 4
Level 4
Posts: 210
Joined: Sat Aug 27, 2016 6:38 am
Location: Germany

External hard drive freezes system

Post by ParaDice »

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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
To get help, always post your system configuration. Open a terminal (Ctrl + Alt + T), type the following command and copy its output: inxi -Fxxxrz. To preserve formatting, please make sure to post it inside [ code] [/ code] blocks.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: External hard drive freezes system

Post by catweazel »

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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
ParaDice
Level 4
Level 4
Posts: 210
Joined: Sat Aug 27, 2016 6:38 am
Location: Germany

Re: External hard drive freezes system

Post by ParaDice »

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:
To get help, always post your system configuration. Open a terminal (Ctrl + Alt + T), type the following command and copy its output: inxi -Fxxxrz. To preserve formatting, please make sure to post it inside [ code] [/ code] blocks.
Locked

Return to “Storage”