Linux – {Debian}External disk unmounting and corrupting on big files upload with seafile

debianexternal hard drivehard drivelinux

So I recently bought a little dev board (radxa) to use with a spare external drive that I had to create a dropbox clone. At first I was using Owncloud but due to my system limitation (32 bit) php couldn't handle file over 2gb so I switched to seafile since I have a lot of files over 2gb. Everything was going fine uploading smaller files (<1gb). Things changed when trying file over 1.5 gb.

My external drive is a normal 1Tb seagate with a power adapter and is formatted in EXT4. It is setup to auto-mount at boot (/dev/sda1 to /media/ExtDrive) and everything was working fine.

When uploading big files, I got an error from seafile that it can't read the data location (the drive). Then I check if its mounted with fdisk -l it doesn't seems like it. I can go in the folder of the drive but I get permission error and when changing the permission I'm getting a file system read-only error.

When rebooting, the PC seems to crash (can longuer connect trough SSH) and need to disconnect the power cord from both the PC and the external drive then everything seems fine until I retry to upload big files then the same thing happens.Sometime I even need to run fsck on the External Drive because it as been corrupted.

Could it be my external drive that is not working properly or it's a setting that I haven't configured ?

Thanks guys !

Here's the last couple of lines from dmesg:

[15296.905650] Buffer I/O error on device sda1, logical block 66827920
[15296.905670] Buffer I/O error on device sda1, logical block 66827921
[15296.905690] Buffer I/O error on device sda1, logical block 66827922
[15296.905716] Buffer I/O error on device sda1, logical block 66827923
[15296.905737] Buffer I/O error on device sda1, logical block 66827924
[15296.905760] Buffer I/O error on device sda1, logical block 66827925
[15296.905781] Buffer I/O error on device sda1, logical block 66827926
[15296.905799] Buffer I/O error on device sda1, logical block 66827927
[15296.905815] Buffer I/O error on device sda1, logical block 66827928
[15296.905832] Buffer I/O error on device sda1, logical block 66827929
[15296.905849] Buffer I/O error on device sda1, logical block 66827930
[15296.905868] Buffer I/O error on device sda1, logical block 66827931
[15296.905885] Buffer I/O error on device sda1, logical block 66827932
[15296.905904] EXT4-fs warning (device sda1): ext4_end_bio:258: I/O error writing to inode     16258903 (offset 1228800 size 126976 starting block 66827940)
[15296.905940] sd 0:0:0:0: rejecting I/O to offline device
[15296.905996] sd 0:0:0:0: rejecting I/O to offline device
[15296.906052] sd 0:0:0:0: rejecting I/O to offline device
[15296.906083] sd 0:0:0:0: rejecting I/O to offline device
[15296.916336] sd 0:0:0:0: rejecting I/O to offline device
[15296.926333] sd 0:0:0:0: rejecting I/O to offline device
[15296.926358] Buffer I/O error on device sda1, logical block 66827933
[15296.926400] Buffer I/O error on device sda1, logical block 66827934
[15296.926425] Buffer I/O error on device sda1, logical block 66827935
[15296.926456] Buffer I/O error on device sda1, logical block 66827936
[15296.926486] Buffer I/O error on device sda1, logical block 66827937
[15296.926517] Buffer I/O error on device sda1, logical block 66827938
[15296.926544] Buffer I/O error on device sda1, logical block 66827939
[15296.926580] Buffer I/O error on device sda1, logical block 66827940
[15296.926605] Buffer I/O error on device sda1, logical block 66827941
[15296.926635] Buffer I/O error on device sda1, logical block 66827942
[15296.926668] Buffer I/O error on device sda1, logical block 66827943
[15296.926694] Buffer I/O error on device sda1, logical block 66827944
[15296.926723] EXT4-fs warning (device sda1): ext4_end_bio:258: I/O error writing to inode  16258903 (offset 1351680 size 49152 starting block 66827952)
[15296.926795] JBD2: Detected IO errors while flushing file data on sda1-8
[15296.926822] sd 0:0:0:0: rejecting I/O to offline device
[15296.926947] sd 0:0:0:0: rejecting I/O to offline device
[15296.927041] sd 0:0:0:0: rejecting I/O to offline device
[15296.927655] Aborting journal on device sda1-8.
[15296.927727] sd 0:0:0:0: rejecting I/O to offline device
[15296.927790] JBD2: I/O error detected when updating journal superblock for sda1-8.
[15296.929017] sd 0:0:0:0: rejecting I/O to offline device
[15296.929056] EXT4-fs error (device sda1): ext4_journal_start_sb:296: Detected aborted journal
[15296.929088] EXT4-fs (sda1): Remounting filesystem read-only
[15296.929105] EXT4-fs (sda1): previous I/O error to superblock detected
[15296.929138] sd 0:0:0:0: rejecting I/O to offline device
[15296.929167] EXT4-fs (sda1): ext4_da_writepages: jbd2_start: 515 pages, ino 16258904; err -30
[15296.936264] sd 0:0:0:0: rejecting I/O to offline device
[15296.936342] sd 0:0:0:0: rejecting I/O to offline device
[15296.936381] sd 0:0:0:0: rejecting I/O to offline device
[15296.936411] sd 0:0:0:0: rejecting I/O to offline device
[15296.936442] sd 0:0:0:0: rejecting I/O to offline device
[15296.936477] sd 0:0:0:0: rejecting I/O to offline device
[15298.516344] rk30_i2c rk30_i2c.2: Addr[0x50] wait event timeout, state: 0, is_busy: 1, error: 0, complete_what: 0x2, ipd: 0x1b
[15298.536301] rk30_i2c rk30_i2c.1: Addr[0x5a] wait event timeout, state: 0, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[15298.556330] rk30_i2c rk30_i2c.1: I2C_CON: start bit is set
[15298.776342] rk30_i2c rk30_i2c.1: Addr[0x5a] wait event timeout, state: 0, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[15298.796291] rk30_i2c rk30_i2c.1: I2C_CON: start bit is set
[15299.016313] rk30_i2c rk30_i2c.1: Addr[0x5a] wait event timeout, state: 0, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[15299.036311] rk30_i2c rk30_i2c.1: I2C_CON: start bit is set
[15299.256302] rk30_i2c rk30_i2c.2: Addr[0x50] wait event timeout, state: 0, is_busy: 1, error: 0, complete_what: 0x0, ipd: 0x10
[15299.276327] rk30_i2c rk30_i2c.2: I2C_CON: start bit is set
[15309.180104] usb 2-1.4.4: USB disconnect, device number 15
[15310.697177] usb 2-1.4.4: new low speed USB device number 16 using usb20_host
[15310.802377] usb 2-1.4.4: New USB device found, idVendor=093a, idProduct=2510
[15310.808255] usb 2-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[15310.808388] usb 2-1.4.4: Product: USB Optical Mouse
[15310.814035] usb 2-1.4.4: Manufacturer: PixArt
[15310.827271] input: PixArt USB Optical Mouse as /devices/platform/usb20_host/usb2/2-1/2-1.4/2-1.4.4/2-1.4.4:1.0/input/input251
[15310.832038] generic-usb 0003:093A:2510.00FC: input: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-usb20_host-1.4.4/input0
[15370.875962] usb 2-1.4.4: USB disconnect, device number 16
[15372.389136] usb 2-1.4.4: new low speed USB device number 17 using usb20_host
[15372.493410] usb 2-1.4.4: New USB device found, idVendor=093a, idProduct=2510
[15372.495338] usb 2-1.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[15372.495403] usb 2-1.4.4: Product: USB Optical Mouse
[15372.497344] usb 2-1.4.4: Manufacturer: PixArt
[15372.509754] input: PixArt USB Optical Mouse as /devices/platform/usb20_host/usb2/2-1/2-1.4/2-1.4.4/2-1.4.4:1.0/input/input252
[15372.512293] generic-usb 0003:093A:2510.00FD: input: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-usb20_host-1.4.4/input0
[15386.650305] sd 0:0:0:0: rejecting I/O to offline device
[15386.652343] sd 0:0:0:0: rejecting I/O to offline device

Best Answer

I was able to fix it by unplugging my mouse and plugin the External drive into a USB hub. I'm confused on why it's working but at least it does !

Related Question