You are not logged in.

#1 2013-09-10 00:17:58

rabcor
Banned
Registered: 2013-02-09
Posts: 500

USB Drive corrupts home folder or ext4 filesystem.

Yeah as the title says. I've tried plugging in a usb drive, that is with both FAT32 and NTFS formats.

I have dosfstools and ntfsprogs installed.

If i try to copy files or directories off of the usb flash drive, well... it seems to corrupt my ext4 filesystem somehow, For example lets say i try to copy a movie from it to the Desktop folder of my user.

The users home folder will appear to be blank (until i next reboot)

I get a repeated error (each time showing another block.

Buffer I/O error on device sda2(root drive), logical block 624616
...

then finally after trying to copy the file i get

EXT4-fs warning (device sda2): ext4_end_bio:286: I/O error writing to inode 8388624 (offset 242876416 size 393216 starting block 648737): Read-only file system
cp : failed to extend /home/user/desktop/file : Read-only file system

I'm just really surprised that this could happen, it definetly makes no sense. lets say the file is a video file, the file will actually be partially copied over to my ext4 drive and playable by mplayer2. but i can't get the whole file.

This is on a macbook 5.2 (mid 2009 laptop i think) what can i do? i know there is space on the hard drive since /dev/sda2 has 131G of free space. My next step is trying to format the usb to ext4 and see if that has any effect.

Last edited by rabcor (2013-09-10 00:19:14)

Offline

#2 2013-09-10 00:23:08

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: USB Drive corrupts home folder or ext4 filesystem.

It rather sounds like a problem with the drive and not with the source of the files.  Do you have read or write errors spamming the journal?

Offline

#3 2013-09-10 00:41:06

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

i don't think i have read or write errors spamming the journal no, but i do get a higher amount of errors in the journal than i'm used to (stretches onto the login terminal)

How should i check to make certain?

And so far i haven't noticed any other problems with the drive, everything seemed to install fine with pacstrap and pacman commands, also makepkg. If the drive was really faulty i should have noticed without the help of an external drive right?

Offline

#4 2013-09-10 00:50:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: USB Drive corrupts home folder or ext4 filesystem.

If the disk is HDD (not SSD), install smartmontools. Edit the configuration so that it monitors the disk and runs whatever tests are available. Check results. Don't be mislead by a "passed" overall health check - you need to look at the results of tests, the error log and the disk's individual attributes.

Could also be filesystem corruption? Check with fsck?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-09-10 01:05:44

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

Overall health check passed.

# smartctl -l selftest /dev/<device>

gives
(Number, Test Description, Status, Remaining, LifeTime(Hours), LBA)

# 1 Short offline    Completed: read failure    00%    5459    5073622

Is there a way for me to run fsck (on my root drive) without resorting to a livecd?

Last edited by rabcor (2013-09-10 01:06:01)

Offline

#6 2013-09-10 01:29:30

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

I ran systemrescue cd, ran fsck for /dev/sda2, it gave me back that the fs was clean, i tried to copy through system rescue cd, and it gave me the same error (the fs of the USB is ext4 now)
as in

cp: writing "filename": Read-only file system
cp: failed to extend "filename": Read-only file system

I heard that if a hard drive is damaged, it can be set to read-only mode to prevent further damage, do you think this might be happening?

Last edited by rabcor (2013-09-10 01:57:41)

Offline

#7 2013-09-10 03:09:21

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: USB Drive corrupts home folder or ext4 filesystem.

Wait… you ran smartmontools on your drive and got "Completed: read failure"?  Don't you think that might indicate a problem?


Edit: Also, which tests did you run?  Why are you only posting the output of "smartctl -l"? Did you check the other information that it gathered?  Did you read the wiki page on how to use smartctl?

Last edited by WonderWoofy (2013-09-10 03:11:50)

Offline

#8 2013-09-10 15:48:54

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

Yes i read up on the wiki page briefly on how to use it, the overall health check passed, i ran the short tests on it. then

smartctl -a gave me too much information to even read (there is no page-up button on the macbook, shame on apple.) but i decided to run it again this time in a GUI so i could scroll up and see the whole info from a long test.

here's the output of smartmonctl -a /dev/sda2 after running a long test.

Last edited by rabcor (2013-09-10 23:58:26)

Offline

#9 2013-09-10 15:55:40

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,911
Website

Re: USB Drive corrupts home folder or ext4 filesystem.

That drive has a lot of reallocated sectors and pending sectors, and although the overall health is pass worthy I'd recommend replacing it ASAP.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#10 2013-09-10 17:04:07

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: USB Drive corrupts home folder or ext4 filesystem.

cfr wrote:

Don't be mislead by a "passed" overall health check - you need to look at the results of tests, the error log and the disk's individual attributes.

rabcor wrote:

Yes i read up on the wiki page briefly on how to use it, the overall health check passed, i ran the short tests on it. then smartctl -a gave me too much information to even read (there is no page-up button on the macbook, shame on apple.)

?!?!

BTW, if I remember correctly the older Macbooks had this marked, and the PageUp and PageDn keys were Fn+up and Fn+Down, respectively.  The left and right keys combined with the Fn key are Home and End, respectively.  The reason that you ended up with "too much information to even read" is because the test resulted to so many errors.

With something like smartmontools, if you are trying to determine if your drive is on its way out, it probably would have been a good idea to have run the long test and/or the self test as well.  Going for the shortest option is also going for the option that has the highest likelihood of being unable to give you complete and reliable data.  With something like the health of your HDD, this is not something I would want to do half-assed.

Offline

#11 2013-09-10 17:38:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: USB Drive corrupts home folder or ext4 filesystem.

I have a hunch.  Is this a spinning drive?  Is it USB powered, or does it have an external power supply?

I am wondering if the drive is starving for power.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#12 2013-09-10 22:46:14

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: USB Drive corrupts home folder or ext4 filesystem.

ewaller wrote:

I have a hunch.  Is this a spinning drive?  Is it USB powered, or does it have an external power supply?

I am wondering if the drive is starving for power.

I was having exactly the same thought, I've had that happen to me several times, in my case it seems to depend on which port (of a laptop) I connect the HDD. Maybe in one of the ports the electrical contact is not so good anymore or maybe the cable was in some position that promoted bad electrical contact.

I have also seen disks just quit working until being unplugged and replugged if you probe the smart parameters while they are doing something, don't let smartd probe the external disks if you have smartd running.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#13 2013-09-10 23:56:15

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

Yes it is a spinning drive but no it is not usb powered, it's the internal hard drive.

I connected a usb "flash drive" to the computer and copy content form it to the internal disk /dev/sda2

and the internal disk (/dev/sda2) is having problems.i doubt its starved for power, but is there a chance that removing it and putting it back in would help? it looks like it's going to be a pain to open it up.

Offline

#14 2013-09-11 00:50:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: USB Drive corrupts home folder or ext4 filesystem.

I would back up anything on the disk you do not wish to lose before doing anything else. Even the short test failed, the log shows 140 errors and the disk has pending sectors. That does not look at all good...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2013-09-11 16:39:54

rabcor
Banned
Registered: 2013-02-09
Posts: 500

Re: USB Drive corrupts home folder or ext4 filesystem.

Thanks for your help guys! guess i'll just have to get a new disk.

Offline

Board footer

Powered by FluxBB