3

My setup is:

Raspberry Pi Model 3B V1.2

No USB HUB

External 3.5 inch HDD:

  • Powered Enclosure: Sabrent USB 2.0/ESATA to 3.5 Inch IDE or SATA/SATA II Aluminum Hard Drive Enclosure Case with Cooling Fan.
  • HDD: HGST Ultrastar 7K4000 HUS724030ALA640 3TB 64MB Cache

I can mount the drive just fine in fstab and read, write/ make subdirectories just fine. The disk will stay mounted for days if I dont mess with it. Writing small files to the disk is just fine too.

The issue comes when I try to write a large file (~1 GB movie). It will go well for the first few hundred MB and then stall and then quit with the following message: "Error splicing file: Read-only file system" What has happened is that the drive is just spontaneously ejected during this process.

Resolution steps attempted:

3 different power supplies

  • 5.25V/2.5A (KANO)
  • 5V/2A (Apple 10W)
  • 5V/2.1A (Generic)

file transfer method

  • GUI drag and drop
  • cp command
  • mv command
  • > command

deprecating USB speed

  • add dwc_otg.speed=1 to /boot/cmdline.txt

increasing USB power

  • add max_usb_current=1 to /boot/config.txt

At this point I'm out of ideas to try, because now I'm at my limit of what root cause could be.

I'm new to linux and RPi. I started this whole endeavor to set up a low-cost low-power home NAS, Time Machine target and PLEX server, so this is kind of a dealbreaker.

OS info:

pi@raspberrypi:~ $ uname -a

Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux

pi@raspberrypi:~ $ lsb_release -irc

Distributor ID: Raspbian

Release: 10

Codename: buster


Edit 1:

dmesg output:

[ 13.453145] Bluetooth: RFCOMM socket layer initialized [ 13.453171] Bluetooth: RFCOMM ver 1.11 [ 15.550139] fuse init (API version 7.27) [ 20.854707] logitech-hidpp-device 0003:046D:101B.0006: HID++ 1.0 device connected. [ 122.206592] usb 1-1.3: reset high-speed USB device number 6 using dwc_otg [ 128.767440] usb 1-1.3: USB disconnect, device number 6 [ 128.806611] print_req_error: I/O error, dev sda, sector 2147938544 [ 128.806750] print_req_error: I/O error, dev sda, sector 2147938784 [ 128.806899] print_req_error: I/O error, dev sda, sector 2147939024 [ 128.806930] print_req_error: I/O error, dev sda, sector 2147939264 [ 128.807002] print_req_error: I/O error, dev sda, sector 2147939504 [ 128.807027] print_req_error: I/O error, dev sda, sector 2147939744 [ 128.808494] print_req_error: I/O error, dev sda, sector 2147939984 [ 128.808520] print_req_error: I/O error, dev sda, sector 2147940224 [ 128.808539] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 83886080 size 7344128 starting block 268492544) [ 128.808554] Buffer I/O error on device sda2, logical block 56576 [ 128.808572] Buffer I/O error on device sda2, logical block 56577 [ 128.808583] Buffer I/O error on device sda2, logical block 56578 [ 128.808593] Buffer I/O error on device sda2, logical block 56579 [ 128.808604] Buffer I/O error on device sda2, logical block 56580 [ 128.808614] Buffer I/O error on device sda2, logical block 56581 [ 128.808625] Buffer I/O error on device sda2, logical block 56582 [ 128.808635] Buffer I/O error on device sda2, logical block 56583 [ 128.808646] Buffer I/O error on device sda2, logical block 56584 [ 128.808656] Buffer I/O error on device sda2, logical block 56585 [ 128.809861] print_req_error: I/O error, dev sda, sector 2147940352 [ 128.809892] print_req_error: I/O error, dev sda, sector 2147940592 [ 128.812013] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 83886080 size 8388608 starting block 268492800) [ 128.822685] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 83886080 size 8388608 starting block 268493056) [ 128.824078] JBD2: Detected IO errors while flushing file data on sda2-8 [ 128.824114] Aborting journal on device sda2-8. [ 128.824299] Buffer I/O error on dev sda2, logical block 134250496, lost sync page write [ 128.824314] JBD2: Error -5 detected when updating journal superblock for sda2-8. [ 128.826029] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 2101248 starting block 268493312) [ 128.829484] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 3149824 starting block 268493568) [ 128.832403] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 4198400 starting block 268493824) [ 128.835197] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 5246976 starting block 268494080) [ 128.838160] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 6295552 starting block 268494336) [ 128.841046] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 7344128 starting block 268494592) [ 128.843859] EXT4-fs error (device sda2) in ext4_do_update_inode:5371: Journal has aborted [ 128.843977] Buffer I/O error on dev sda2, logical block 0, lost sync page write [ 128.844010] EXT4-fs warning (device sda2): ext4_end_bio:323: I/O error 10 writing to inode 13631490 (offset 92274688 size 8388608 starting block 268494848) [ 128.845111] EXT4-fs (sda2): I/O error while writing superblock [ 128.845125] EXT4-fs error (device sda2): mpage_map_and_submit_extent:2587: comm kworker/u8:5: Failed to mark inode 13631490 dirty [ 128.845191] Buffer I/O error on dev sda2, logical block 0, lost sync page write [ 128.845221] EXT4-fs (sda2): I/O error while writing superblock [ 128.845242] EXT4-fs error (device sda2) in ext4_writepages:2897: IO failure [ 128.845305] Buffer I/O error on dev sda2, logical block 0, lost sync page write [ 128.845333] EXT4-fs (sda2): I/O error while writing superblock [ 128.847108] JBD2: Detected IO errors while flushing file data on sda2-8 [ 128.848603] Buffer I/O error on dev sda2, logical block 0, lost sync page write [ 128.848641] EXT4-fs (sda2): I/O error while writing superblock [ 128.848650] EXT4-fs error (device sda2): ext4_journal_check_start:61: Detected aborted journal [ 128.848675] EXT4-fs (sda2): Remounting filesystem read-only [ 128.848743] Buffer I/O error on dev sda2, logical block 0, lost sync page write [ 128.848765] EXT4-fs (sda2): I/O error while writing superblock [ 128.986890] Buffer I/O error on dev sda3, logical block 97550336, lost sync page write [ 128.986901] JBD2: Error -5 detected when updating journal superblock for sda3-8. [ 128.986905] Aborting journal on device sda3-8. [ 128.986914] Buffer I/O error on dev sda3, logical block 97550336, lost sync page write [ 128.986919] JBD2: Error -5 detected when updating journal superblock for sda3-8. [ 128.990918] Buffer I/O error on dev sda3, logical block 0, lost sync page write [ 128.990931] EXT4-fs (sda3): I/O error while writing superblock

Output of lsblk -fa:

sda
├─sda1 │ ext4 1tb_tm_vol │ 10b12fb6-e691-4276-a8bf-1665ea136b9a 955.7G 0% /mnt/tm ├─sda2 │ ext4 1tb_plex_vol │ 67f5d5a5-f34e-44c2-9788-b3a08e2e5cb8 955G 0% /mnt/plex └─sda3 ext4 760gb_nas_vol 345202d2-d4a7-4901-bebd-5de50d5bad27 696.4G 0% /mnt/nas

Output of fsck:

fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

          24 inodes used (0.00%, out of 67108864)
           0 non-contiguous files (0.0%)
           0 non-contiguous directories (0.0%)
             # of inodes with ind/dind/tind blocks: 0/0/0
             Extent depth histogram: 15/1
     4664356 blocks used (1.74%, out of 268435456)
           0 bad blocks
           1 large file

           3 regular files
          12 directories
           0 character device files
           0 block device files
           0 fifos
           0 links
           0 symbolic links (0 fast symbolic links)
           0 sockets
------------
          15 files
  • Comments are not for extended discussion; this conversation has been moved to chat. – Ghanima Feb 16 at 18:10
1

This is not a complete answer but a suggestion to narrow down the problem. All transfer methods you have used are using the same buffered input/output API of the operating system so it shouldn't make a difference. To test low level direct writing of random data without using buffered I/O you can use dd assuming disk partition /dev/sda2 is mounted at /mnt/p2/:

rpi ~$ sudo dd if=/dev/urandom of=/mnt/p2/random.file bs=1G count=1 oflags=direct

If this fails then you should look at your disk and its hardware. You should repeat the test with a fresh flashed Raspbian Buster Light image to exclude any side effects of your installation. If this works then you have a problem with the additional software you have installed.

I don't know if it's possible for you but after a backup of the disk you can try to "clean" it up with

rpi ~$ sudo dd if=/dev/zero of=/dev/sda bs=4M conv=fsync

This will overwrite the complete disk with all zeros and may take hours if it doesn't fail. This will also test if low level writing is the problem anywhere on the disk not only where you wrote random.file. Afterwards you have to repartition the disk and create the filesystems.

| improve this answer | |
  • I have replaced the disk and it still happened, so I wwapped the data cable and was able to tsfr a file so I thought it was resolved. When I went to copy more, it still fails. I think its the enclosure, as another enclosure I have works just fine albeit with a different disk... so I suppose it cold be that these HGST disks don't play nice, but I seriously doubt that. Is there such a thing as needing to install the right USB driver under Raspian? How would I even go about finding out what it would be? – Matsumura_Fishworks Mar 1 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.