[SOLVED] portable USB drive problem - can't rename or delete files
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
Thanks, everyone! Just to re-iterate: I copied data to this USB storage device from the Windows PC (plus some other external drives) as a back-up before wiping the PC and going to Linux. Some requested info:
sudo smartctl -a /dev/sdb1
[sudo] password for bekor:
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.15.0-34-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: Seagate
Product: Expansion
Revision: 0708
Compliance: SPC-4
User Capacity: 2,000,398,933,504 bytes [2.00 TB]
Logical block size: 512 bytes
LB provisioning type: unreported, LBPME=-1, LBPRZ=0
Logical Unit id: 0x3e413850544d3134
Serial number: NA8PTM14
Device type: disk
Local Time is: Wed Oct 10 09:37:27 2018 AEDT
SMART support is: Unavailable - device lacks SMART capability.
=== START OF READ SMART DATA SECTION ===
Error Counter logging not supported
No self-tests have been logged
Code:
~ $ dmesg | grep -i sdb1
[195507.093834] sdb: sdb1
[195561.929269] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
[372256.865816] sdb: sdb1
[372267.704697] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[490098.469048] sdb: sdb1
[490104.183119] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[689416.436411] sdb: sdb1
[1113764.719089] sdb: sdb1
[1114281.417491] sdb: sdb1
[1114577.937092] sdb: sdb1
[1117809.210458] sdb: sdb1
[1142804.720297] sdb: sdb1
[1270116.302492] sdb: sdb1
Code:
~ $ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 1.8 TiB, 2000398933504 bytes, 3907029167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x51a55499
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 3907024128 3907024065 1.8T 7 HPFS/NTFS/exFAT
bekor@Lab1 ~ $ mount | grep sdb
/dev/sdb1 on /media/bekor/Seagate Expansion Drive type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Code:
~ $ mount | grep sdb
/dev/sdb1 on /media/bekor/Seagate Expansion Drive type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
It looks like you'll need to run a filesystem check, as it looks like the filesystem may be corrupt. While you can run fsck in Linux to check it, since it's a Microsoft/Windows based filesystem, you may want to use Windows to check and try to repair it instead.
The disk appears to be in trouble. I won't define what that means, just that there are problems reading data. However, you did say that you were reading files, so some data is readable. And you have gone to a lot of trouble to get info back to the forum to get at the data.
Here's the way I would tackle this issue. I would use the KISS (Keep It Simple, Sweetheart) policy.
Firstly, I am considering that you may have used the Ext USB under the W system for multiple saving over time.
(So there could be accumulated "crap" on the Ext USB.)
Next, being a W User you may also have used a "recycle" wastebin (of sorts) on the Ext USB.
(So there could be accumulated "crap" on the Ext USB.)
Then I also wondered what you used to manage the W system "protection".
(If something like Norton (etc.) then there could be accumulated "crap" (protected) on the Ext USB.)
Further, we don't know how you "backed-up" from the W system to the Ext USB drive.
I won't go on further here, because you should be able to understand my thoughts about the Ext USB.
So...
1. Is the data critical?
You said it was "back up" so it may only be "duplicate/spare" (if you get my drift).
1.a. So, if there are files on the Ext USB - which ARE needed - then you could re-save them (safely/complete) to the current linux HD?
If "yes" then do that.
Then...
1.b. Format the Ext drive (ie clean/wipe/format/re-format) and test to see if stable.
1.c. Go to 3.
2. If the data really IS critical, and you need some "unreadable" data in particular (ie BEFORE you format), then you may have trouble.
2.a. Member ondaho can possibly help at "deep" linux level here. Perhaps jsbjsb001 can too.
2.b. The only other thing that I can think of quickly is that there used to be a Linux program by someone "Nordhal" (I think) which was able to read W drives well. It was a long time ago that I used it. There may be other better programs/ways in Linux now. (I also remember - under the W system - there were very good free programs for "data recovery". I used them many times with good success.)
2.c. Go to 3.
3. Have a cup of coffee (or other beverage).
So, to reiterate, if the data is NOT critical then don't waste time sweating it - just recover what you need (and...) - to continue to use the Ext USB drive with Linux, FORMAT.
I'll leave more complex recovery instructions to others. Please let them know what you prefer now.
[(Edit) P.S. Alternate Linux distros may have better success at reading the drive. (From experience.)]
not sure if the hardware is toast.
one thought i had: why is linux trying to see it as FAT? do you have ntfs support installed?
you should probably try some troubleshooting & checking & fixing on a windows computer.
ntfs on linux will only bring you that far.
@boombaby: trying to have the last word in a tiff with jsb "don't mangle my username" 001? good luck with that!
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by ondoho
not sure if the hardware is toast.
one thought i had: why is linux trying to see it as FAT? do you have ntfs support installed?
Really? Well I dare contend that it's seeing the drive as two different filesystems, because the filesystem is corrupted. Given this, it's all the more reason the drive is very likely (as I said in post #2) on it's way out. And therefore will be toast.
Quote:
you should probably try some troubleshooting & checking & fixing on a windows computer.
...
I'd already suggested that in post #18, which was even marked as "helpful". Please don't repeat what's already been said, it's bad form.
It looks like you'll need to run a filesystem check, as it looks like the filesystem may be corrupt. While you can run fsck in Linux to check it, since it's a Microsoft/Windows based filesystem, you may want to use Windows to check and try to repair it instead.
Make sure you unmount it first though.
Thanks a lot!
I think I will just get rid of this drive; I have also saved the files elsewhere. But it has been a good learning experience.
Two questions, if you don't mind:
1. Could this scenario have caused issues: the drive was "formatted for Windows" out of the box; I copied some files (lots) from another Windows-formatted external drive BUT using Linux PC (that is, both W-formatted drives were plugged into Linux PC, copying from one to another). Is that bad practice?
2. Could you please explain briefly, if possible, what the output of dmesg | grep -i sdb1 is showing? Is this what caused you to think that the drive is "toast"
(here it is again:
Code:
~ $ dmesg | grep -i sdb1
[195507.093834] sdb: sdb1
[195561.929269] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
[372256.865816] sdb: sdb1
[372267.704697] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[490098.469048] sdb: sdb1
[490104.183119] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[689416.436411] sdb: sdb1
[1113764.719089] sdb: sdb1
[1114281.417491] sdb: sdb1
[1114577.937092] sdb: sdb1
[1117809.210458] sdb: sdb1
[1142804.720297] sdb: sdb1
[1270116.302492] sdb: sdb1
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by byebyemrgates
Thanks a lot!
I think I will just get rid of this drive; I have also saved the files elsewhere. But it has been a good learning experience.
Two questions, if you don't mind:
1. Could this scenario have caused issues: the drive was "formatted for Windows" out of the box; I copied some files (lots) from another Windows-formatted external drive BUT using Linux PC (that is, both W-formatted drives were plugged into Linux PC, copying from one to another). Is that bad practice?
2. Could you please explain briefly, if possible, what the output of dmesg | grep -i sdb1 is showing? Is this what caused you to think that the drive is "toast"
(here it is again:
Code:
~ $ dmesg | grep -i sdb1
[195507.093834] sdb: sdb1
[195561.929269] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
[372256.865816] sdb: sdb1
[372267.704697] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[490098.469048] sdb: sdb1
[490104.183119] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[689416.436411] sdb: sdb1
[1113764.719089] sdb: sdb1
[1114281.417491] sdb: sdb1
[1114577.937092] sdb: sdb1
[1117809.210458] sdb: sdb1
[1142804.720297] sdb: sdb1
[1270116.302492] sdb: sdb1
No, I've got an external drive formatted with NTFS myself and I only have Linux (at home), so no, I wouldn't call it bad practice - just make sure you unmount it properly, that's the only thing.
Your dmesg output is showing that the system cannot read the boot sector of the drive (highlighted in bold above) and that it detected it was not unmounted properly. Yes, what I've highlighted in bold above, along with the "Input/Output error" message. It's also reporting on one hand the filesystem type is FAT32 but on the other hand, it's NTFS. Because it's almost certain (if not) that the filesystem is corrupt, then all of that put together very likely means that the drive is stuffed.
If you were only getting the "Volume was not properly unmounted. Some data may be corrupt. Please run fsck." message, then it's quite likely you could just run fsck (or check the filesystem with Windows - better option) and that would clear the filesystem error.
I would do a filesystem check on it just to be as certain as you can be though (on a Windows machine).
PS: If the system marks it as "dirty" that would mean that the system is very likely to mount it as read-only, not read-write (to prevent damaging the filesystem any further).
Last edited by jsbjsb001; 10-10-2018 at 08:21 AM.
Reason: forgot second question, clarity and additions. Removed potentially misleading statement.
At first I read ondoho in post #21 and thought, "I agree with all he said about the Ext USB drive".
Then I read jsbjsb001 in post #24 - and how he correctly interpreted the dmesg output with respect to the drive - and thought, "Maybe the drive will go caput?".
Then I thought I could become a politician.
Then I thought a bit more...
At one place I worked at, a User removed her thumb-drive (USB) from a W PC (her personal PC at home) without closing the .doc (document) she was working on. It left a locked/"corrupted" file on the thumb-drive. It was unreadable. It would have remained corrupted and unrecoverable except that she plugged the thumb-drive back into her home PC and the document was again mountable. That is my very vague recollection of it - but I am prepared to be mistaken.
If, over time, you have done things like that on the Ext USB drive (and we still haven't mentioned the "trash-bin" & Norton thing) then it could just be a corrupted file-system of sorts - and WILL become usable again after a good format.
I am NOT saying THAT is the solution, but I am saying the file system might just be "corrupted" - and the drive still usable.
For the time being I would NOT '...get rid of...' the drive as you said in post #23. (However, I am a hoarder of sorts - so nothing goes out till it's dust, usually.)
You said that the data is expendable (because you have a copy) so - if you have time to expend - then you could see if the drive is still usable and "safe".
If it is easy to get hold of a W PC then you could see if the drive is still perfectly readable there. (jsb said that in #24) If so, then there is a "compatability" issue arising. (To me, all that is not worth the trouble - BUT - it could be a learning lesson for yourself.)
Otherwise, in Linux, use a disk manager to mount the drive and totally format it. (I use GUI a lot; others would say use the CLI to do it.) That would also be a learning experience for you. In fact, it would also provide others here with a good result - and the forum with a good "Solved" outcome for others too.
Otherwise, KISS. (Keep It Simple, Sweetheart) Mount the drive, and format it immediately. Check it's all good. Use it.
Otherwise, KIRSS. (Keep It Really Simple, Sweetheart) Bin it.
Personally, I would not use W-to-W formatted drives in direct data-transfers using Linux - UNLESS I was using a distro KNOWN to be good at handling the alt filesystem. Even then, I don't like the concept.
so, op, does your system even have ntfs support installed?
while i agree that hardware corruption is likely, it's an easy check before you decide to toss it.
so, op, does your system even have ntfs support installed?
while i agree that hardware corruption is likely, it's an easy check before you decide to toss it.
I may have mentioned - I have another identical external drive that works fine - so perhaps the support is installed.
How can I check if it is installed? What is the package name? Cheers!
Thanks, everyone again!
I ran chkdsk on windows 10 and now the drive seems to work fine in Linux, I can rename, delete and move the files.
However, the output requested by ondoho still looks the same - is this a problem? (Output of all other commands requested previously remains the same)
(Maybe I should just trash the damn thing anyway, buy a new one...)
Cheers!
Code:
dmesg | grep -i sdb1
[195507.093834] sdb: sdb1
[195561.929269] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
[372256.865816] sdb: sdb1
[372267.704697] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[490098.469048] sdb: sdb1
[490104.183119] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[689416.436411] sdb: sdb1
[1113764.719089] sdb: sdb1
[1114281.417491] sdb: sdb1
[1114577.937092] sdb: sdb1
[1117809.210458] sdb: sdb1
[1142804.720297] sdb: sdb1
[1270116.302492] sdb: sdb1
[1399678.847936] sdb: sdb1
[1399840.173109] Buffer I/O error on dev sdb1, logical block 6244265, async page read
[1399840.173137] Buffer I/O error on dev sdb1, logical block 6244264, async page read
[1399988.169501] sdb: sdb1
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
As funny as it may sound (and I know it does), I've had files (when I still had Windows XP Home and Linux on my old PC some years ago now) that Windows just wouldn't read properly (or at all) because of filesystem problems, but Linux would read them properly. But, sooner or later those same file disappeared altogether (because of filesystem issues).
The bottom line is that; if you're still getting the same messages, then it's highly likely that while Windows may have fixed the filesystem, the underlying problem is still there. Also, you're likely to just have the filesystem corrupt again on you. I would not be relying on that drive anymore. You could try downloading some drive diagnostic software from the manufacturer's website and test it with that (maybe I should have thought of that before for you - sorry).
I maintain that the drive is likely stuffed/is toast or soon to be.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.