LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-06-2023, 03:37 PM   #1
danabooth
LQ Newbie
 
Registered: Dec 2022
Location: Northwest USA
Distribution: Debian
Posts: 10

Rep: Reputation: 0
mounted usb drive / shortcut problems


I have a 4T Toshiba usb drive that gets mounted on boot, with a symlink to /mnt/toshiba in my home directory.

When accessing my computer via ssh (sftp from Midnight Commander) from remote, it would hang and I'd have to dump the terminal. When I ssh from a command line, it would take me to my home directory, and I could cd to sub-directories, but I could not "ls" within my home dir; again it would hang, but I can at least ctrl-C out of it

I have found that there are two directories that will hang like this, my ~ dir, and the /mnt dir, and have decided that the usb drive is the culprit. However, I can't seem to umount the toshiba ext drive, it'll just sit there and do nothing until I ctrl-C out of it. (umount /mnt/toshiba) Any suggestions on how I can un-mount this usb drive? I won't be in a position to have physical access to the computer for several days.
 
Old 02-06-2023, 07:03 PM   #2
Grobe
Member
 
Registered: Aug 2019
Location: Close to north
Distribution: Fedora
Posts: 117

Rep: Reputation: Disabled
Um, are yu sure the usb drive actually get mounted as you think? Does it act differently if you're already logged in with same user locally?
 
Old 02-06-2023, 10:47 PM   #3
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
With Debian, after plugging in a USB drive, when you go to access it, it is automatically mounted to /media/user/DriveLabel.
If it is automatically mounted elsewhere at bootup suggests there is an entry in /etc/fstab for the USB drive.
As sudo or root, edit the /etc/fstab file and comment out the line associated with the USB drive by adding a hash "#" at the begging of the line and it will not be mounted.
It is best to create a folder in your home directory, something like "External-USB" or whatever and use that as the mount point in /etc/fstab file. This would eliminate the need for a symlink.
Many/most external USB drives go dormant (stop spinning) when not accessed within a certain amount of time. The hangs you are experiencing may be related to this feature. When trying to access it remotely, might be best to run command as sudo or root: mount -a before trying to access it or leave it unmounted and mount it before trying to access it.

Last edited by Brains; 02-06-2023 at 10:49 PM. Reason: Spelling
 
Old 02-22-2023, 01:21 PM   #4
danabooth
LQ Newbie
 
Registered: Dec 2022
Location: Northwest USA
Distribution: Debian
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Brains View Post
With Debian, after plugging in a USB drive, when you go to access it, it is automatically mounted to /media/user/DriveLabel.
If it is automatically mounted elsewhere at bootup suggests there is an entry in /etc/fstab for the USB drive.
As sudo or root, edit the /etc/fstab file and comment out the line associated with the USB drive by adding a hash "#" at the begging of the line and it will not be mounted.
It is best to create a folder in your home directory, something like "External-USB" or whatever and use that as the mount point in /etc/fstab file. This would eliminate the need for a symlink.
Many/most external USB drives go dormant (stop spinning) when not accessed within a certain amount of time. The hangs you are experiencing may be related to this feature. When trying to access it remotely, might be best to run command as sudo or root: mount -a before trying to access it or leave it unmounted and mount it before trying to access it.
I put it in fstab myself, after a catastrophic HD failure under Mint, I loaded Debian on another HD, but Debian would not auto-mount it after plugging it in. (as it used to do under Mint) Mounting it using fstab in /mnt/toshiba, it has run for many months flawlessly, and did a middle of the night rsync as a cron event each night, so it would seem that the usb HD drive is failing / has failed, but it took me going to the physical location and un-plugging the thing, modifying fstab and crontab, and re-starting before I could access my home directory or /mnt.
 
  


Reply

Tags
umount, usb drive



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to differentiate a mounted usb stick vs plugged in but not mounted usb stick. andrewysk Linux - Newbie 22 04-05-2021 02:42 PM
I made a global shortcut to block an unwanted in-application shortcut newbiesforever LinuxQuestions.org Member Success Stories 0 07-22-2018 07:49 PM
[KDE]Shortcut Icons smaller, Shortcut And Tray icons on 2 lines xeross Linux - Newbie 2 04-10-2008 10:20 AM
shortcut to mounted drive woja Linux - Newbie 3 11-06-2003 02:14 AM
shortcut to mounted drive X-dazed Linux - General 3 12-04-2002 08:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration