Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-31-2019, 02:00 AM
|
#1
|
Member
Registered: Oct 2009
Distribution: Scientific Linux 6
Posts: 193
Rep:
|
rm command fails w/ "Input/output error", how to fix?
Hello,
I've got an annoying problem where my external hard drive accidentally disconnected as I was copying files to it (the drive is NTFS format so that my Windows machines can also read/write to it). My system is Manjaro Linux with kernel 4.19.
After reconnecting the drive, I wanted to delete those files and start from scratch. However, after running `rm -rf` on the directory in question, it threw several errors on some files in that directory. They look like this:
Code:
rm: cannot remove '[path to file on external hard drive]': Input/output error
This is annoying. Is there a way to fix this without having to re-format the entire partition? Thank you very much!
|
|
|
05-31-2019, 03:42 AM
|
#2
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,533
|
Quote:
Originally Posted by penyuan
my external hard drive accidentally disconnected as I was copying files to it (the drive is NTFS format
|
When this happens, the target filesystem involved must be checked. ntfsfix can fix some NTFS errors using Linux, but more likely you'll need to have Windows do the check. You could try ntfsfix first, but if it was mine I'd go directly to Windows.
|
|
1 members found this post helpful.
|
05-31-2019, 04:38 AM
|
#3
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
^ I agree, use windows tool to fix NTFS problems!
besides...
Quote:
Originally Posted by penyuan
I've got an annoying problem where my external hard drive accidentally disconnected as I was copying files to it
|
this should not happen at all!
is there a problem with the cable connection?
has it happened more than once?
you must fix this.
PS:
native linux filesystems are much more robust with these problems!
|
|
1 members found this post helpful.
|
05-31-2019, 08:04 AM
|
#4
|
Member
Registered: May 2019
Location: /home/
Distribution: Arch Linux
Posts: 166
Rep:
|
Could read/write permissions have a hand in this?
|
|
|
05-31-2019, 09:14 AM
|
#5
|
Senior Member
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674
|
Quote:
Originally Posted by Contrapak
Could read/write permissions have a hand in this?
|
No, then you would get a "Permission denied" error, not an "Input/Output" one.
The latter mostly is an hardware (connection TO or bad spots ON the disk) error
but in this case could possibly be a file system one.
I join previous respondants as to run a chkdsk on this ntfs volume from Windows,
it knows better what could be wrong with that fs.
|
|
1 members found this post helpful.
|
05-31-2019, 09:20 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,356
|
If that was an ntfs filesystem I recommend you to try to repair it from windows. Also you may try to save/backup your important data (in read-only mode) before fixing it.
|
|
1 members found this post helpful.
|
05-31-2019, 10:51 AM
|
#7
|
Senior Member
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
|
I agree with the others; check an NTFS filesystem from Windows, not Linux.
I also agree with ehartman; an "Input/Output" error likely means there is something wrong with the hardware. You should check the hardware itself, post the output of the following command if you're not sure;
Code:
smartctl -a /dev/sdX
Replace "sdX" with the correct device node for the drive in question.
|
|
1 members found this post helpful.
|
06-01-2019, 12:17 AM
|
#8
|
Member
Registered: Oct 2009
Distribution: Scientific Linux 6
Posts: 193
Original Poster
Rep:
|
Thank you everyone! Very informative tips, here's what I've found so far:
1. Running `smartctl -a /dev/sdb` (the drive shows up at `/dev/sdb`) gives me this error (!):
Quote:
Read Device Identity failed: scsi error unsupported field in scsi command
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
|
Using the `-T permissive` argument failed to give me any more information... It just gave me this:
Quote:
=== START OF INFORMATION SECTION ===
Device Model: [No Information Found]
Serial Number: [No Information Found]
Firmware Version: [No Information Found]
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: [No Information Found]
Local Time is: Sat Jun 1 12:58:38 2019 CST
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
|
2. I plugged the drive into a Windows computer, and chkdsk found and repaired issues (without being specific on what the issues were...).
3. I was able to read/write/delete the problematic files in question.
4. I believe the sudden disconnect I experienced was due to a very flimsy USB 3 "micro B" connector on the hard drive enclosure of my Seagate external hard drive. A slight movement would essentially eject it! Are there USB 3+ external hard drives with more robust connectors????
So, here are a couple follow up questions:
a. @ondoho mentioned that Linux filesystems are more robust. Which specifically? Or are they all generally better? My goal is for this external hard drive to be read/writable from Windows systems, too. Is there an option that is better than NTFS??? (I didn't use FAT32 because it doesn't support large files)
b. smartctl couldn't access my external hard drive, is that a very bad sign???
Thank you for your help!
Last edited by penyuan; 06-01-2019 at 12:21 AM.
Reason: Added question to point 4.
|
|
|
06-01-2019, 12:30 AM
|
#9
|
LQ Addict
Registered: Dec 2013
Posts: 19,872
|
Quote:
Originally Posted by penyuan
4. I believe the sudden disconnect I experienced was due to a very flimsy USB 3 "micro B" connector on the hard drive enclosure of my Seagate external hard drive. A slight movement would essentially eject it!
|
i suspected as much.
Quote:
Are there USB 3+ external hard drives with more robust connectors????
|
probably yes.
Quote:
@ondoho mentioned that Linux filesystems are more robust. Which specifically?
|
I can say from experience that I had many unclean shutdowns with ext3 and ext4 systems and work just continued after a reboot.
Quote:
My goal is for this external hard drive to be read/writable from Windows systems, too.
|
unfortunately my expertise ends there.
Quote:
smartctl couldn't access my external hard drive, is that a very bad sign???
|
can happen with usb drives.
you could try to take the drive out of the enclosure and directly connect it to the motherboard.
|
|
1 members found this post helpful.
|
06-01-2019, 05:54 AM
|
#10
|
Senior Member
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
|
Quote:
Originally Posted by penyuan
...My goal is for this external hard drive to be read/writable from Windows systems, too. Is there an option that is better than NTFS??? (I didn't use FAT32 because it doesn't support large files)
...
|
You have a couple of options;
1) Use a filesystem that both Windows and Linux have support for, such as FAT32 (but as you say, it will be limited to files no more than 4GiB in size), or keep using NTFS, but you will need to have the ntfs-3g drivers installed on Linux - not all Linux distributions have the ntfs-3g drivers installed by default. Just install the ntfs-3g package in that case.
2) Install a file system driver for a Linux based file system on Windows.
|
|
1 members found this post helpful.
|
06-01-2019, 06:17 AM
|
#11
|
Member
Registered: Oct 2009
Distribution: Scientific Linux 6
Posts: 193
Original Poster
Rep:
|
Understood, thanks again! Good to know that the smartctl failure is not necessarily a bad sign, though I should find a better external drive next time. Will mark thread as solved for now.
|
|
|
All times are GMT -5. The time now is 06:18 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|